> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fetchski-attract.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Install the package from your own site, then one node ace configure points the app at the site.

**1. Start from an AdonisJS 7 app**

Already have one? Skip ahead. Otherwise the API starter kit is a good base:

```bash Terminal theme={"dark"}
npm create adonisjs@latest my-app -- --kit=api
```

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](https://lucid.adonisjs.com/docs/introduction).

**2. Point the @fetchski scope at your site**

Your own site serves the `@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:

```ini .npmrc theme={"dark"}
@fetchski:registry=https://acme.example/api/v1/sdk/npm/
//acme.example/api/v1/sdk/npm/:_authToken=fsk_acme_…
```

The first line says `@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.

> [!NOTE]
>
> **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](https://docs.fetchski-attract.com/authentication.md)).

Then keep the file out of git. Add this line to the project's `.gitignore` (make the file if
there isn't one):

```text .gitignore theme={"dark"}
.npmrc
```

> [!WARNING]
>
> **`.npmrc` now holds a key to your site: never commit it.** If git already tracks a `.npmrc`, stop
> tracking it with `git rm --cached .npmrc`. Keep these lines in this project's `.npmrc` only, never
> in the `.npmrc` in your home folder. In CI, write the same file from a secret before installing.

**3. Install the package and the SDK**

In a terminal, in the same folder as the `.npmrc`, run the line for the package manager your
project uses:

```bash npm theme={"dark"}
npm install @fetchski/attract-cms-adonis @fetchski/attract-cms-sdk
```

```bash pnpm theme={"dark"}
pnpm add @fetchski/attract-cms-adonis @fetchski/attract-cms-sdk
```

```bash bun theme={"dark"}
bun add @fetchski/attract-cms-adonis @fetchski/attract-cms-sdk
```

> [!TIP]
>
> **`401 Unauthorized`?** Your site refused the key in `.npmrc`: it's mistyped or cut short, switched
> off, or past its expiry date. Check too that `.npmrc` sits in the folder you ran the command in.

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.

> [!TIP]
>
> pnpm 11 skips a release on its first day: [TypeScript → Installation](https://docs.fetchski-attract.com/typescript/installation.md)
> has the setting that takes each `@fetchski` release at once.

**4. Configure it**

```bash Terminal theme={"dark"}
node ace configure @fetchski/attract-cms-adonis
```

It asks for the site's URL, its API key and the key's signing secret (leave it empty for a
token-only key), reads the site's slug from the key, and writes:

> [card] [config/attract.ts](https://docs.fetchski-attract.com/adonisjs/configuration.md)
>
> The site, by its slug, and the options every call shares.

> [card] .env and start/env.ts
>
> `FETCHSKI_ATTRACT_SITE`, `_URL`, `_API_KEY` and `_SIGNING_SECRET`, each checked at boot.

> [card] adonisrc.ts
>
> The provider, which puts the client in the container, and the `attract:*` commands.

> [card] .env.example
>
> The same names, the key and secret left empty.

A malformed URL, key or secret writes nothing. Then check the site answers:

```bash Terminal theme={"dark"}
node ace attract:check
```

> [!TIP]
>
> Configure once, at the prompts: the key and secret are hidden as you type. A deploy or CI run
> doesn't run `configure` again; it sets `FETCHSKI_ATTRACT_SITE`, `_URL`, `_API_KEY` and
> `_SIGNING_SECRET` in the environment from its own secret store. (`--url`, `--key` and `--secret`
> exist, but a flag's value lands in shell history and is visible to other processes; given
> `--url` and `--key`, a missing `--secret` means a token-only key.)

Rather keep the key out of `.env`? Store it sealed in a table instead (see
[Key in the database](https://docs.fetchski-attract.com/adonisjs/key-in-database.md)):

```bash Terminal theme={"dark"}
node ace configure @fetchski/attract-cms-adonis --database
```

**5. Give your coding agent the skill**

```bash Terminal theme={"dark"}
DISABLE_TELEMETRY=1 npx skills add ./node_modules/@fetchski/attract-cms-sdk/skills
```

The SDK's [Agent Skill](https://docs.fetchski-attract.com/agent-skills.md), so your agent calls the SDK the way these guides do.

## Requirements

> [card] AdonisJS 7
>
> The provider, the config file and the Ace commands. Lucid only for the key in the database.

> [card] Node 26.12.1+
>
> The SDK's floor: earlier releases carry severe security vulnerabilities.

> [card] Japa 5
>
> For `fakeAttract()` in your tests: the runner every AdonisJS 7 kit ships.

> [card] [Next: configuration](https://docs.fetchski-attract.com/adonisjs/configuration.md)
>
> The generated `config/attract.ts`, the default site, and more sites.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.