> This is Payabli documentation. For a complete page index, fetch https://docs.payabli.com/llms.txt — append .md to any page URL for lightweight markdown. For section-level indexes, query parameters, and other AI-optimized access methods, see https://docs.payabli.com/ai-agents.md

## v1.1.0

Added OAuth2 client-credentials support. Pass `bearerAuth: { clientId, clientSecret }` and the SDK handles the token exchange and refresh automatically:

```typescript
const client = new PayabliClient({
    bearerAuth: {
        clientId: "...",
        clientSecret: "...",
    },
    environment: PayabliEnvironment.Sandbox,
});
```

See the [TypeScript SDK guide](/developers/platform-sdk-typescript-guide) and [Authentication](/developers/authentication) to compare both methods.

### Breaking change: API key auth now requires the `apiKeyAuth` wrapper

Supporting OAuth alongside API key auth required restructuring the constructor's auth options. The top-level `apiKey` field no longer exists — wrap it in `apiKeyAuth`:

```typescript
// Before
const client = new PayabliClient({
    apiKey: "...",
    environment: PayabliEnvironment.Sandbox,
});

// After
const client = new PayabliClient({
    apiKeyAuth: {
        apiKey: "...",
    },
    environment: PayabliEnvironment.Sandbox,
});
```

Existing integrations using the old flat `apiKey` field need to update to this shape.