Documentation Index
Fetch the complete documentation index at: https://stackauth-e0affa27-chore-move-mcp-to-a-sep-app.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
ApiKey represents an authentication token that allows programmatic access to your application’s backend. API keys can be associated with individual users or teams.
On this page:
ApiKey- Types:
ApiKey
API keys provide a way for users to authenticate with your backend services without using their primary credentials. They can be created for individual users or for teams, allowing programmatic access to your application.
API keys can be obtained through:
user.createApiKey()user.listApiKeys()user.useApiKeys()(React hook)team.createApiKey()team.listApiKeys()team.useApiKeys()(React hook)
Table of Contents
Properties
Methods
Types
UserApiKey
A type alias for an API key owned by a user.
UserApiKeyFirstView
A type alias for a newly created user API key, which includes the full key value instead of just the last four characters.
TeamApiKey
A type alias for an API key owned by a team.
TeamApiKeyFirstView
A type alias for a newly created team API key, which includes the full key value instead of just the last four characters.
Creation Options
When creating an API key usinguser.createApiKey() or team.createApiKey(), you need to provide an options object.
A human-readable description of the API key’s purpose.
The date when the API key will expire. Use
null for keys that don’t expire.Whether the API key is public. Defaults to
false. Secret API Keys are
monitored by Stack Auth’s secret scanner, which can revoke them if detected in
public code repositories. Public API Keys are designed for client-side
code where exposure is not a concern.