Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request adds billing-related URL parameters to support new billing features. Key changes include:
- Extending the RedirectOptions type with two new optional string properties: pricing_table_key and plan_interest.
- Updating createKindeClient to accept and incorporate these new parameters into the URL search parameters.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/types.ts | Added pricing_table_key and plan_interest to RedirectOptions. |
| src/createKindeClient.ts | Introduced new destructured parameters and updated URL construction with billing parameters. |
|
Warning Rate limit exceeded@aarhus has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 59 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThe changes introduce two new optional parameters, Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant KindeClient
participant EntitlementsAPI
Caller->>KindeClient: redirectToKinde({..., pricing_table_key, plan_interest})
KindeClient->>KindeClient: Add pricing_table_key and plan_interest to searchParams if provided
KindeClient->>Kinde Authorization Endpoint: Redirect with constructed URL (including new params if present)
Caller->>KindeClient: getUserEntitlements()
KindeClient->>EntitlementsAPI: GET /account_api/v1/entitlements with access token
EntitlementsAPI-->>KindeClient: User entitlements data
KindeClient-->>Caller: Return entitlements data
✨ Finishing Touches
Thanks 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 (
|
Fix to typo Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Added types to the wrong place
Added getUserEntitlements
Needs proper type definition
Added getUserEntitlements to the return
|
Thank you for this, I will review in the morning BST 👍 |
hi, any news on the review? :) |
p-stam001
left a comment
There was a problem hiding this comment.
I checked this PR and it needs to be improved.
First, unknown error code '_link_expired'.
if (error?.toLowerCase() === '_link_expired') {
Second, remove any type.
isAuthenticated: () => Promise<boolean>;
getUser: () => KindeUser;
getUserProfile: () => Promise<KindeUser | undefined>;
getUserEntitlements: () => Promise<any | undefined>; //Should remove any type.
login: (options?: AuthOptions) => Promise<void>;
logout: () => Promise<void>;
portal: (options: Omit<GeneratePortalUrlParams, 'domain'>) => Promise<void>;
Explain your changes
Adds the URL parameters (as per Kinde Billing Documentation ) to support the new billing features.
Checklist
🛟 If you need help, consider asking for advice over in the Kinde community.