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:
| Subpath | Contents |
|---|
gopay-sdk/errors | GoPayApiError, GoPayConfigError |
gopay-sdk/http | HttpTransport, HTTP types (HttpMethod, HttpHeaders, …) |
gopay-sdk/auth | TokenCache, InMemoryTokenCache |
gopay-sdk/config | CreateGoPayClientConfig, 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.