> **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/)

---

# Coding agents: Add full-stack auth to your app

Let your coding agents guide you into implementing Scalekit full-stack authentication in minutes
FSAClaudeCodeSection,
  FSACodexSection,
  FSAGitHubCopilotCLISection,
  CursorCodingAgentSection,
  SkillsCLICodingAgentSection
} from '@/components/templates'

Install the authstack plugin, then tell your coding agent to add SaaSKit auth to your app.

  **Claude Code**

  1. ## Install the authstack plugin

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

     For repeated use, install globally:

     ```bash title="Terminal"
     npm install -g @scalekit-inc/cli
     scalekit setup
     ```

     Select Claude Code when prompted. The CLI installs the authstack plugin for you. Then ask the agent to run the shipped skill `implement-saaskit`.

     Done: the command exits 0 and `implement-saaskit` is available.

     **Tool-native alternative (if not using the CLI)**

     ```bash
     claude plugin marketplace add scalekit-inc/authstack
     claude plugin install agentkit@authstack
     claude plugin install saaskit@authstack
     ```

        Or run `/plugins` inside Claude to enable via the wizard.

  2. ## Generate authentication implementation

     Copy the following prompt into your coding agent:

     ```md title="Authentication implementation prompt"
     Add SaaSKit auth to my app. I need login, sessions, and logout.
     ```

     > caution: Review generated code
     >
     > Always review AI-generated authentication code before deployment. Verify that environment variables, token validation logic, and error handling match your security requirements. The coding agent provides a foundation, but you must ensure it aligns with your application's specific needs.

  3. ## Verify the implementation

     After the coding agent completes, verify that all authentication components are properly configured:

     Check generated files:
     - Scalekit client initialization with environment credentials (you may need to set up a `.env` file with your Scalekit API credentials)
     - Login route that redirects to Scalekit's authorization endpoint
     - OAuth callback route that exchanges the code for tokens
     - Secure session storage with proper cookie attributes
     - Logout endpoint that clears the session

     The login flow should redirect users to Scalekit's authorization page, where they authenticate. Your application should then exchange the returned authorization code for tokens, store the session, and redirect the user to the protected area of your app.

  **Codex**

  1. ## Install the authstack plugin (recommended)

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

     For repeated use, install globally:

     ```bash title="Terminal"
     npm install -g @scalekit-inc/cli
     scalekit setup
     ```

     Choose Codex when prompted. The CLI installs the authstack plugin. Then load the shipped skill `implement-saaskit`.

     Done: the command exits 0 and `implement-saaskit` is available.

  2. ## Enable the SaaSKit plugin

     Restart Codex and enable the authstack plugin in the Plugin Directory.

  3. ## Generate the authentication implementation

     Copy the following prompt into Codex:

     ```md title="Authentication implementation prompt"
     Add SaaSKit auth to my app. I need login, sessions, and logout.
     ```

     Codex loads the SaaSKit plugin from the authstack plugin, analyzes your existing application structure, generates Scalekit client initialization with environment credentials, creates the login redirect handler, implements the OAuth callback to exchange the authorization code for tokens, and adds secure session storage with a logout endpoint.

     > caution: Review generated code
     >
     > Always review AI-generated authentication code before deployment. Verify that environment variables, token validation logic, and error handling match your security requirements. The coding agent provides a foundation, but you must ensure it aligns with your application's specific needs.

  4. ## Verify the implementation

     After Codex completes, verify that all authentication components are properly configured:

     Check generated files:
     - Scalekit client initialization with environment credentials. You may need to set up a `.env` file with your Scalekit API credentials.
     - Login route that redirects to Scalekit's authorization endpoint
     - OAuth callback route that exchanges the code for tokens
     - Secure session storage with proper cookie attributes
     - Logout endpoint that clears session state

     The login flow should redirect users to Scalekit's authorization page, where they authenticate. Your application should then exchange the returned authorization code for tokens, store the session, and redirect the user to the protected area of your app.

  When you connect, users authenticate through the OAuth 2.0 flow you configured. Verify that protected routes require a valid session and that the logout endpoint properly clears session state.

  **GitHub Copilot CLI**

  1. ## Install the authstack plugin (recommended)

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

     For repeated use, install globally:

     ```bash title="Terminal"
     npm install -g @scalekit-inc/cli
     scalekit setup
     ```

     The CLI installs the authstack plugin for GitHub Copilot. Then ask the agent to run the shipped skill `implement-saaskit`.

     Done: the command exits 0 and `implement-saaskit` is available.

     **Tool-native alternative**

     ```bash
     copilot plugin marketplace add scalekit-inc/authstack
     copilot plugin install agentkit@authstack
     copilot plugin install saaskit@authstack
     ```

        Use `copilot plugin list` to verify.

  2. ## Generate authentication implementation

     Copy the following command into your terminal:

     ```bash title="Terminal"
     copilot "Add SaaSKit auth to my app. I need login, sessions, and logout."
     ```

     GitHub Copilot uses the SaaSKit plugin to analyze your existing application structure, generate Scalekit client initialization code, create the login redirect handler, implement the OAuth callback for token exchange, add secure session storage, and provide a logout endpoint.

     > caution: Review generated code
     >
     > Always review AI-generated authentication code before deployment. Verify that environment variables, token validation logic, and error handling match your security requirements. The coding agent provides a foundation, but you must ensure it aligns with your application's specific needs.

  3. ## Verify the implementation

     After GitHub Copilot completes, verify that all authentication components are properly configured:

     Check generated files:
     - Scalekit client initialization with environment credentials (you may need to set up a `.env` file with your Scalekit API credentials)
     - Login route that redirects to Scalekit's authorization endpoint
     - OAuth callback route that exchanges the code for tokens
     - Secure session storage with proper cookie attributes
     - Logout endpoint that clears the session

     The login flow should redirect users to Scalekit's authorization page, where they authenticate. Your application should then exchange the returned authorization code for tokens, store the session, and redirect the user to the protected area of your app.

  When you connect, users authenticate through the OAuth 2.0 flow you configured. Verify that protected routes require a valid session and that the logout endpoint properly clears session state.

  **Cursor**

  1. ## Install the authstack plugin (recommended)

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

     For repeated use, install globally:

     ```bash title="Terminal"
     npm install -g @scalekit-inc/cli
     scalekit setup
     ```

     The CLI detects Cursor and installs the authstack plugin directly.

  2. ## Reload and select plugins

     Restart Cursor (or run **Developer: Reload Window**), then open **Settings > Cursor Settings > Plugins**.

     Enable the Scalekit plugins you need. The shipped skills are `integrate-agentkit`, `implement-saaskit`, `add-mcp-oauth`, `implement-sso`, and `implement-scim`.

     Done: the plugin list shows the skill you need.

     > note: Alternative for other agents
     >
     > For agents that read the shared skills directory, such as Cline, Amp and OpenCode, install the Scalekit skills to `~/.agents/skills`:
     >
     > ```bash
     > npx @scalekit-inc/cli skills install -y
     > ```
     >
     > To pick individual skills, run `npx skills add scalekit-inc/authstack`.

  3. ## Generate the implementation

     Open Cursor's chat panel with **Cmd+L** (macOS) or **Ctrl+L** (Windows/Linux) and paste in an implementation prompt from the feature page (or describe what you need in natural language). The installed Scalekit plugins provide the agent with accurate patterns.

     > caution: Review generated code
     >
     > Always review AI-generated authentication code before deployment. Verify that environment variables, token validation logic, and error handling match your application's security requirements.

  4. ## Verify the implementation

     After Cursor finishes generating code, confirm all authentication components are in place:

     - The Scalekit plugin appears in **Settings > Cursor Settings > Plugins**
     - Scalekit client initialized with your API credentials (set up a `.env` file with your Scalekit environment variables)
     - Authorization URL generation and callback handler
     - Session or token integration matching your application's existing patterns

  **Other agents**

  Scalekit skills work with any coding agent that supports the Agent Skills standard, such as Cline, Amp and OpenCode. Install them with the Scalekit CLI (Node.js 20 or later):

  ```bash title="Terminal"
  npx @scalekit-inc/cli skills install -y
  ```

  The command installs the Scalekit skills to `~/.agents/skills`, the shared skills directory these agents read. The `-y` flag skips the confirmation prompt, so the command also works when a coding agent runs it.

  You can also install the skills with the Skills CLI. Use it when the Scalekit CLI skips the install because installed Scalekit plugins already include the skills:

  1. ## Install interactively

     Run the command with no flags to be guided through the available skills:

     ```bash title="Terminal"
     npx skills add scalekit-inc/authstack
     ```

  2. ## Browse and install a specific skill

     Install the skill for your auth type (for example, MCP OAuth):

     ```bash title="Terminal"
     # List all available skills
     npx skills add scalekit-inc/authstack --list

     # Install a specific skill
     npx skills add scalekit-inc/authstack --skill add-mcp-oauth
     ```

  3. ## Invoke the skill 

     Each coding agent has its own behavior for invoking skills. In OpenCode, skills are invoked **automatically by the agent based on natural language** — no slash commands required. The agent has a list of available skills and their `description` fields in context. It reads your intent, matches it against those descriptions, and autonomously calls the skill tool to load the relevant `SKILL.md`. A clear, specific `description` in skill frontmatter is what the agent uses to decide which skill to invoke.

     **Flow in practice:**

     - You write a natural language message to the agent
     - The agent checks its context — it already sees `<available_skills>` with names and descriptions
     - If your request matches a skill's purpose, the agent calls `skill("<name>")` internally
     - The full `SKILL.md` content loads into context and the agent follows those instructions

     If your agent does not automatically pick up skills, you can run a command to load a skill and manually select Scalekit's skills to load into context. Refer to your favorite coding agent's documentation for how to invoke skills once they are installed.

  4. ## Install all skills globally

     To add all Scalekit authentication skills to your agents:

     ```bash title="Terminal"
     npx skills add scalekit-inc/authstack --all --global
     ```

     This installs all AgentKit and SaaSKit skills.


---

## 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 |
