Publish generated contract bindings to npm

Configure a GitMyABI project so each successful build publishes typed TypeScript contract bindings to npm.

Guides

Every GitMyABI project that builds successfully publishes a TypeScript bindings package to an npm registry. This guide covers the configuration that controls package visibility and how a consumer installs the result. Use the package name, version, and registry shown on the build detail page rather than hardcoding any of these values.

What gets published

A versioned npm package containing one named class export per compiled contract. The shape of the package is documented in review the package format.

Steps

  1. Open the project — either during initial setup or in Project Settings — and locate the NPM Package Visibility section.
  2. Use the checkbox labelled “Make this package publicly accessible without authentication” to choose the package's visibility. By default, this checkbox is auto-synced from the GitHub repository's visibility: public repositories produce public packages, private repositories produce private packages. You can change this later in project settings.
  3. For private packages, configure the registry shown in the package installation instructions on the build detail page. The registry configuration includes the registry URL and an authentication token. The exact values are project-specific; do not assume a fixed registry URL.
  4. Trigger a build for the desired branch, tag, release, or commit. On success, the build detail page shows the package name, version, and install command.

Versioning

The published package version comes from the project's package.json if one is set, otherwise it falls back to 0.0.<buildNumber>. The published version is shown on the build detail page.

Package name

The published package name is shown on the build detail page; reference it from there rather than guessing a convention. Consumers install with npm install <package-name>@<version> using the values displayed there.

See ABI and TypeScript bindings publishing for the end-to-end pipeline.

Related