You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<imgsrc="assets/npm-packages.png"alt="Versioned package published on npm" />
12
12
</Frame>
13
13
14
14
<Info>This guide assumes that you already have an initialized `fern` folder on your local machine. If you don’t, run `fern init`. See [TypeScript Quickstart](quickstart.mdx) for more details.</Info>
@@ -31,18 +31,17 @@ you'll have a versioned package published on npm.
31
31
32
32
33
33
```bash
34
-
fern add fern-typescript-node-sdk --group ts-sdk
34
+
fern add fern-typescript-sdk --group ts-sdk
35
35
```
36
36
37
37
Once the command completes, you'll see a new group created in your `generators.yml`:
@@ -55,11 +54,11 @@ you'll have a versioned package published on npm.
55
54
56
55
Next, change the output location in `generators.yml` from `local-file-system` (the default) to `npm` to indicate that Fern should publish your package directly to the npm registry:
@@ -72,11 +71,11 @@ you'll have a versioned package published on npm.
72
71
Your package name must be unique in the npm repository, otherwise publishing your SDK to npm will fail. Update your package name if you haven't done so already:
The `namespaceExport` option controls the name of the generated client. This is the name customers use to import your SDK (`import { your-client-name } from 'your-package-name';`).
Click on **Generate New Token**, then choose the appropriate token type. For more information on access tokens and which type to choose, see npm's [About access tokens](https://docs.npmjs.com/about-access-tokens) documentation.
149
+
Click on **Generate New Token**, then choose the appropriate token type.
150
+
151
+
<Info>For more information on access tokens and which type to choose, see npm's [About access tokens](https://docs.npmjs.com/about-access-tokens) documentation. </Info>
151
152
152
153
<AccordionGroup>
153
154
<Accordion title="Option 1: Classic Token">
154
155
155
156
1. Select **Classic Token**
156
157
1. Name your token and select **Automation** as the token type.
158
+
1. Click **Generate Token**.
159
+
160
+
<Warning>Save your new token – it won’t be displayed after you leave the page.</Warning>
<Warning>When you click **Generate Token**, you’ll be returned to the **Access Tokens** dashboard. A box on the top of the dashboard will confirm that you successfully created a new token and prompt you to copy your token id. Make sure you save this id, as you'll need to add it to your GitHub repository and `generators.yml` later on.</Warning>
1. Configure your token's access to packages and scopes.
172
172
1. Configure your token's access to organizations. In order to fill this out, you must have at least one organization already configured in npm. See [Creating an organization](https://docs.npmjs.com/creating-an-organization) for more information.
173
173
1. Optionally fill out additional permissions according to your organization's requirements.
174
+
1. Click **Generate Token**.
175
+
176
+
<Warning>Save your new token – it won’t be displayed after you leave the page.</Warning>
Add `token: ${NPM_TOKEN}` to `generators.yml` to tell Fern to use the `NPM_TOKEN` environment variable for authentication when publishing to the npm registry.
Local machine output will verify that the release is pushed to your repository and tagged with the version you specified. You'll receive an email from npm notifying you that a new version of your package has been successfully published!
233
+
Local machine output will verify that the release is pushed to your
234
+
repository and tagged with the version you specified. Log back into npm and
0 commit comments