Publish your TypeScript SDK with npm

To make your TypeScript SDK publicly accessible, publish to npm. Once you’ve followed the steps below to connect your npm account to your SDK, Fern will automatically publish the latest version of your SDK.

Creating an npm token

1

Log In

Log into npm.

3

Generate Token

Click on Generate New Token and select Classic Token. Name your token and select Automation as the token type. Once finished, click Generate Token.

Save your token

Be sure to save the generated token - it won’t be displayed after you leave the page.

Adding tokens to your GitHub repository

Using GitLab? Follow these steps.

1

Open Repository

Open your Fern repository in GitHub.

3

Add Secret

Select New repository secret. Name your secret (we recommend NPM_TOKEN), add the corresponding token, and click Add secret.

Once you regenerate your SDK, a GitHub action will run to publish directly to npm!