A library for interacting with the Shortcut REST API.
npm install @shortcut/client
Our legacy npm organization namespace is @useshortcut.
While it will still contain copies of all future released package versions, we strongly recommend switching to our primary @shortcut organization namespace.
The Shortcut API uses token-based authentication, you will need one to use this library.
To generate an API token, go to https://app.shortcut.com/settings/account/api-tokens.
To make it easier to explore our API, we recommend saving this token as an environment variable in your local dev environment:
export SHORTCUT_API_TOKEN="YOUR API TOKEN HERE"
This will allow you to copy and paste many examples in the documentation to try them out.
Requests made with a missing or invalid token will get a 401 Unauthorized response.
All requests must be made over HTTPS.
Tokens provide complete access to your Shortcut account, so keep them secure.
Don’t paste them into your source code, use an environment variable instead.
For security reasons, we will immediately invalidate any tokens we find have been made public.
To see all available exports, take a look at the API documentation or check out the .d.ts files in this repository.
import { ShortcutClient } from '@shortcut/client';
// const { ShortcutClient } = require('@shortcut/client');
const shortcut = new ShortcutClient('YOUR_API_TOKEN'); // See https://github.com/useshortcut/shortcut-client-js#how-to-get-an-api-token
shortcut.getCurrentMemberInfo().then((response) => console.log(response?.data));
shortcut.listProjects().then((response) => console.log(response?.data));
You can play with it in your web browser with this live playground:
Documentation for this client.
Documentation for the REST API.
This library uses GitHub Actions for CI/CD. npm releases are staged automatically, then approved manually in npm.
To publish a new version:
package.jsonmainv2.4.0)Staging is triggered automatically when a GitHub Release is created:
v2.4.0)publish.yml workflow will stage @shortcut/client, then stage the same built package under the legacy @useshortcut/client namespacenpm stage list, npm stage view <stage-id>, or the npmjs.com Staged Packages tabnpm stage approve <stage-id> or the npmjs.com approval flowThe npm trusted publisher for this repository must allow npm stage publish for .github/workflows/publish.yml. Trusted publishing from GitHub Actions automatically generates provenance for public packages from public repositories. Staged publishing requires npm CLI 11.15.0 or later and Node.js 22.14.0 or later.
API documentation is automatically deployed to GitHub Pages on every push to main:
gh-pages.yml workflow builds the documentation using TypeDoc