Skip to content

Commit 9450585

Browse files
authored
Issue8683 (#563)
* inject management key as token * CR fixes * fix & test * merge with main * readme
1 parent 0db5fdf commit 9450585

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,54 @@ If you wish to run any of our code samples and play with them, check out our [Co
8181

8282
If you're performing end-to-end testing, check out the [Utils for your end to end (e2e) tests and integration tests](#utils-for-your-end-to-end-e2e-tests-and-integration-tests) section. You will need to use the `descopeClient` you created under the setup of [Management Functions](#management-functions).
8383

84+
## Authentication Management Key
85+
86+
The `authManagementKey` is an alternative to the `managementKey` that provides a way to perform management operations while maintaining separation between authentication and management clients.
87+
88+
### Key Differences
89+
90+
- **Purpose**: Use `authManagementKey` for authentication-related management operations, while `managementKey` is for general management operations
91+
- **Client Separation**: You can have one client for management operations and another for authentication operations
92+
- **Mutual Exclusivity**: You cannot pass both `authManagementKey` and `managementKey` together - choose one based on your use case
93+
94+
### Usage Examples
95+
96+
**Using authManagementKey for authentication operations:**
97+
98+
```typescript
99+
import DescopeClient from '@descope/node-sdk';
100+
101+
const authClient = DescopeClient({
102+
projectId: 'my-project-ID',
103+
authManagementKey: 'auth-management-key',
104+
});
105+
106+
// This client can be used for authentication-related management operations
107+
```
108+
109+
**Separate clients for different operations:**
110+
111+
```typescript
112+
import DescopeClient from '@descope/node-sdk';
113+
114+
// Client for general management operations
115+
const managementClient = DescopeClient({
116+
projectId: 'my-project-ID',
117+
managementKey: 'management-key',
118+
});
119+
120+
// Client for authentication operations
121+
const authClient = DescopeClient({
122+
projectId: 'my-project-ID',
123+
authManagementKey: 'auth-management-key',
124+
});
125+
126+
// Use managementClient for user management, tenant management, etc.
127+
// Use authClient for authentication-related operations
128+
```
129+
130+
**Note**: Create your authentication management key in the [Descope Console](https://app.descope.com/settings/company/managementkeys), similar to how you create a regular management key.
131+
84132
---
85133

86134
## Error Handling

0 commit comments

Comments
 (0)