Point the @fetchski scope at your site
Your own site serves the The first line says Then keep the file out of git. Add this line to the project’s
@fetchski packages, and any API key from it lets you in. In your
project’s folder (beside its package.json), make a file named .npmrc holding these two lines:.npmrc
@fetchski packages come from your site; the second is the key to sign in with.
Put your site’s address in both lines (set your site in the bar under this page’s title and the
example shows it), and paste your whole key in place of fsk_acme_…. Write the key itself, never a
variable or a value from .env: npm and pnpm don’t read .env, and pnpm refuses a variable here.Any API key from your site works, the same one your app uses included: its scopes and signing
mode don’t matter for installing, only that it’s switched on and not past its expiry date. No key
yet? Make one in the CMS under API Keys (Authentication).
.gitignore (make the file if
there isn’t one):.gitignore
Install
In a terminal, in the same folder as the
.npmrc, run the line for the package manager your
project uses:Give your coding agent the skill
Requirements
Runtimes
Node 26.12.1+, Bun, and browsers with
AbortSignal.any (Chrome 116, Firefox 124,
Safari 17.4).TypeScript
5.4 and later, under
nodenext, node16 or bundler resolution.No dependencies
Only
fetch and Web Crypto. ES modules; require() works on Node 26.12.1+ and Bun.Other setups
CI
CI
CI installs the same way: before the install, write the same
.npmrc from a secret holding one of
your site’s API keys. In GitHub Actions, with the key in a repository secret named
ATTRACT_PACKAGES_KEY:.github/workflows/ci.yml
In a browser bundle
In a browser bundle
It weighs about half a megabyte minified: every method comes with the client. Never ship an
API key or signing secret to a browser.
CommonJS
CommonJS
require('@fetchski/attract-cms-sdk') works on Node 26.12.1+ and Bun. TypeScript before 5.8 refuses
that import in a CommonJS file (TS1479): use ES modules there, or a newer TypeScript.Next: configuration
Zero-config from the environment, or options.