-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add override methods and docs #2728
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
📝 WalkthroughWalkthroughThis pull request introduces new documentation and functionality for managing rate limit overrides within the SDK. It includes the addition of four new documentation files for the "Set Override," "Get Override," "List Overrides," and "Delete Override" functionalities, detailing their request parameters, response structures, and usage examples. Additionally, a new Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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! 🙏 |
…com/unkeyed/unkey into eng-1339-custom-override-update-sdk
…-custom-override-update-sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx (2)
8-8
: Consider adding wildcard examples for better clarity.While the documentation mentions wildcard support, it would be helpful to include specific examples of valid wildcard patterns (e.g.,
user_*
,*.example.com
).
26-26
: Add missing comma for better readability.Add a comma after "returned" for better sentence structure.
-No response, but if no error is returned the override has been deleted successfully. +No response, but if no error is returned, the override has been deleted successfully.🧰 Tools
🪛 LanguageTool
[uncategorized] ~26-~26: Possible missing comma found.
Context: ...sponse No response, but if no error is returned the override has been deleted successfu...(AI_HYDRA_LEO_MISSING_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.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 (3)
- apps/docs/libraries/ts/sdk/ratelimits/overrides/list-overrides.mdx
- apps/docs/libraries/ts/sdk/ratelimits/overrides/set-override.mdx
- apps/docs/libraries/ts/sdk/ratelimits/overrides/get-override.mdx
🧰 Additional context used
🪛 LanguageTool
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx
[uncategorized] ~26-~26: Possible missing comma found.
Context: ...sponse No response, but if no error is returned the override has been deleted successfu...
(AI_HYDRA_LEO_MISSING_COMMA)
🔇 Additional comments (1)
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx (1)
1-5
: LGTM! Clear and concise header section.
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx
Outdated
Show resolved
Hide resolved
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx
Outdated
Show resolved
Hide resolved
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx
Outdated
Show resolved
Hide resolved
apps/docs/libraries/ts/sdk/ratelimits/overrides/list-overrides.mdx
Outdated
Show resolved
Hide resolved
apps/docs/libraries/ts/sdk/ratelimits/overrides/list-overrides.mdx
Outdated
Show resolved
Hide resolved
…-custom-override-update-sdk
…com/unkeyed/unkey into eng-1339-custom-override-update-sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (6)
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx (2)
15-17
: Enhance the namespaceId parameter descriptionThe description for
namespaceId
could be more detailed to match the level of detail provided for other parameters. Consider adding information about its format and purpose.<ParamField body="namespaceId" type="string"> -The id of the namespace. Either namespaceId or namespaceName must be provided +The unique identifier of the namespace (e.g., "rlns_1234"). Either namespaceId or namespaceName must be provided. This is the immutable identifier that uniquely identifies your namespace. </ParamField>
26-26
: Improve response section clarityAdd proper punctuation to enhance readability.
-No response, but if no error is returned the override has been deleted successfully. +No response, but if no error is returned, the override has been deleted successfully.🧰 Tools
🪛 LanguageTool
[uncategorized] ~26-~26: Possible missing comma found.
Context: ...sponse No response, but if no error is returned the override has been deleted successfu...(AI_HYDRA_LEO_MISSING_COMMA)
apps/docs/libraries/ts/sdk/overview.mdx (4)
121-122
: Fix ParamField closing tag formattingThe closing tag for ParamField should be on the same line as the content for consistency.
-```ts -const unkey = new Unkey({ - //... - baseUrl: "https://my.domain" -}) -``` -</ParamField> +```ts +const unkey = new Unkey({ + //... + baseUrl: "https://my.domain" +}) +```</ParamField>Additionally, consider adding a security note about validating custom endpoints and using HTTPS.
Line range hint
123-143
: Enhance retry configuration documentationThe retry configuration documentation is clear, but consider adding:
- Recommended retry attempts for different environments (development vs production)
- Example of an exponential backoff function as a best practice
const unkey = new Unkey({ // ... retry: { attempts: 3, - backoff: (retryCount) => retryCount * 1000 + // Exponential backoff with jitter + backoff: (retryCount) => Math.min(1000 * Math.pow(2, retryCount) + Math.random() * 1000, 10000) } })🧰 Tools
🪛 LanguageTool
[uncategorized] ~125-~125: Did you mean: “By default,”?
Context: ...in" }) ``` ### Retries By default the client will retry on network errors...(BY_DEFAULT_COMMA)
Line range hint
145-164
: Enhance cache configuration documentationWhile the cache options are listed, consider:
- Adding brief explanations for each cache option
- Providing use-case examples for different cache strategies
- Clarifying the Cloudflare workers limitation with an expected resolution timeframe or workaround
🧰 Tools
🪛 LanguageTool
[uncategorized] ~125-~125: Did you mean: “By default,”?
Context: ...in" }) ``` ### Retries By default the client will retry on network errors...(BY_DEFAULT_COMMA)
Line range hint
166-173
: Add privacy details to telemetry documentationConsider enhancing the telemetry section with:
- Specific details about what anonymous data is collected
- How the data is used and stored
- Link to privacy policy or data handling documentation
🧰 Tools
🪛 LanguageTool
[uncategorized] ~125-~125: Did you mean: “By default,”?
Context: ...in" }) ``` ### Retries By default the client will retry on network errors...(BY_DEFAULT_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/docs/libraries/ts/sdk/overview.mdx
(1 hunks)apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-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 (2)
- apps/docs/libraries/ts/sdk/ratelimits/overrides/set-override.mdx
- apps/docs/libraries/ts/sdk/ratelimits/overrides/list-overrides.mdx
🧰 Additional context used
🪛 LanguageTool
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx
[uncategorized] ~26-~26: Possible missing comma found.
Context: ...sponse No response, but if no error is returned the override has been deleted successfu...
(AI_HYDRA_LEO_MISSING_COMMA)
🔇 Additional comments (2)
apps/docs/libraries/ts/sdk/ratelimits/overrides/delete-override.mdx (1)
31-42
: LGTM! Examples are clear and follow best practices
The code examples effectively demonstrate both ways to identify a namespace (using either namespaceId
or namespaceName
) and correctly avoid variable assignment for delete operations.
apps/docs/libraries/ts/sdk/overview.mdx (1)
Line range hint 1-173
: Verify completeness of override methods documentation
While the SDK configuration documentation is comprehensive, the PR objectives mention adding override methods. Consider adding:
- A section about the new override methods
- Examples of using these methods
- Links to the detailed override documentation
🧰 Tools
🪛 LanguageTool
[uncategorized] ~125-~125: Did you mean: “By default,”?
Context: ...in" }) ``` ### Retries By default the client will retry on network errors...
(BY_DEFAULT_COMMA)
What does this PR do?
Fixes # (issue)
If there is not an issue for this, please create one first. This is used to tracking purposes and also helps use understand why this PR exists
Type of change
How should this be tested?
Docs match routes and make sense.
Checklist
Required
pnpm build
pnpm fmt
console.logs
git pull origin main
Appreciated
Summary by CodeRabbit
New Features
Documentation
Chores