3.37.0

(feat): Add support for OAuth token override, allowing users to skip the OAuth flow by providing a pre-generated bearer token directly. This is useful when users already have a valid token and don’t need to go through the OAuth client credentials flow.

To enable this feature, add the oauthTokenOverride configuration to your generators.yml file:

1# In generators.yml
2groups:
3 generators:
4 - name: fernapi/fern-typescript-sdk
5 config:
6 oauthTokenOverride: true

Users can then instantiate the client with either OAuth credentials or a pre-generated token:

1// Option 1: OAuth flow (existing behavior)
2const client = new Client({
3 clientId: "YOUR_CLIENT_ID",
4 clientSecret: "YOUR_CLIENT_SECRET",
5 ...
6});
7
8// Option 2: Direct bearer token override (new capability)
9const client = new Client({
10 token: "my-pre-generated-bearer-token",
11 ...
12});

3.35.9

(fix): Fix generated error classes to correctly set the prototype chain, capture stack traces, and set the error name so instanceof checks behave as expected. Error classes now use new.target.prototype instead of the static class name for Object.setPrototypeOf, conditionally call Error.captureStackTrace for V8 environments, and set this.name dynamically.