@workos-inc/node 10.12.0 → 10.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/lib/{factory-CQfrl-3d.cjs → factory-BkKapXtb.cjs} +749 -130
- package/lib/factory-BkKapXtb.cjs.map +1 -0
- package/lib/{factory-CCkRzS83.d.cts → factory-CW0E3JEC.d.mts} +1265 -153
- package/lib/{factory-AQv-AfDk.mjs → factory-Dqju-gCl.mjs} +744 -131
- package/lib/factory-Dqju-gCl.mjs.map +1 -0
- package/lib/{factory-CCkRzS83.d.mts → factory-zrNVaAD9.d.cts} +1266 -153
- package/lib/index.cjs +2 -1
- package/lib/index.d.cts +69 -69
- package/lib/index.d.mts +69 -69
- package/lib/index.mjs +2 -2
- package/lib/index.worker.cjs +2 -1
- package/lib/index.worker.d.cts +2 -2
- package/lib/index.worker.d.mts +2 -2
- package/lib/index.worker.mjs +2 -2
- package/lib/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/lib/webapi-C2FQ2NNL.mjs +2445 -0
- package/lib/webapi-C2FQ2NNL.mjs.map +1 -0
- package/lib/webapi-MD5xmNba.cjs +2503 -0
- package/lib/webapi-MD5xmNba.cjs.map +1 -0
- package/package.json +4 -4
- package/lib/factory-AQv-AfDk.mjs.map +0 -1
- package/lib/factory-CQfrl-3d.cjs.map +0 -1
- package/lib/webapi-BlhUk1KL.mjs +0 -2905
- package/lib/webapi-BlhUk1KL.mjs.map +0 -1
- package/lib/webapi-D3QZrB15.cjs +0 -2952
- package/lib/webapi-D3QZrB15.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -60,6 +60,28 @@ await workos.get('/organizations', { maxRetries: 0 });
|
|
|
60
60
|
|
|
61
61
|
Set `maxRetries: 0` to disable automatic retries entirely.
|
|
62
62
|
|
|
63
|
+
The request timeout (`timeout`, 60 seconds by default) covers each attempt from
|
|
64
|
+
the request being sent to the response body being fully read, so a server that
|
|
65
|
+
returns headers promptly but stalls the body still times out. A timeout while
|
|
66
|
+
reading a successful response body is reported as a 408 but is not
|
|
67
|
+
automatically retried, because the server has already applied the request.
|
|
68
|
+
|
|
69
|
+
### Access token issuer validation
|
|
70
|
+
|
|
71
|
+
Session helpers (`authenticateWithSessionCookie`, `loadSealedSession(...).authenticate()`)
|
|
72
|
+
verify the access token signature against the WorkOS JWKS. To also enforce the
|
|
73
|
+
token's `iss` claim, pass the expected issuer when creating the client:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
const workos = new WorkOS('sk_1234', {
|
|
77
|
+
clientId: 'client_...',
|
|
78
|
+
issuer: 'https://api.workos.com/user_management/client_...',
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`issuer` also accepts an array when tokens from more than one issuer should be
|
|
83
|
+
accepted. When `issuer` is not set, the `iss` claim is not validated.
|
|
84
|
+
|
|
63
85
|
## Public Client Mode (Browser/Mobile/CLI)
|
|
64
86
|
|
|
65
87
|
For apps that can't securely store secrets, initialize with just a client ID:
|