const { result, error } = await unkey.ratelimits.setOverride({ identifier: "user_123", limit: 10, duration: 60000, namespaceId: "rlns_1234", async: true})if (error) { // handle potential network or bad request error // a link to our docs will be in the `error.docs` field console.error(error.message); return;}console.log(result);
Namespaces group different limits together for better analytics. You might have a namespace for your public API and one for internal tRPC routes. Wildcards can also be used, more info can be found at https://www.unkey.com/docs/ratelimiting/overrides#wildcard-rules
const { result, error } = await unkey.ratelimits.setOverride({ identifier: "user_123", limit: 10, duration: 60000, namespaceId: "rlns_1234", async: true})if (error) { // handle potential network or bad request error // a link to our docs will be in the `error.docs` field console.error(error.message); return;}console.log(result);
const { result, error } = await unkey.ratelimits.setOverride({ identifier: "user_123", limit: 10, duration: 60000, namespaceId: "rlns_1234", async: true})if (error) { // handle potential network or bad request error // a link to our docs will be in the `error.docs` field console.error(error.message); return;}console.log(result);
Copy
Ask AI
{ "result": { "overrideId": "rlor_12345" }}
Assistant
Responses are generated using AI and may contain mistakes.