import { Steps, Aside } from '@astrojs/starlight/components'
1. ## Add the Scalekit authstack marketplaceNeed to install GitHub Copilot CLI? See the getting started guide — an active GitHub Copilot subscription is required.
Register Scalekit's plugin marketplace to access pre-configured authentication plugins. This marketplace provides implementation skills that help GitHub Copilot generate correct Agent Auth code.
copilot plugin marketplace add scalekit-inc/github-copilot-authstackThe marketplace provides specialized plugins that understand Agent Auth patterns and OAuth 2.0 security requirements. These plugins guide GitHub Copilot to generate implementation code that matches your project structure.
-
Install the Agent Auth plugin to give GitHub Copilot the skills needed to generate agent authentication code:
copilot plugin install agent-auth@scalekit-auth-stack
Verify the plugin is installed
Confirm the plugin installed successfully:
Update authentication plugins regularly to receive security patches and improvements:copilot plugin list
copilot plugin update agent-auth@scalekit-auth-stack
-
Use a structured prompt to direct GitHub Copilot. A well-formed prompt ensures the agent generates complete, production-ready Agent Auth code that includes all required security components.
Copy the following command into your terminal:
copilot "Configure Scalekit 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."GitHub Copilot uses the Agent Auth plugin to analyze your existing application structure, generate Scalekit client initialization code, create connected account management functions, implement OAuth authorization link generation, and add 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. -
After GitHub Copilot completes, verify that all authentication components are properly configured:
Check generated files:
- Scalekit client initialization with credentials (you may need to set up a
.envfile 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.
- Scalekit client initialization with credentials (you may need to set up a
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.