> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Set up AgentKit with your coding agent

Add AgentKit to your codebase with Claude Code, Codex, GitHub Copilot CLI, Cursor or another coding agent: install the authstack plugin and paste one prompt.
Install the authstack plugin into your coding agent and paste one prompt. The agent generates client initialization, connected account management, OAuth authorization, and token handling — no boilerplate required.

## Before you start

- A Scalekit account at [app.scalekit.com](https://app.scalekit.com)
- A connector configured under **AgentKit** > **Connections**. The prompt defaults to GitHub (`github-connect`). Name another connector if you want that instead.
- Your API credentials from **Developers** > **Settings** > **API Credentials**

## Pick your coding agent

  **Recommended: one command**

  ```bash title="Terminal"
  npx @scalekit-inc/cli setup
  ```

  For repeated use: `npm install -g @scalekit-inc/cli` then `scalekit setup`.

  The CLI installs the authstack plugin for your editor. Then load the shipped skill `integrate-agentkit`. Complete any browser OAuth prompt for the Scalekit MCP server.

  Done: the command exits 0 and `integrate-agentkit` is available.

  Then copy the AgentKit prompt below (or describe your goal naturally).

  **Per-tool details**

  After the CLI (or if you prefer tool-native flows):

  - Claude Code / Copilot: marketplace + plugin install is handled by the CLI.
  - Cursor / Codex: plugins are installed locally by the CLI.
  - Other agents (Cline, Amp, OpenCode and other agents that support skills): run `npx @scalekit-inc/cli skills install -y` to install the Scalekit skills to `~/.agents/skills`, or `npx skills add scalekit-inc/authstack --skill integrate-agentkit` for this skill only.

  Then copy the AgentKit prompt below.

## Verify the setup

1. **Set environment variables** — copy `SCALEKIT_CLIENT_ID`, `SCALEKIT_CLIENT_SECRET`, and `SCALEKIT_ENVIRONMENT_URL` from **Developers** > **Settings** > **API Credentials** in the dashboard.
   Done: all three names are set in `.env`.
2. **Trigger the authorization flow** — run the generated example and confirm the browser redirects to the connector's consent page.
   Done: the consent page opens.
3. **Call a tool** — after consent, run a read-only tool through Scalekit, such as `github_user_get_authenticated` for GitHub.
   Done: the tool call returns data from the connector.

> caution: Review generated code before deploying
>
> Verify that token validation logic, error handling, and environment variable references match your application's requirements. The generated code is a foundation, not a finished implementation.

## Troubleshooting

**The agent generated code for a connector I haven't configured yet**

The plugin uses the connector name you provide in the prompt. If that connector isn't configured in your Scalekit Dashboard, creating the authorization link fails with `connection not found for the given key`.

Fix: in the [Scalekit Dashboard](https://app.scalekit.com), go to **AgentKit** > **Connections** > **Create Connection**, finish the connection, then re-run the agent prompt with the exact connection name from the dashboard.

**I want to swap connectors after the initial generation**

Re-run the implementation prompt with the new connector name. The agent updates the connector reference in the client initialization and regenerates the tool calls. Existing connected accounts for the old connector are not affected.

**The scaffolded code references an SDK version that doesn't match my lockfile**

The plugin targets the latest stable Scalekit SDK. If your lockfile pins an older version, either upgrade the SDK (`npm install @scalekit-sdk/node@latest` or equivalent) or ask the agent to regenerate using your pinned version by adding "use SDK version X.Y.Z" to the prompt.


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
