Conversation
|
📝 Walkthrough## Walkthrough
This update comprehensively revises and expands the SDK documentation across multiple API areas including keys, identities, permissions, roles, ratelimits, and migrations. It replaces minimal examples with detailed TypeScript usage snippets featuring error handling and structured responses, adds new documentation pages for managing permissions, roles, identities, and migrations, and updates the Go example for API key verification to use a new client library with structured request/response handling.
## Changes
| File(s) | Change Summary |
|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
| apps/docs/apis/introduction.mdx | Replaced Go example code for API key verification with new client library usage involving context, structured requests, and enhanced error handling. |
| apps/docs/docs.json | Expanded SDK documentation JSON structure with new groups/pages for keys permissions/roles, identities, migrations, permissions, and community libraries. |
| apps/docs/libraries/ts/sdk/apis/*.mdx (create.mdx, delete.mdx, get.mdx, list-keys.mdx) | Replaced minimal request/response examples with detailed TypeScript examples including error handling and clearer JSON response samples. |
| apps/docs/libraries/ts/sdk/keys/*.mdx (create.mdx, delete.mdx, get.mdx, update.mdx, verify.mdx, verifications.mdx, update-remaining.mdx) | Enhanced keys API docs with detailed usage examples, added new parameters (roles, permissions, recoverable, environment), deprecated ownerId, and expanded response schemas. |
| apps/docs/libraries/ts/sdk/keys/add-permission.mdx, remove-permission.mdx, set-permission.mdx | Added new documentation pages for managing permissions on keys with examples, request/response schema, and permission requirements. |
| apps/docs/libraries/ts/sdk/keys/add-roles.mdx, remove-roles.mdx, set-roles.mdx | Added new documentation pages for managing roles on keys with detailed examples, request/response schemas, and permission notes. |
| apps/docs/libraries/ts/sdk/identities/*.mdx (create-identity.mdx, delete-identity.mdx, get-identity.mdx, list-identity.mdx, update-identity.mdx) | Added new documentation pages for identities API with detailed usage examples, request parameters, response schemas, and error handling. |
| apps/docs/libraries/ts/sdk/permissions/*.mdx (create-permission.mdx, delete-permission.mdx, get-permission.mdx, create-role.mdx, delete-role.mdx, get-role.mdx) | Added new documentation pages for permissions and roles management APIs with usage examples, request/response details, and required permissions. |
| apps/docs/libraries/ts/sdk/ratelimits/limit.mdx | Replaced minimal usage example with detailed TypeScript example including error handling and JSON response example. |
| apps/docs/libraries/ts/sdk/ratelimits/overrides/*.mdx (delete-override.mdx, get-override.mdx, list-overrides.mdx, set-override.mdx) | Consolidated and enhanced examples with error handling, destructuring assignment, and JSON response formatting; removed redundant or incorrect examples. |
| apps/docs/libraries/ts/sdk/migrations/migrate-to-unkey.mdx | Added new migration guide documentation with detailed usage examples and parameter descriptions for migrating API keys into Unkey. |
| apps/docs/libraries/ts/sdk/overview.mdx | Removed warning about accidental npm release and simplified installation instructions to always install latest version without pinning. |
## Possibly related PRs
- [unkeyed/unkey#2923](https://github.com/unkeyed/unkey/pull/2923): Adds `requestId` field and tests to key verification API schema, related to verification API but focusing on schema and testing.
## Suggested labels
`Documentation`, `🕹️ oss.gg`, `:joystick: 150 points`
## Suggested reviewers
- perkinsjr
- chronark
- mcstepp
- MichaelUnkeyThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Thank you for following the naming conventions for pull request titles! 🙏 |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
Add roles and perms and migration tips
There was a problem hiding this comment.
Actionable comments posted: 27
🔭 Outside diff range comments (5)
apps/docs/libraries/ts/sdk/ratelimits/overrides/set-override.mdx (1)
69-76:⚠️ Potential issueInvalid JSON in the response example
The JSON example uses single quotes and unquoted keys, which is invalid JSON. Please correct it to:
- ```json - { - result: { - overrideId: 'rlor_12345' - } - } - ``` + ```json + { + "result": { + "overrideId": "rlor_12345" + } + } + ```apps/docs/libraries/ts/sdk/keys/verifications.mdx (1)
46-53: 🛠️ Refactor suggestionClarify conditional requirements for parameters.
BothkeyIdandownerIdare marked asrequired, but the warning indicates only one should be provided. Consider marking these as optional and updating the field descriptions to reflect the conditional requirement (e.g., “EitherkeyIdorownerIdmust be provided”).apps/docs/libraries/ts/sdk/apis/list-keys.mdx (1)
178-181:⚠️ Potential issueRemove stray JSX fragment.
The literal{" "}before the<ResponseField name="total">is a leftover artifact and should be removed to avoid rendering issues:-{" "}apps/docs/libraries/ts/sdk/keys/verify.mdx (1)
184-186:⚠️ Potential issueFix typo and duplicate word in environment description.
There's a typo (
crated) and a duplicated word. Update to:<ResponseField name="environment" type="string"> - The environment of the key, this is what what you set when you crated the key + The environment of the key, this is what you set when you _created_ the key. </ResponseField>apps/docs/libraries/ts/sdk/keys/get.mdx (1)
88-90:⚠️ Potential issueRemove duplicate
remainingfield
Theremainingproperty is documented twice. Retain a single definition to avoid confusion.Also applies to: 132-134
🧹 Nitpick comments (37)
apps/docs/libraries/ts/sdk/apis/create.mdx (1)
6-17: Ensure consistent formatting in the request exampleThere’s no space between
=andawaitin the destructuring assignment. For readability and consistency across the docs, please format it as:- const { result, error } =await unkey.apis.create({ name: "Unkey production" }); + const { result, error } = await unkey.apis.create({ name: "Unkey production" });apps/docs/libraries/ts/sdk/overview.mdx (1)
11-28: Standardize code block language specifiers in the installation sectionThe code fences currently use composite languages like
bash npm,bash pnpm, etc. To improve consistency and enable proper syntax highlighting, please specifybashas the language and leverage<CodeGroup>(or<Tabs>/<TabItem>) to label each package manager. For example:- ```bash npm - npm install @unkey/api - ``` + ```bash + npm install @unkey/api + ``` ...apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx (1)
6-22: Improve destructuring spacing in the request exampleThe destructuring assignment currently reads
const {result,error}without spaces, which is inconsistent with other examples. Please add spaces around the braces and comma:- const {result,error} = await unkey.ratelimits.deleteOverride({ + const { result, error } = await unkey.ratelimits.deleteOverride({apps/docs/libraries/ts/sdk/keys/update-remaining.mdx (2)
7-7: Fix spacing around theawaitkeyword.There’s no space between
=andawaitin the example. It should read= awaitfor consistency and readability.
19-19: Add missing semicolon for consistency.The call to
console.log(result)should end with a semicolon to match the style in the snippet above.apps/docs/libraries/ts/sdk/ratelimits/limit.mdx (4)
9-9: Consistent spacing in destructuring.Please add spaces inside the braces: change
{result, error}to{ result, error }.
14-14: Terminate the example call with a semicolon.Add a semicolon after
})to keep the TypeScript snippet consistent.
24-24: Fixifstatement formatting.Use a space after
ifand before{:// from if(!result.success){ // to if (!result.success) {
25-25: Add missing semicolon onconsole.log.Terminate the log statement in the blocked branch with a semicolon.
apps/docs/libraries/ts/sdk/ratelimits/overrides/list-overrides.mdx (1)
9-9: Normalize destructuring spaces.Change
{ result ,error }to{ result, error }to match the style in other examples.apps/docs/libraries/ts/sdk/permissions/create-permission.mdx (3)
9-20: Minor: Clarify error‐handling comments.
The example’s inline comments are clear, but consider adding a trailing period to the sentence in the first comment for consistency:-if (error) { - // handle potential network or bad request error +if (error) { + // Handle potential network or bad request error.
29-33: Nitpick: Use valid JSON in the example.
TheResponseExampleblock is labeled JSON but uses unquoted keys and single quotes. For correctness and consistency, quote all keys and values:-```json -{ - result: { - permissionId: 'perm_123' - } -} -``` +```json +{ + "result": { + "permissionId": "perm_123" + } +} +```
44-50: Nitpick: Use en dash for ranges.
Replace the hyphen in “3 - 256” with an en dash for typographical correctness:-Required string length: 3 - 256 +Required string length: 3–256apps/docs/libraries/ts/sdk/permissions/get-permission.mdx (1)
27-34: Nitpick: Standardize JSON formatting.
Quote all keys and values for valid JSON syntax:-```json -{ - result: { - "id": "perm_123", - "name": "domain.record.manager", - "description": "Can manage dns records" - } -} -``` +```json +{ + "result": { + "id": "perm_123", + "name": "domain.record.manager", + "description": "Can manage dns records" + } +} +```apps/docs/libraries/ts/sdk/permissions/get-role.mdx (1)
27-33: Nitpick: Valid JSON in response example.
Use double quotes for keys and values:-```json -{ - result: { - id: 'role_45TTRKT5Yh28M6Qj', - name: "domain.record.manager", - description: "Can manage dns records" - } -} -``` +```json +{ + "result": { + "id": "role_45TTRKT5Yh28M6Qj", + "name": "domain.record.manager", + "description": "Can manage dns records" + } +} +```apps/docs/libraries/ts/sdk/permissions/create-role.mdx (2)
30-34: Nitpick: Use valid JSON in response example.
Quote all keys and values:-```json -{ - result: { - roleId: 'role_45TTRKT5Yh28M6Qj' - } -} -``` +```json +{ + "result": { + "roleId": "role_45TTRKT5Yh28M6Qj" + } +} +```
44-50: Nitpick: Use en dash for ranges.
Replace “3 - 256” with “3–256”:-Required string length: 3 - 256 +Required string length: 3–256apps/docs/libraries/ts/sdk/keys/remove-roles.mdx (1)
31-32: Suggest valid JSON syntax in the response example.The block is labeled as JSON but uses unquoted keys. For clarity and consistency, wrap keys in double quotes:
```json -{ result: {} } +{ "result": {} }```</blockquote></details> <details> <summary>apps/docs/libraries/ts/sdk/keys/remove-permission.mdx (1)</summary><blockquote> `33-36`: **Suggest valid JSON syntax in the response example.** The JSON example omits quotes around keys. For true JSON compliance, use double quotes: ```diff <ResponseExample> ```json -{ - result: {} -} +{ + "result": {} +}apps/docs/libraries/ts/sdk/ratelimits/overrides/get-override.mdx (4)
8-11: Fix inconsistent TypeScript object formatting.Add a space after the colon for
identifierto match surrounding style:const { result, error } = await unkey.ratelimits.getOverride({ - identifier:"user.example", + identifier: "user.example", namespaceName: "email.outbound" });
25-33: Normalize JSON example formatting.The response block is labeled JSON but uses unquoted keys. Consider:
```<ResponseExample> ```json -{ - result: { +{ + "result": { "id": "rlor_4567", "identifier": "user.example", "limit": 10, "duration": 60000, "async": false } }
38-40: Improve ParamField description grammar.The identifier description is a run-on sentence and has case issues. Refine for clarity:
<ParamField body="identifier" type="string" required> -Identifier of your user, this can be their userId, an email, an ip or anything else. Wildcards ( * ) can be used to match multiple identifiers, More info can be found at https://www.unkey.com/docs/ratelimiting/overrides#wildcard-rules +Identifier of your user, such as a userId, an email address, or an IP address. Wildcards (*) can be used to match multiple identifiers. For more info, see https://www.unkey.com/docs/ratelimiting/overrides#wildcard-rules </ParamField>
80-80: Remove stray space in closing tag.The closing
</ResponseField >has an extra space before>. It should be:-</ResponseField > +</ResponseField>apps/docs/libraries/ts/sdk/keys/verify.mdx (1)
31-34: Ensure the response example uses valid JSON notation.Keys should be quoted in a JSON block:
```<ResponseExample> ```json -{ - result: { +{ + "result": { "keyId": "key_1234", "valid": true, // … } }apps/docs/libraries/ts/sdk/keys/set-roles.mdx (2)
34-40: Use double quotes in the JSON response example.The block uses single quotes, which isn’t valid JSON. Update as follows:
```<ResponseExample> ```json -{ - result: [ - { - id: 'role_45TTRKT5Yh28M6Qj', - name: 'domain.manager' - } - ] -} +{ + "result": [ + { + "id": "role_45TTRKT5Yh28M6Qj", + "name": "domain.manager" + } + ] +}
43-45: Wrap permission names in backticks in the note.For consistency, code references should be inline code:
<Note> - To use this function, your root key must have the rbac.*.add_role_to_key and potentially the rbac.*.create_role permissions. + To use this function, your root key must have the `rbac.*.add_role_to_key` and potentially the `rbac.*.create_role` permissions. </Note>apps/docs/libraries/ts/sdk/keys/update.mdx (2)
13-23: Update RequestExample to useexternalIdand include new parameters.
The example still uses the deprecatedownerId. Replace it withexternalIdand consider showing how to pass the newly addedrolesandpermissionsarrays for completeness.
37-41: Ensure valid JSON in theResponseExample.
In a JSON code block all keys must be double-quoted. For example:{ "result": {} }apps/docs/libraries/ts/sdk/identities/get-identity.mdx (3)
9-17: Consider showingidentityIdusage in the example.
The request example only illustratesexternalId. Since bothexternalIdandidentityIdare supported (withidentityIdtaking precedence), include a snippet or note on usingidentityId.
26-42: Ensure valid JSON in theResponseExample.
Use double quotes for all keys and string values. For example:{ "result": { "id": "id_123", "externalId": "user_123", "meta": {}, "ratelimits": [ { "name": "tokens", "limit": 10, "duration": 1000 } ] } }
47-53: Clarify mutual exclusivity of parameters.
BothexternalIdandidentityIdare markedrequired, but in practice you supply one or the other. Consider marking them optional and adding a note that at least one must be provided.apps/docs/libraries/ts/sdk/keys/add-roles.mdx (1)
31-39: Ensure valid JSON in theResponseExample.
In a JSON block, keys and string values must use double quotes. Suggested revision:{ "result": [ { "id": "role_45TTRKT5Yh28M6Qj", "name": "domain.manager" } ] }apps/docs/libraries/ts/sdk/keys/add-permission.mdx (1)
31-39: Ensure valid JSON in theResponseExample.
Use double quotes for all keys and string values. For example:{ "result": [ { "id": "perm_45TTRKT5Yh28M6Qj", "name": "email.test" } ] }apps/docs/libraries/ts/sdk/identities/update-identity.mdx (1)
84-112: Refine duplicated ratelimits description
The phrase explaining ratelimits is repeated in both the request and response sections. Consider a more concise, grammatically correct description, for example:Attach rate limits to this identity. When verifying keys, specify which limits to apply; all attached keys will share these limits.
Also applies to: 145-174
apps/docs/libraries/ts/sdk/migrations/migrate-to-unkey.mdx (1)
61-67: Fix grammar and typos inprefixdescription
- Change “add prefix them” to “add a prefix to them”
- Correct “automtically” to “automatically”
Apply this diff:
- To make it easier for your users to understand which product an api key belongs to, you can add prefix them. + To make it easier for your users to understand which product an API key belongs to, you can add a prefix to them. - The underscore is automtically added if you are defining a prefix, for example: `"prefix": "abc"` will result in a key like `abc_xxxxxxxxx` + The underscore is automatically added when defining a prefix. For example, `"prefix": "abc"` yields a key like `abc_xxxxxxxxx`.🧰 Tools
🪛 LanguageTool
[typographical] ~64-~64: After the expression ‘for example’ a comma is usually used.
Context: ...longs to, you can add prefix them. For example Stripe famously prefixes their customer...(COMMA_FOR_EXAMPLE)
apps/docs/libraries/ts/sdk/identities/create-identity.mdx (1)
71-99: Refine duplicated ratelimits description
The ratelimits description repeats phrasing found in other identity docs. Consider a concise rewording:Attach rate limits to this identity. When verifying keys, specify which limits to apply; all attached keys will share these limits.
apps/docs/libraries/ts/sdk/keys/create.mdx (1)
209-219: Nitpick: Hyphenate and simplify wording inenvironmentdescription
- Change “real world resources” → “real-world resources” (compound adjective).
- Remove redundant “back” in “return it back to you”.
- give the developer a way to develop their own application without the risk of modifying real world resources. + give the developer a way to develop their own application without the risk of modifying real-world resources. - When you set an environment, we will return it back to you when validating the key, so you can handle it correctly. + When you set an environment, we will return it to you when validating the key, so you can handle it correctly.🧰 Tools
🪛 LanguageTool
[uncategorized] ~213-~213: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...plication without the risk of modifying real world resources. When you set an environment...(EN_COMPOUND_ADJECTIVE_INTERNAL)
[style] ~216-~216: Using “back” with the verb “return” may be redundant.
Context: ...u set an environment, we will return it back to you when validating the key, so you ...(RETURN_BACK)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (37)
apps/docs/apis/introduction.mdx(1 hunks)apps/docs/docs.json(4 hunks)apps/docs/libraries/ts/sdk/apis/create.mdx(1 hunks)apps/docs/libraries/ts/sdk/apis/delete.mdx(2 hunks)apps/docs/libraries/ts/sdk/apis/get.mdx(1 hunks)apps/docs/libraries/ts/sdk/apis/list-keys.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/create-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/delete-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/get-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/list-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/update-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/add-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/add-roles.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/create.mdx(4 hunks)apps/docs/libraries/ts/sdk/keys/delete.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/get.mdx(2 hunks)apps/docs/libraries/ts/sdk/keys/remove-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/remove-roles.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/set-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/set-roles.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/update-remaining.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/update.mdx(3 hunks)apps/docs/libraries/ts/sdk/keys/verifications.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/verify.mdx(4 hunks)apps/docs/libraries/ts/sdk/migrations/migrate-to-unkey.mdx(1 hunks)apps/docs/libraries/ts/sdk/overview.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/create-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/create-role.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/delete-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/delete-role.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/get-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/get-role.mdx(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/limit.mdx(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx(2 hunks)apps/docs/libraries/ts/sdk/ratelimits/overrides/get-override.mdx(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/overrides/list-overrides.mdx(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/overrides/set-override.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx
[typographical] ~55-~55: If you want to indicate numerical ranges or time ranges, consider using an en dash.
Context: ...t see this. Required string length: 3 - 256 Example:`"record.write can create...
(DASH_RULE)
apps/docs/libraries/ts/sdk/permissions/create-role.mdx
[typographical] ~55-~55: If you want to indicate numerical ranges or time ranges, consider using an en dash.
Context: ...t see this. Required string length: 3 - 256 Example:`"dns.records.manager can...
(DASH_RULE)
apps/docs/libraries/ts/sdk/identities/update-identity.mdx
[style] ~148-~148: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... keys, you can specify which limits you want to use and all keys attached to this ident...
(REP_WANT_TO_VB)
apps/docs/libraries/ts/sdk/migrations/migrate-to-unkey.mdx
[typographical] ~64-~64: After the expression ‘for example’ a comma is usually used.
Context: ...longs to, you can add prefix them. For example Stripe famously prefixes their customer...
(COMMA_FOR_EXAMPLE)
[uncategorized] ~142-~142: Possible missing comma found.
Context: ...x timestamp in milliseconds. Once keys expire they will automatically be deleted and ...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~225-~225: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...plication without the risk of modifying real world resources. When you set an environment...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[style] ~228-~228: Using “back” with the verb “return” may be redundant.
Context: ...u set an environment, we will return it back to you when validating the key, so you ...
(RETURN_BACK)
apps/docs/libraries/ts/sdk/identities/list-identity.mdx
[style] ~90-~90: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... keys, you can specify which limits you want to use and all keys attached to this ident...
(REP_WANT_TO_VB)
apps/docs/libraries/ts/sdk/keys/create.mdx
[uncategorized] ~213-~213: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...plication without the risk of modifying real world resources. When you set an environment...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[style] ~216-~216: Using “back” with the verb “return” may be redundant.
Context: ...u set an environment, we will return it back to you when validating the key, so you ...
(RETURN_BACK)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Test Packages / Test ./internal/clickhouse
🔇 Additional comments (66)
apps/docs/libraries/ts/sdk/keys/delete.mdx (1)
6-19: Approve detailed error handling in the request exampleThe new TypeScript snippet correctly destructures
resultanderror, adds explicit error checks, and returns early on failure, which improves clarity and safety.apps/docs/libraries/ts/sdk/ratelimits/overrides/set-override.mdx (1)
47-66: Approve new error handling and destructuring in the request exampleThe updated snippet correctly destructures
resultanderror, checks for errors, and returns early, ensuring a clear and consistent usage pattern.apps/docs/libraries/ts/sdk/permissions/delete-role.mdx (5)
6-22: Approve RequestExample snippet.
The TypeScript example correctly demonstrates usage with error handling, destructured response, and consistent semicolons.
24-30: Approve ResponseExample snippet.
The JSON response example shows the expectedresultstructure clearly and consistently with other SDK docs.
32-35: Approve the permission note.
The<Note>clearly explains the required RBAC permission.
39-43: Approve Request parameters section.
TheroleIdparameter is correctly documented as required with a clear description and example.
45-49: Approve Response parameters section.
The<ResponseField>accurately reflects the empty object returned on success.apps/docs/libraries/ts/sdk/apis/delete.mdx (4)
6-19: Approve RequestExample snippet.
TypeScript example correctly uses destructuring, error handling, and consistent semicolons.
21-28: Approve ResponseExample snippet.
The JSON response showing an emptyresultobject is clear and consistent.
33-35: Approve Request parameter documentation.
TheapiIdparameter is documented with a clear description and marked as required.
39-42: Approve Response parameter documentation.
The<ResponseField>correctly describes the emptyresultobject.apps/docs/libraries/ts/sdk/permissions/delete-permission.mdx (5)
6-20: Approve RequestExample snippet.
The TypeScript example is clear, with destructuring, error handling, and logging.
24-30: Approve ResponseExample snippet.
The JSON response example accurately reflects the emptyresultobject returned.
33-35: Approve the permission note.
The<Note>succinctly states the required RBAC permission.
39-43: Approve Request parameters section.
ThepermissionIdfield is correctly documented as required with a clear example.
46-48: Approve Response parameters section.
The<ResponseField>description for the emptyresultis accurate.apps/docs/libraries/ts/sdk/permissions/create-permission.mdx (2)
38-40: Approve: Note on required permissions.
Clear and accurate. No changes needed.
62-66: Approve: Response field documentation.
The description and example forpermissionIdare clear and consistent.apps/docs/libraries/ts/sdk/permissions/get-permission.mdx (4)
2-4: Approve: Frontmatter metadata.
Title and description correctly describe the page.
37-39: Approve: Note on required permissions.
Clear and accurate.
43-49: Approve: Request parameter documentation.
ThepermissionIdfield is well described with minimum length.
53-70: Approve: Response field documentation.
Fieldsid,name, anddescriptionare clearly specified.apps/docs/apis/introduction.mdx (4)
11-18: Approve: TypeScript usage example.
TheverifyKeyexample is up to date and demonstrates error handling concisely.
28-32: Approve: Python usage example.
Consistent with other language examples and correct.
48-73: Approve: Go client example.
The new structured client and context usage align with the rest of the SDK examples.
75-82: Approve: cURL example.
Clear and correct.apps/docs/libraries/ts/sdk/permissions/get-role.mdx (5)
2-4: Approve: Frontmatter metadata.
Title and description are accurate.
9-20: Approve: TypeScript request example.
Correct usage and error handling.
36-38: Approve: Note on required permissions.
Clear and accurate.
42-49: Approve: Request parameter documentation.
Well documented with minimum length and example.
52-70: Approve: Response field documentation.
Fields and examples are clear.apps/docs/libraries/ts/sdk/permissions/create-role.mdx (4)
2-4: Approve: Frontmatter metadata.
Title and description are accurate.
9-23: Approve: TypeScript usage example.
Correct pattern for creating roles and error handling.
38-40: Approve: Note on required permissions.
Clear and accurate.
62-66: Approve: Response field documentation.
Clear and concise.apps/docs/libraries/ts/sdk/keys/update.mdx (2)
139-147: Roles parameter addition looks good.
The new<ParamField body="roles" …>block is clear and well-documented.
148-156: Permissions parameter addition looks good.
The<ParamField body="permissions" …>block is accurate and consistent with the rest of the SDK.apps/docs/libraries/ts/sdk/keys/add-roles.mdx (3)
9-15: Request example formatting looks good.
The TypeScript snippet correctly demonstratesunkey.keys.addRoles.
49-67: ParamField definitions are clear.
The expandable properties forid,name, andcreateare well-documented.
74-83: Response schema documentation is accurate.
The<ResponseField>definitions match the expected return structure.apps/docs/libraries/ts/sdk/keys/add-permission.mdx (3)
9-15: Request example looks correct.
The snippet forunkey.keys.addPermissionsis clear and consistent with other pages.
49-67: ParamField definitions are clear.
The structure forpermissionsobjects and thecreateflag is well explained.
72-83: Response schema documentation is accurate.
The properties under the<ResponseField>block align with the example.apps/docs/libraries/ts/sdk/keys/set-permission.mdx (3)
8-15: Request example looks correct.
The TypeScript snippet forunkey.keys.setPermissionsfollows the established pattern.
48-67: ParamField definitions are clear.
The expandable block forid,name, andcreateis well structured.
74-83: Response schema documentation is accurate aside from the example.
The<ResponseField>definitions correctly describe the returned array.apps/docs/libraries/ts/sdk/identities/update-identity.mdx (2)
1-4: Frontmatter OK
Title and description are clear and correctly formatted.
6-30: Request example is clear and consistent
The TypeScript usage, error handling, and logging follow established patterns.apps/docs/libraries/ts/sdk/identities/list-identity.mdx (2)
1-4: Frontmatter OK
Title and description are clear and correctly formatted.
6-20: Request example is clear and consistent
The TypeScript usage, error handling, and logging follow established patterns.apps/docs/libraries/ts/sdk/keys/get.mdx (1)
6-18: Request example is clear and consistent
The TypeScript usage, error handling, and logging follow established patterns.apps/docs/libraries/ts/sdk/migrations/migrate-to-unkey.mdx (3)
1-4: Frontmatter OK
Title and description are clear and correctly formatted.
6-38: Request example is clear and consistent
The TypeScript usage, error handling, and logging follow established patterns.
42-50: ResponseExample is valid JSON
The JSON example uses correct quoting and structure.apps/docs/libraries/ts/sdk/identities/create-identity.mdx (2)
1-4: Frontmatter OK
Title and description are clear and correctly formatted.
6-28: Request example is clear and consistent
The TypeScript usage, error handling, and logging follow established patterns.apps/docs/libraries/ts/sdk/keys/create.mdx (7)
1-4: Inconsistent AI summary for this file
The AI-generated summary refers to thesetOverridemethod, but this document covers thekeys.createendpoint. Please update or ignore the summary to match the actual content.Likely an incorrect or invalid review comment.
6-45: Approve: Comprehensive request example
The<RequestExample>snippet clearly demonstrates all parameters—including error handling and logging—and follows TypeScript conventions.
85-88: Approve: Deprecation ofownerIdand addition ofexternalId
MarkingownerIdas deprecated and introducingexternalIdaligns with recent API changes.
108-108: Approve: ClosingmetaParamField tag
The closing tag for themetaparameter is correctly placed.
109-117: Approve:rolesparameter documentation
Excellent addition of therolesfield with a clear example and error behavior.
118-126: Approve:permissionsparameter documentation
Well-documented permissions field, including example usage and error semantics.
201-208: Approve:recoverableparameter documentation
This clearly explains the purpose and security implications of recoverable keys.apps/docs/docs.json (3)
348-360: Approve: Ratelimits SDK navigation structure
Theratelimitsgroup and its nestedoverridespages correctly mirror the API reference hierarchy.
361-366: Approve: Migrations SDK navigation entry
Themigrations/migrate-to-unkeypage is properly added for the SDK section.
428-429: No action needed on closing brackets for the Python SDK group.
|
rabbit has a point with the quotation marks |
|
I'm going to change it, the ones that are highlighted are ones I just moved around versus updating. I'd rather have "good docs" than "meh docs for a while" |
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
apps/docs/libraries/ts/sdk/keys/create.mdx (1)
49-57: Invalid JSON in response example
As previously noted, the JSON is missing a comma after"key", which makes it invalid. Please add the comma.
🧹 Nitpick comments (6)
apps/docs/libraries/ts/sdk/keys/create.mdx (6)
9-10: Clarify async context forawaitusage
This snippet usesawaitat the top level. Consider wrapping it in an async function (e.g., an IIFE) or noting that top-level await requires an ES module environment to avoid confusion.
85-92: ConfirmexternalIdrequirement and deprecateownerIdcleanly
You’ve markedownerIdas deprecated and introducedexternalId, but theexternalIdParamField isn't flagged as required. If the API now mandates this field, addrequired; otherwise, clarify that it's optional.
109-117: Unify roles examples
The TS snippet shows["domain.manager"]but the ParamField example lists["admin", "finance"]. Consider aligning these examples (or showing both) to prevent confusion.
118-126: Unify permissions examples
The TS snippet uses["email.test"]while the ParamField shows["domains.create_record", "say_hello"]. Align or expand these examples for consistency.
212-214: Hyphenate compound adjective
Use "real-world" (with a hyphen) instead of "real world" to correctly form the compound adjective.🧰 Tools
🪛 LanguageTool
[uncategorized] ~213-~213: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...plication without the risk of modifying real world resources. When you set an environment...(EN_COMPOUND_ADJECTIVE_INTERNAL)
216-216: Remove redundant wording
In "we will return it back to you", the word "back" is redundant. Change to "we will return it to you".🧰 Tools
🪛 LanguageTool
[style] ~216-~216: Using “back” with the verb “return” may be redundant.
Context: ...u set an environment, we will return it back to you when validating the key, so you ...(RETURN_BACK)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
apps/docs/libraries/ts/sdk/apis/create.mdx(1 hunks)apps/docs/libraries/ts/sdk/apis/get.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/create-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/create.mdx(4 hunks)apps/docs/libraries/ts/sdk/keys/delete.mdx(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/limit.mdx(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
- apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx
- apps/docs/libraries/ts/sdk/apis/create.mdx
- apps/docs/libraries/ts/sdk/ratelimits/limit.mdx
- apps/docs/libraries/ts/sdk/keys/delete.mdx
- apps/docs/libraries/ts/sdk/apis/get.mdx
- apps/docs/libraries/ts/sdk/identities/create-identity.mdx
🧰 Additional context used
🪛 LanguageTool
apps/docs/libraries/ts/sdk/keys/create.mdx
[uncategorized] ~213-~213: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...plication without the risk of modifying real world resources. When you set an environment...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[style] ~216-~216: Using “back” with the verb “return” may be redundant.
Context: ...u set an environment, we will return it back to you when validating the key, so you ...
(RETURN_BACK)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Test Packages / Test ./packages/rbac
- GitHub Check: Test Packages / Test ./packages/cache
- GitHub Check: Test Packages / Test ./internal/clickhouse
- GitHub Check: autofix
- GitHub Check: Analyze (javascript-typescript)
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (5)
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx (1)
2-4: Fix incorrect description in frontmatter.The
descriptioncurrently references “role” instead of “permission”. It should read:-description: "Create a new role to use with Unkey" +description: "Create a new permission to use with Unkey."apps/docs/libraries/ts/sdk/identities/list-identity.mdx (1)
70-74:⚠️ Potential issueIncorrect description of the
identitiesfield
Theidentitiesarray is mis-described as “Attach ratelimits to this identity.” It should explain that this field returns a list of identity objects, each containing itsid,externalId, and associatedratelimits.
Apply this diff:-<ResponseField name="identities" type="object[]" required > - Attach ratelimits to this identity. - - When verifying keys, you can specify which limits you want to use and all keys attached to this identity, will share the limits. +<ResponseField name="identities" type="object[]" required > + A list of identity objects, each containing its `id`, `externalId`, and associated `ratelimits`.apps/docs/libraries/ts/sdk/keys/update.mdx (1)
17-17:⚠️ Potential issueTypo in parameter name in the example request
The example usesrefilinstead ofrefill. This will cause runtime errors.
Apply this diff:- refil: { + refill: {apps/docs/libraries/ts/sdk/keys/get.mdx (2)
160-162:⚠️ Potential issueIncorrect description for the
identityfield
Theidentityblock currently repeats refill instructions. It should describe the associated identity object, e.g.:- Unkey allows you to refill remaining verifications on a key on a regular interval. + Information about the associated identity, including its `id`, `externalId`, and `meta`.
23-32:⚠️ Potential issueInvalid JSON quoting in ResponseExample
Single quotes are used around string values – JSON mandates double quotes.
Apply this diff:{ - "result": { - "id": 'key_123', - "start": '3ZHF3', - "apiId": 'api_123', - "workspaceId": 'ws_123', + "result": { + "id": "key_123", + "start": "3ZHF3", + "apiId": "api_123", + "workspaceId": "ws_123", "meta": {}, "createdAt": 1747222842094, "roles": [], "permissions": [], "enabled": true } }
🧹 Nitpick comments (14)
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx (3)
38-40: Add trailing period in Note.The note block should end with a period for consistency:
<Note> -To use this function, your root key must have the `rbac.*.create_permission` +To use this function, your root key must have the `rbac.*.create_permission`. </Note>
52-58: Refine typographic formatting and spacing.
- Use an en dash for numeric ranges:
3–256instead of3 - 256.- Add a space after the colon in the example for consistency.
- Required string length: 3 - 256 + Required string length: 3–256 - Example:`"record.write can create new dns records for our domains."` + Example: `"record.write can create new dns records for our domains."`🧰 Tools
🪛 LanguageTool
[typographical] ~55-~55: If you want to indicate numerical ranges or time ranges, consider using an en dash.
Context: ...t see this. Required string length: 3 - 256 Example:`"record.write can create...(DASH_RULE)
62-67: Add period to response description.Ensure the sentence ends with a period:
- The id of the permission. This is used internally + The id of the permission. This is used internally.apps/docs/libraries/ts/sdk/permissions/create-role.mdx (4)
1-4: Add period in frontmatter description.The
descriptionshould end with a period:-description: "Create a new role to use with Unkey" +description: "Create a new role to use with Unkey."
38-40: Add period in Note section.For consistency, the note should end with a period:
<Note> -To use this function, your root key must have the `rbac.*.create_role` +To use this function, your root key must have the `rbac.*.create_role`. </Note>
52-58: Refine numeric range and spacing.
- Use an en dash for the range:
3–256.- Add a space after the colon in the example.
- Required string length: 3 - 256 + Required string length: 3–256 - Example:`"dns.records.manager can read and write dns records for our domains."` + Example: `"dns.records.manager can read and write dns records for our domains."`🧰 Tools
🪛 LanguageTool
[typographical] ~55-~55: If you want to indicate numerical ranges or time ranges, consider using an en dash.
Context: ...t see this. Required string length: 3 - 256 Example:`"dns.records.manager can...(DASH_RULE)
62-67: Add period to response description.Ensure the sentence ends with a period:
- The id of the role. This is used internally + The id of the role. This is used internally.apps/docs/libraries/ts/sdk/ratelimits/overrides/set-override.mdx (2)
50-56: Clarify async context for example usage.The snippet relies on top-level
await, which may not be supported in all environments. Consider wrapping the code in anasyncfunction or an immediately-invoked async function expression (IIFE), or add a brief note indicating this runs in a module context to prevent confusion.
70-76: Fix JSON snippet indentation.The
"overrideId"line is indented by 5 spaces—adjust it to 4 spaces to match the 2-space per level convention. For example:{ "result": { "overrideId": "rlor_12345" } }apps/docs/libraries/ts/sdk/identities/list-identity.mdx (2)
87-90: Reduce duplication in theratelimitsdescription
The same explanatory text forratelimitsis repeated here and in other identity docs. Consider extracting it into a common snippet or at least varying the wording to avoid redundancy.🧰 Tools
🪛 LanguageTool
[style] ~90-~90: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... keys, you can specify which limits you want to use and all keys attached to this ident...(REP_WANT_TO_VB)
9-12: Include the optionalenvironmentparameter in the example
Sinceenvironmentis listed in the Request params, it would improve clarity to show it in the RequestExample (even if optional). E.g.:const { result, error } = await unkey.identities.list({ + environment: "your-environment-id", limit: 100 });apps/docs/libraries/ts/sdk/identities/update-identity.mdx (1)
84-88: Duplicate description inratelimitsfield
The explanatory text “Attach ratelimits to this identity…” is duplicated from other identity docs. Consider consolidating or rephrasing to improve readability and reduce repetition.apps/docs/libraries/ts/sdk/keys/update.mdx (2)
59-63: Spelling error inexternalIddescription
There’s an accented “ì” in “ìdentity”. It should read “identity” without the accent.
Apply this diff:- Under the hood this upserts and connects an ìdentity for you. + Under the hood this upserts and connects an identity for you.
139-146: Enhance code fence consistency for array examples
Therolesandpermissionsexamples aren’t wrapped in a specified code fence. For consistency with other MDX snippets, consider:-Example: -``` -["admin", "finance"] -``` +Example: +```ts +["admin", "finance"] +```Also applies to: 148-155
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (26)
apps/docs/libraries/ts/sdk/apis/delete.mdx(2 hunks)apps/docs/libraries/ts/sdk/apis/list-keys.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/delete-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/get-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/list-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/identities/update-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/add-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/add-roles.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/get.mdx(2 hunks)apps/docs/libraries/ts/sdk/keys/remove-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/remove-roles.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/set-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/set-roles.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/update-remaining.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/update.mdx(3 hunks)apps/docs/libraries/ts/sdk/keys/verifications.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/verify.mdx(4 hunks)apps/docs/libraries/ts/sdk/permissions/create-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/create-role.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/delete-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/delete-role.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/get-permission.mdx(1 hunks)apps/docs/libraries/ts/sdk/permissions/get-role.mdx(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/overrides/get-override.mdx(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/overrides/list-overrides.mdx(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/overrides/set-override.mdx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (19)
- apps/docs/libraries/ts/sdk/apis/list-keys.mdx
- apps/docs/libraries/ts/sdk/permissions/get-permission.mdx
- apps/docs/libraries/ts/sdk/keys/update-remaining.mdx
- apps/docs/libraries/ts/sdk/permissions/delete-permission.mdx
- apps/docs/libraries/ts/sdk/keys/set-roles.mdx
- apps/docs/libraries/ts/sdk/apis/delete.mdx
- apps/docs/libraries/ts/sdk/keys/verifications.mdx
- apps/docs/libraries/ts/sdk/ratelimits/overrides/list-overrides.mdx
- apps/docs/libraries/ts/sdk/permissions/delete-role.mdx
- apps/docs/libraries/ts/sdk/identities/delete-identity.mdx
- apps/docs/libraries/ts/sdk/permissions/get-role.mdx
- apps/docs/libraries/ts/sdk/keys/remove-roles.mdx
- apps/docs/libraries/ts/sdk/keys/verify.mdx
- apps/docs/libraries/ts/sdk/keys/remove-permission.mdx
- apps/docs/libraries/ts/sdk/keys/set-permission.mdx
- apps/docs/libraries/ts/sdk/keys/add-roles.mdx
- apps/docs/libraries/ts/sdk/ratelimits/overrides/get-override.mdx
- apps/docs/libraries/ts/sdk/keys/add-permission.mdx
- apps/docs/libraries/ts/sdk/identities/get-identity.mdx
🧰 Additional context used
🧠 Learnings (1)
apps/docs/libraries/ts/sdk/keys/update.mdx (1)
Learnt from: chronark
PR: unkeyed/unkey#2693
File: apps/api/src/routes/v1_keys_updateKey.ts:350-368
Timestamp: 2024-11-29T15:15:47.308Z
Learning: In `apps/api/src/routes/v1_keys_updateKey.ts`, the code intentionally handles `externalId` and `ownerId` separately for clarity. The `ownerId` field will be removed in the future, simplifying the code.
🪛 LanguageTool
apps/docs/libraries/ts/sdk/identities/list-identity.mdx
[style] ~90-~90: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... keys, you can specify which limits you want to use and all keys attached to this ident...
(REP_WANT_TO_VB)
apps/docs/libraries/ts/sdk/identities/update-identity.mdx
[style] ~148-~148: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ... keys, you can specify which limits you want to use and all keys attached to this ident...
(REP_WANT_TO_VB)
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx
[typographical] ~55-~55: If you want to indicate numerical ranges or time ranges, consider using an en dash.
Context: ...t see this. Required string length: 3 - 256 Example:`"record.write can create...
(DASH_RULE)
apps/docs/libraries/ts/sdk/permissions/create-role.mdx
[typographical] ~55-~55: If you want to indicate numerical ranges or time ranges, consider using an en dash.
Context: ...t see this. Required string length: 3 - 256 Example:`"dns.records.manager can...
(DASH_RULE)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Test Packages / Test ./packages/cache
- GitHub Check: Test Packages / Test ./internal/clickhouse
- GitHub Check: Test Packages / Test ./internal/billing
- GitHub Check: Test Packages / Test ./packages/hono
- GitHub Check: Test Packages / Test ./packages/api
- GitHub Check: autofix
🔇 Additional comments (8)
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx (3)
9-23: TS example snippet looks good.The code sample for
unkey.permissions.createPermissionis clear, includes proper error handling, and matches the documented API contract.
27-35: Response example is accurate.The JSON structure correctly demonstrates the
permissionIdin theresultobject.
44-49: ParamField fornameis clear.No issues found with the
nameparameter documentation.apps/docs/libraries/ts/sdk/permissions/create-role.mdx (3)
9-23: TS example snippet is well-structured.The
createRoleexample correctly demonstrates parameter usage and error handling.
28-34: Response example is fine.The JSON block accurately reflects the expected
roleIdresponse.
44-50: ParamField fornameis accurate.No issues found with the
nameparameter documentation.apps/docs/libraries/ts/sdk/ratelimits/overrides/set-override.mdx (2)
58-63: Excellent explicit error handling.The destructured
errorcheck with earlyreturnmakes the flow clear and aligns with the consistent error-handling pattern used elsewhere in the SDK docs.
65-66: Approve success logging.Directly logging
resultis concise and clearly demonstrates the returned payload in this example.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx (4)
47-49: Use en dash for numeric ranges
Replace hyphens with an en dash to denote the string length ranges consistently.- Required string length: 3 - 256 + Required string length: 3–256 - Required string length: 3 - 256 + Required string length: 3–256Also applies to: 55-57
57-57: Add space after colon in Example parameter
Add a space after the colon for consistency in the<ParamField>example.- Example:`"record.write can create new dns records for our domains."` + Example: `"record.write can create new dns records for our domains."`
29-34: Align JSON indentation in response example
Standardize the JSON example to 2-space indentation per level.{ - "result": { - "permissionId": "perm_123" - } + "result": { + "permissionId": "perm_123" + } }
63-63: Add missing period in response field description
Append a period to the sentence "This is used internally" for grammatical consistency.- The id of the permission. This is used internally + The id of the permission. This is used internally.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/docs/libraries/ts/sdk/identities/list-identity.mdx(1 hunks)apps/docs/libraries/ts/sdk/keys/get.mdx(2 hunks)apps/docs/libraries/ts/sdk/keys/update.mdx(3 hunks)apps/docs/libraries/ts/sdk/permissions/create-permission.mdx(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- apps/docs/libraries/ts/sdk/identities/list-identity.mdx
- apps/docs/libraries/ts/sdk/keys/update.mdx
- apps/docs/libraries/ts/sdk/keys/get.mdx
🧰 Additional context used
🪛 LanguageTool
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx
[typographical] ~55-~55: If you want to indicate numerical ranges or time ranges, consider using an en dash.
Context: ...t see this. Required string length: 3 - 256 Example:`"record.write can create...
(DASH_RULE)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Test Packages / Test ./packages/rbac
- GitHub Check: Test Packages / Test ./internal/clickhouse
- GitHub Check: autofix
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx (1)
1-4: Frontmatter description corrected
Thedescriptionnow references permission and ends with a period, addressing the previous feedback.
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (2)
apps/docs/docs.json (2)
319-321: Consistency: Use plural for permission operations
The SDK page paths use singular (add-permission,remove-permission,set-permission), but the API reference and other SDK sections use plural (add-permissions, etc.). Consider renaming these pages for consistency.
342-342: Consistency: Correct identity listing path
The page path uses singularlist-identitybut should be plural (list-identities) to align with the API reference and improve discoverability.
🧹 Nitpick comments (2)
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx (2)
47-48: Consistency: Use en dash for numeric ranges
Use an en dash (–) instead of a hyphen when indicating ranges (e.g.,3–256).Also applies to: 55-56
57-57: Formatting: Add space afterExample:
Include a space betweenExample:and the opening quote for consistency (Example: "record.write...").
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/docs/docs.json(4 hunks)apps/docs/libraries/ts/sdk/permissions/create-permission.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx
[typographical] ~55-~55: If you want to indicate numerical ranges or time ranges, consider using an en dash.
Context: ...t see this. Required string length: 3 - 256 Example:`"record.write can create...
(DASH_RULE)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: Test Packages / Test ./internal/clickhouse
- GitHub Check: autofix
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
apps/docs/libraries/ts/sdk/permissions/create-permission.mdx (4)
1-4: Frontmatter: Title and description are accurate
The page title and description correctly reference permissions and end with proper punctuation.
8-23: Request example snippet is clear and follows pattern
TypeScript example with proper error handling is well-formatted and consistent.
27-35: Response example is well-structured
JSON response sample clearly shows the expected structure.
38-40: Note section is clear and correctly punctuated
The permission requirement note includes the word "permission" and ends with a period.apps/docs/docs.json (2)
360-360: JSON Syntax: Comma after group object is correct
The comma following the Ratelimits group ensures valid JSON and proper separation of objects.
428-429: JSON Structure: Closing brackets and commas are valid
The closing of theunkey.pygroup pages list is correctly formatted.
What does this PR do?
This adds all the missing endpoints to the typescript SDK, unifies the layout on every page and also adds any missing parameters we may have added since we last updated it.
Type of change
How should this be tested?
Read docs.
Checklist
Required
pnpm buildpnpm fmtconsole.logsgit pull origin mainAppreciated
Summary by CodeRabbit