Start from an AdonisJS 7 app
Already have one? Skip ahead. Otherwise the API starter kit is a good base:AdonisJS 7 runs on Node 24 or later, and the SDK on Node 26.12.1 or later, so use 26.12.1+. Every
kit starts on SQLite; to use PostgreSQL or MySQL, see
Lucid’s setup.
Terminal
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 the package and the SDK
In a terminal, in the same folder as the The package fits the SDK into AdonisJS; the SDK is its peer, so your app holds the one copy both
use. Use the package manager your app already uses.
.npmrc, run the line for the package manager your
project uses:Configure it
Terminal
config/attract.ts
The site, by its slug, and the options every call shares.
.env and start/env.ts
FETCHSKI_ATTRACT_SITE, _URL, _API_KEY and _SIGNING_SECRET, each checked at boot.adonisrc.ts
The provider, which puts the client in the container, and the
attract:* commands..env.example
The same names, the key and secret left empty.
Terminal
.env? Store it sealed in a table instead (see
Key in the database):Terminal
Give your coding agent the skill
Terminal
Requirements
AdonisJS 7
The provider, the config file and the Ace commands. Lucid only for the key in the database.
Node 26.12.1+
The SDK’s floor: earlier releases carry severe security vulnerabilities.
Japa 5
For
fakeAttract() in your tests: the runner every AdonisJS 7 kit ships.Next: configuration
The generated
config/attract.ts, the default site, and more sites.