Skip to main content

Subpath imports

Prefer the main gopay-sdk import for most apps. Subpaths help when you want narrower imports (e.g. only errors + HTTP types) or clearer dependency boundaries in larger codebases.
The SDK exposes the main entrypoint (gopay-sdk) for typical usage. For advanced cases (custom HttpTransport, tree-shaking, or smaller bundles), you can import from subpaths:
SubpathContents
gopay-sdk/errorsGoPayApiError, GoPayConfigError
gopay-sdk/httpHttpTransport, HTTP types (HttpMethod, HttpHeaders, …)
gopay-sdk/authTokenCache, InMemoryTokenCache
gopay-sdk/configCreateGoPayClientConfig, GoPayClientOptions, NormalizedGoPayClientConfig

Examples

import { GoPayApiError } from 'gopay-sdk/errors';
import type { HttpTransport } from 'gopay-sdk/http';
import { InMemoryTokenCache } from 'gopay-sdk/auth';
import type { CreateGoPayClientConfig } from 'gopay-sdk/config';
The main gopay-sdk export still re-exports these symbols; subpaths are optional.