Skip to content

Latest commit

 

History

History
89 lines (57 loc) · 4.43 KB

File metadata and controls

89 lines (57 loc) · 4.43 KB

import { Steps, Aside } from '@astrojs/starlight/components'

1. ## Add the Scalekit Auth Stack marketplace

Not yet on Claude Code? Follow the official quickstart guide to install it.

Register Scalekit's plugin marketplace to access pre-configured authentication skills. This marketplace provides context-aware prompts and implementation guides that help coding agents generate correct AgentKit code.

Start the Claude Code REPL:

claude

Then add the marketplace:

/plugin marketplace add scalekit-inc/claude-code-authstack

When the marketplace registers successfully, you'll see confirmation output:

❯ /plugin marketplace add scalekit-inc/claude-code-authstack
   ⎿  Successfully added marketplace: scalekit-auth-stack

The marketplace provides specialized authentication plugins that understand AgentKit patterns and OAuth 2.0 security requirements. These plugins guide the coding agent to generate implementation code that matches your project structure.

  1. Enable authentication plugins

    Select which authentication capabilities to activate in your development environment. Each plugin provides specific skills that the coding agent uses to generate authentication code.

    Directly install the specific plugin:

    /plugin install agentkit@scalekit-auth-stack
    Alternative: Enable authentication plugins via plugin wizard

    Run the plugin wizard to browse and enable available plugins:

    /plugins

    Navigate through the visual interface to enable the AgentKit plugin.

    Enable auto-updates for authentication plugins to receive security patches and improvements. Scalekit regularly updates plugins based on community feedback and security best practices.
  2. Generate authentication implementation

    Use a structured prompt to direct the coding agent. A well-formed prompt ensures the agent generates complete, production-ready AgentKit code that includes all required security components.

    Copy the following prompt into your coding agent:

    Guide me through configuring the installed Scalekit marketplace plugin to handle agent authentication for Gmail. Provide the code to trigger the auth flow, retrieve the secure user token, and then use that authenticated session to fetch and list the last 5 unread emails. Add logging to verify the flow.

    When you submit this prompt, Claude Code loads the AgentKit skills from the marketplace -> analyzes your existing application structure -> generates Scalekit client initialization -> creates connected account management functions -> implements OAuth authorization link generation -> adds token fetching and refresh logic.

    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 just-in-time implementation

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

    Check generated files:

    • Scalekit client initialization with credentials. You may need to set up a .env file with your Scalekit API credentials.
    • Connected account management functions
    • Authorization link generation
    • Token fetching and storage
    • Error handling for expired tokens

    The authorization flow should redirect users to the service's consent page, where they grant permissions. Your application should then be able to fetch OAuth tokens and execute actions on behalf of the authenticated user.

When you connect, the agent authenticates users through the OAuth 2.0 flow you configured. Verify that protected resources require valid access tokens and that the agent can successfully execute actions on behalf of authenticated users.