Skip to main content

Registry API

The tscircuit Registry API is an extension of the NPM Registry API that allows for additional features, such as building Circuit JSON in the cloud, automatic bundling to ESM and CommonJS, and more versioning automations.

Using the tscircuit NPM Registry

The regular public NPM registry API is available via npm.tscircuit.com. You can install endpoints from this registry by adding the following line to your .npmrc (or in any project with a package.json file)

@tsci:registry=https://npm.tscircuit.com

This line says "any package starting with @tsci should go to the tscircuit registry instead of the npm registry"

So you can now do bun add @tsci/seveibar.usb-c-flashlight to install that circuit to your npm project!

tscircuit Package Format

Every tscircuit package is in the format @tsci/<author>.<package_name> to avoid conflicts with other npm packages.

Advanced Bundling Endpoints

tscircuit runs an ESM and CJS bundling service, you can use these services to get a bundled version of any circuit, this is great for dynamic loading and execution, e.g. we use it in our tscircuit/import module!

Advanced Registry Endpoints

You can use your tscircuit CLI token to use the advanced API at https://registry-api.tscircuit.com.

You can get a tscircuit auth token with tsci auth print-token. After you get this token, you just need to add the Authorization: Bearer ${token} header to each API request.

The following endpoints are available:

EndpointPurpose
/package_files/listList all the files in a package
/package_files/createAdd a file to a package
/package_files/downloadDownload a file from a package
/packages/searchSearch for a package
/packages/listList your packages
/package_releases/createCreate a new release (version) of a package
/package_releases/updateUpdate a package release, e.g. to lock it from modifications
/package_releases/getGet a package release
/package_releases/listList package releases for a package

More information about our Advanced Registry API is coming soon, including a full OpenAPI specification!

Advanced Autorouting Endpoints

You can also use the registry to perform autorouting jobs for a Circuit JSON file.

EndpointPurpose
/autorouting/jobs/createCreate a new autorouting job
/autorouting/jobs/getGet the status of an autorouting job
/autorouting/jobs/get_outputGet the output of an autorouting job

Endpoint Documentation

/packages/search

Search for a package by name.

POST /packages/search
{
"query": "555timer"
}

RESPONSE:

{
"packages": [
{
"name": "@tsci/555timer",
"version": "1.0.0",
"description": "A 555 timer circuit"
}
]
}