Skip to content

Commit 1db57f4

Browse files
chore: git merge origin main
2 parents ccea433 + c6e4e72 commit 1db57f4

File tree

408 files changed

+41444
-11438
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

408 files changed

+41444
-11438
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,4 @@ creds.json
270270

271271
# Nix services data
272272
/data
273+
.pre-commit-config.yaml

CHANGELOG.md

Lines changed: 289 additions & 0 deletions
Large diffs are not rendered by default.

Cargo.lock

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api-reference/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,4 @@ npx @mintlify/scraping@latest openapi-file v1/openapi_spec_v1.json -o v1
4444

4545
This will generate files in [api-reference](api-reference) folder. These routes should be added to the [mint.json](mint.json) file under navigation, under respective group.
4646

47-
48-
NOTE: For working with V2 API reference, replace every occurrence of `v1` with `v2` in above commands
47+
NOTE: For working with V2 API reference, replace every occurrence of `v1` with `v2` in above commands

api-reference/docs.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
{
2424
"group": "Essentials",
2525
"pages": [
26+
"essentials/authentication",
2627
"essentials/error_codes",
2728
"essentials/rate_limit",
2829
"essentials/go-live"
@@ -146,6 +147,12 @@
146147
"v1/business-profile/business-profile--list"
147148
]
148149
},
150+
{
151+
"group": "Platform Account",
152+
"pages": [
153+
"v1/platform/platform--create"
154+
]
155+
},
149156
{
150157
"group": "API Key",
151158
"pages": [
@@ -213,7 +220,10 @@
213220
"v1/routing/routing--retrieve-default-for-profile",
214221
"v1/routing/routing--update-default-for-profile",
215222
"v1/routing/routing--retrieve",
216-
"v1/routing/routing--activate-config"
223+
"v1/routing/routing--activate-config",
224+
"v1/routing/routing--evaluate",
225+
"v1/routing/routing--feedback",
226+
"v1/routing/routing--rule-evaluate"
217227
]
218228
},
219229
{
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: Authentication Types
3+
description: Overview of authentication types and authorization keys available in Hyperswitch.
4+
---
5+
6+
import Note from '@site/src/components/Note'
7+
import Table from '@site/src/components/Table'
8+
import Check from '@site/src/components/Check'
9+
10+
Hyperswitch supports multiple API key types, each designed for different authentication and authorization use cases.
11+
12+
<Note>
13+
For security, **never expose secret or admin keys in client-side or mobile code**. Use publishable keys for public contexts.
14+
</Note>
15+
16+
## 1. API Key (Secret Key)
17+
18+
- **Primary merchant authentication key for server-side API requests.**
19+
- Environment-specific prefix (`snd_`, `prod_`, etc.).
20+
- Used for server to server requests.
21+
- This key can be **generated and managed from the [Hyperswitch dashboard (sandbox)](https://app.hyperswitch.io/developers?tabIndex=1)**.
22+
23+
- **Never expose this key in public code.**
24+
25+
## 2. Admin API Key
26+
27+
- **Administrative key** with elevated privileges.
28+
- Used for system-level operations such as creating merchant and connector accounts.
29+
- Should only be used in secure, internal workflows.
30+
- Some API calls require an admin API key. **Do not confuse this with a regular API Key.**
31+
- The **admin API key is a configuration value that can be set at the time of deploying the Hyperswitch server**.
32+
- **Admin API keys for the hosted Hyperswitch environments (sandbox/production) are managed by Juspay and are not provided publicly.**
33+
34+
<Check>
35+
You do **not** generate this key from the dashboard.
36+
Instead, **set your Admin API Key in your deployment configuration**:
37+
38+
**For Docker Compose:**
39+
Update the value in your `docker_compose.toml` file:
40+
</Check>
41+
42+
```toml
43+
# docker_compose.toml
44+
admin_api_key = "your_admin_key_here"
45+
```
46+
<Check> **For Helm Chart deployments:** Set the admin API key in your `values.yaml` file. </Check>
47+
48+
```yaml
49+
# values.yaml
50+
adminApiKey: your_admin_key_here
51+
```
52+
<Note> Do **not** expose your admin API key publicly. Only trusted entities and trusted applications should have access to this value. </Note>
53+
54+
Check the Docker Compose example for extra clarity:
55+
[See example in the Hyperswitch repository](https://github.com/juspay/hyperswitch/blob/main/config/docker_compose.toml)
56+
57+
58+
## 3. Publishable Key
59+
60+
- **Client-side key** with limited permissions.
61+
- Safe for use in public client-side (web or mobile) code.
62+
- Prefix: `pk_{environment}_{uuid}`.
63+
- Generated during merchant account creation.
64+
65+
## 4. Ephemeral Key
66+
67+
- **Temporary key** for limited operations.
68+
- Used for single or short-lived access (e.g., accessing a specific customer object).
69+
- Validity is configurable (see `[eph_key] validity` in `development.toml`).
70+
71+
## 5. JWT Key
72+
73+
- **JWT Bearer Token** used for API authentication and session management.
74+
- Required for certain JWT-protected endpoints and user authentication flows.
75+
- Format: `Authorization: Bearer <jwt_token>`
76+
77+
### When to Use
78+
79+
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:
80+
81+
- You’re building a **custom front end** that replaces the Control Center, or
82+
- You’re a developer **testing APIs directly** (e.g., using Postman or running the server without the UI).
83+
84+
For most users interacting through the Control Center UI, JWTs are handled automatically and do not need to be generated or included manually.
85+
86+
> **Note:**
87+
> JWTs are **not provisioned via the Hyperswitch dashboard**.
88+
> They are typically **issued during an authentication flow**, such as during login or session creation.
89+
90+
```http
91+
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
92+
```
93+
<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>
94+
95+
## Reference Table
96+
97+
<Table>
98+
| Key Type | Example Prefix | Usage | Security |
99+
|------------------|----------------------|------------------------------|-------------------------|
100+
| Secret (API Key) | snd_c69***, prod_*** | Backend server API requests | Keep secret |
101+
| Admin API Key | (admin-specific) | Admin operations | Highly confidential |
102+
| Publishable Key | pk_snd_3b3*** | Client-side, public usage | Safe to expose |
103+
| Ephemeral Key | (short-lived) | Temporary, limited access | Short validity, limited |
104+
| JWT Key | (JWT Bearer) | Session/user authentication | Control center calls |
105+
</Table>
106+
107+
<Check>
108+
Get your [API Key](https://app.hyperswitch.io/developers?tabIndex=1) and [Publishable Key](https://app.hyperswitch.io/home) from the Hyperswitch dashboard.
109+
</Check>
110+
---

0 commit comments

Comments
 (0)