API Keys
Create and manage API keys for users and teams
API keys provide a secure way for your users to authenticate with your application’s backend. They enable programmatic access to your API services, allowing developers to associate requests with specific users or teams. Stack Auth provides prebuilt UI components for the users and teams to manage their own API keys.
Overview
API keys allow your users to access your backend services programmatically.
Stack Auth provides two types of API keys:
User API keys
User API keys are associated with individual users and allow them to authenticate with your API.
Client
Server
Team API keys
Team API keys are associated with teams and can be used to provide access to team resources over your API.
Client
Server
Setting Up API Keys in Stack Auth
To use API keys in your application, you need to enable them in your project settings. Navigate to the Stack Auth dashboard, select your project, and enable User API Keys and/or Team API Keys in the project settings.
Working with API Keys
Creating User API Keys
Client
Server
Creating Team API Keys
Client
Server
Listing API Keys
Client
Server
Revoking API Keys
API keys can be revoked when they are no longer needed or if they have been compromised.
Client
Server
Checking API Key Validity
You can check if an API key is still valid: