> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Publish TypeScript SDKs manually

This guide covers publishing TypeScript SDKs manually. For information on automating TypeScript SDK publishing, see [Publish TypeScript SDKs automatically](/docs/sdk-generator/publish/typescript-auto/).

To share your generated TypeScript SDK with the community, you can publish it to npm. This enables other developers to easily install it using npm. Follow the steps below.

## Prerequisites

To publish your SDK to npm, you need the following:

* An npm account. You can create it at [npmjs.com](https://www.npmjs.com).
* npm CLI installed. You can install it with Node.js from [nodejs.org](https://nodejs.org).
* A unique package name. You can check availability using the `npm search your-package-name` command.

## Publish your TypeScript SDK to npm

1. Configure `package.json`. Ensure these fields are set correctly:

   ```json
   {
      "name": "@your-org/your-sdk",
      "version": "1.0.0",
      "description": "SDK for Your API",
      "main": "dist/index.js",
      "types": "dist/index.d.ts",
      "files": [
       "dist",
       "README.md",
       "LICENSE"
      ],
      "repository": {
       "type": "git",
       "url": "https://github.com/your-org/your-sdk"
      },
      "keywords": ["api", "sdk", "your-api"],
      "author": "Your Name",
      "license": "MIT"
   }
   ```

2. Build the SDK.

   ```bash
   npm install
   npm run build
   npm test
   ```

3. Sign in to npm.

   ```bash
   npm login
   ```

4. Publish the package.

   * For public packages, use:

     ```bash
     npm publish --access public
     ```

   * For scoped private packages, use:

     ```bash
     npm publish
     ```

5. Verify publication:

   ```bash
   npm info @your-org/your-sdk
   ```

## Publish updates

To publish an updated SDK, update the version in the `package.json` following the [semantic versioning](https://semver.org/):

* Patch: `1.0.0` → `1.0.1` (bug fixes)
* Minor: `1.0.0` → `1.1.0` (new features, backward compatible)
* Major: `1.0.0` → `2.0.0` (breaking changes)

Alternatively, you can use the `npm version` command:

```bash
npm version patch  # or minor, or major
npm publish
```

## Best practices for publishing TypeScript SDKs

Use the following best practices when publishing your TypeScript SDK to npm:

* Use `.npmignore` to exclude unnecessary files.
* Include a comprehensive `README.md`.
* Add a `LICENSE` file.
* Tag releases in Git: `git tag v1.0.0 && git push --tags`.
* Set up CI/CD for automated publishing.
* Consider using `np` tool for streamlined publishing: `npx np`.