Generate your first SDK

Schedule a Demo

Generating SDKs often requires understanding the state of your OpenAPI Specification as well as your specific requirements. For the ideal experience, we strongly recommend scheduling a demo or emailing us to get started.

If you’d rather get started immediately, you can use Fern’s CLI tool to generate your first SDK.

1

Install the Fern CLI

First, install the CLI tool by running the following command:

$npm install -g fern-api
2

Initialize the Fern Folder

3

Pass fern check

Run fern check to ensure that your API Definition is valid. If there are any errors, you will need to fix them before proceeding.

If you’re using an OpenAPI Specification, check out all of our supported extensions.

4

Add the SDK generator

Pro Features

By default, none of the pro features will be enabled.

You can now use the SDK in your application. Here’s an example of how you can use the SDK:

1fern add fern-typescript-node-sdk --group sdk
5

Run fern generate --group sdk

Next up, run the following command to generate the SDK:

$fern generate --group sdk

This will create a fern folder in your current directory with the Fern Definition. For example, if you’re generating a TypeScript SDK, the folder structure will look like this:

$sdks/
> typescript/
> src/
> ├─ index.ts
> ├─ Client.ts
> └─ api
> └─ errors
> └─ serialization