typescript-client-initializationlisted
Install: claude install-skill MuHamza30/paypal-api-plugin
# Initializing an APIMatic-generated TypeScript SDK client
Package and type names below are concrete for this SDK; replace the remaining `{...}` placeholders with
the real names from its source:
- `{Controller}` — a controller class exported from the package root. Its postfix (`Api`, `Controller`,
…) is the SDK's controller-naming setting, fixed at generation time; read the real `export class`
names in `src/controllers/` rather than assuming either.
## The shape: one options object, no builder
The SDK exports a single `Client` class. You construct it with **one options object**, a
`Partial<Configuration>` — every field is optional and missing fields fall back to `DEFAULT_CONFIGURATION`:
```ts
import { Client, Environment } from 'paypal-server-sdklib';
const client = new Client({
environment: Environment.{Name},
// auth credential objects — see typescript-authentication
timeout: 30000, // ms; 0 disables the timeout
httpClientOptions: { // retries, proxy, agents — see typescript-configuration-resilience
// ...
},
});
```
There is **no** separate options class or builder — the `Configuration` interface *is* the constructor
argument. Open `src/configuration.ts` for the exact field set; it varies per API but always includes
`timeout`, `environment`, `httpClientOptions`, plus the credential objects for the schemes the API uses
(and any server parameters such as `port`). `src/defaultConfiguration.ts` holds `DEFAULT_CONFIGURATION`