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
Response times of repeated FGA `check` calls, especially in high volume scenarios, can be reduced to sub-millisecond scales by re-directing the calls to a Descope FGA Cache Proxy running in the same backend cluster as your application.
1392
+
1393
+
After setting up the proxy server via the Descope provided Docker image, set the `fgaCacheUrl` parameter to be equal to the proxy URL to enable its use in the SDK, as shown in the example below:
1394
+
1395
+
> **Note:** Both `fgaCacheUrl` and `managementKey` must be provided for the cache proxy to be used. If only `fgaCacheUrl` is configured without `managementKey`, requests will use the standard Descope API.
1396
+
1397
+
```typescript
1398
+
importDescopeClientfrom'@descope/node-sdk';
1399
+
1400
+
// Initialize client with FGA cache URL
1401
+
const descopeClient =DescopeClient({
1402
+
projectId: '<Project ID>',
1403
+
managementKey: '<Management Key>', // Required for cache proxy
1404
+
fgaCacheUrl: 'https://10.0.0.4', // example FGA Cache Proxy URL, running inside the same backend cluster
1405
+
});
1406
+
```
1407
+
1408
+
When the `fgaCacheUrl` is configured, the following FGA methods will automatically use the cache proxy instead of the default Descope API:
1409
+
1410
+
-`saveSchema`
1411
+
-`createRelations`
1412
+
-`deleteRelations`
1413
+
-`check`
1414
+
1415
+
If the cache proxy is unreachable or returns an error, the SDK will automatically fall back to the standard Descope API.
1416
+
1417
+
Other FGA operations like `loadResourcesDetails` and `saveResourcesDetails` will continue to use the standard Descope API endpoints.
1418
+
1391
1419
### Manage Outbound Applications
1392
1420
1393
1421
You can create, update, delete or load outbound applications:
0 commit comments