You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,54 @@ If you wish to run any of our code samples and play with them, check out our [Co
81
81
82
82
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).
83
83
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
+
importDescopeClientfrom'@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
+
importDescopeClientfrom'@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.
0 commit comments