Skip to navigation

Quickstart

View as Markdown
Meet your new SDK generator

Describe the SDK you want, not the generators that build it. You only have to declare shared settings like auth, retries and package details once, and every language target inherits them. Add an SDK in a single line: a new language target. Targets run the newest SDK generators unless you pin generatorVersion.

Already using generators.yml? Follow the SDK Config migration guide to migrate.

Get up and running with Fern in under 5 minutes. This quickstart walks you through installing the CLI, initializing your project, and generating your first SDK locally.

Generate your first SDK
Generate an SDK with Fern. Follow the [SDKs quickstart](https://buildwithfern.com/learn/sdks/overview/quickstart.md) step by step.
1

Install the Fern CLI

npm install -g fern-api
2

Initialize the fern folder

Initialize the fern folder with your existing OpenAPI specification. Specify your organization name using the --organization flag.

fern init --openapi path/to/openapi.yml \
--organization <YourOrganization>

OpenAPI accepts both JSON and YAML formats.

This creates a fern folder in your current directory.

fern
fern.config.json# root-level configuration
sdk-config.yml# SDK targets and API spec configuration
openapi.yml# copy of a local spec
3

Validate your API definition

Check that your API definition is valid, and fix errors before proceeding:

fern check
4

Generate

fern init adds a TypeScript target to sdk-config.yml by default. Run fern generate to see it in action:

fern generate

This creates a sdks/typescript folder containing your generated SDK:

fern# created by fern init
sdks# created by fern generate
typescript
Client.ts
index.ts
core
api

Next steps

Now that you have a working SDK, set up GitHub repositories and configure publishing, generate SDKs in another languages, or learn more about Fern SDKs.