api-reference/essentials/authentication.mdx
import Note from '@site/src/components/Note' import Table from '@site/src/components/Table' import Check from '@site/src/components/Check'
Hyperswitch supports multiple API key types, each designed for different authentication and authorization use cases.
<Note> For security, **never expose secret or admin keys in client-side or mobile code**. Use publishable keys for public contexts. </Note>Primary merchant authentication key for server-side API requests.
Environment-specific prefix (snd_, prod_, etc.).
Used for server to server requests.
This key can be generated and managed from the Hyperswitch dashboard (sandbox).
Never expose this key in public code.
For Docker Compose:
Update the value in your docker_compose.toml file:
</Check>
# docker_compose.toml
admin_api_key = "your_admin_key_here"
<Check> For Helm Chart deployments: Set the admin API key in your values.yaml file. </Check>
# values.yaml
adminApiKey: your_admin_key_here
<Note> Do not expose your admin API key publicly. Only trusted entities and trusted applications should have access to this value. </Note>
Check the Docker Compose example for extra clarity: See example in the Hyperswitch repository
pk_{environment}_{uuid}.[eph_key] validity in development.toml).Authorization: Bearer <jwt_token>JWT tokens are primarily used by the Hyperswitch Control Center front end to authenticate API requests. You generally do not need to manage or use JWTs unless:
For most users interacting through the Control Center UI, JWTs are handled automatically and do not need to be generated or included manually.
Note:
JWTs are not provisioned via the Hyperswitch dashboard.
They are typically issued during an authentication flow, such as during login or session creation.
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
<Note> Keep your JWT tokens secure. Do not expose them in client-side code unless specifically required for session management, and always use HTTPS when transmitting JWTs. </Note>