-
Notifications
You must be signed in to change notification settings - Fork 42
feat: tutorial - check plan change eligibility #606
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA new tutorial documentation file is added providing comprehensive guidance on configuring automatic plan downgrade eligibility checks using Kinde billing and workflows, spanning Prisma schema setup, user interface implementation, API endpoints, billing configuration, and workflow deployment steps. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
Deploying kinde-docs-preview with
|
| Latest commit: |
89c5386
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c5863ed4.kinde-docs-preview.pages.dev |
| Branch Preview URL: | https://tamal-feat-billing-wf-check-vzfm.kinde-docs-preview.pages.dev |
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
🧹 Nitpick comments (5)
src/content/docs/workflows/workflow-tutorials/check-plan-change-eligibility.mdx (5)
40-40: Fix framework naming consistency and improve sentence clarity.The framework should be referenced as "Next.js" (not "NextJS") per official naming conventions. Additionally, the phrase "in order to assess" can be simplified to "to assess" for conciseness. The introduction also appears to have a missing comma.
Suggested correction for line 40:
In this tutorial, you'll set up a way to check a customer's feature usage to assess if they can downgrade their plan.Also applies to: 47-47
53-53: Standardize framework naming to "Next.js".Multiple instances of "NextJS" should be corrected to "Next.js" throughout the document for consistency with official branding.
Also applies to: 58-58
790-803: Consider rewording repetitive sentence structures for better readability.Lines 795-797 have three consecutive sentences beginning with "Select." While not incorrect, varying sentence structure improves documentation flow. For example:
- Line 795: "Select the three dots..." → "Click the three dots..."
- Line 797: "Select Make live..." → "Click Make live..."
1010-1010: Correct grammar for "sign in" usage.Change "Sign into your [Kinde dashboard]" to "Sign in to your [Kinde dashboard]." The phrase "sign in to" is standard English for websites/software; "sign into" is primarily used in legal contexts ("signed into law").
1028-1028: Fix remaining framework naming and hyphenation issues.
- Line 1028: Change "NextJS project" to "Next.js project"
- Line 1033: Change "sign up process" to "sign-up process" (hyphenated form for noun usage)
Also applies to: 1033-1033
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content/docs/workflows/workflow-tutorials/check-plan-change-eligibility.mdx(1 hunks)
🧰 Additional context used
🪛 LanguageTool
src/content/docs/workflows/workflow-tutorials/check-plan-change-eligibility.mdx
[typographical] ~40-~40: It appears that a comma is missing.
Context: ...ility. ## About this tutorial In this tutorial you’ll set up a way to check a customer...
(DURING_THAT_TIME_COMMA)
[style] ~40-~40: Consider a more concise word here.
Context: ...ay to check a customer’s feature usage, in order to assess if they can downgrade their plan...
(IN_ORDER_TO_PREMIUM)
[uncategorized] ~40-~40: The official spelling of this programming framework is “Next.js”.
Context: ...y can downgrade their plan. We’ll use a NextJS project as part of the example. ## Wha...
(NODE_JS)
[uncategorized] ~47-~47: The official spelling of this programming framework is “Next.js”.
Context: ...yed to the internet, such as the [Kinde NextJS starter kit](https://github.com/kinde-s...
(NODE_JS)
[uncategorized] ~53-~53: The official spelling of this programming framework is “Next.js”.
Context: ...### Part 1: Prisma setup 1. Go to your NextJS project in your terminal. (e.g, `cd kin...
(NODE_JS)
[style] ~796-~796: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... User plans and select Save. 4. Select the three dots next to the pricing tabl...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~797-~797: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...d and select Edit pricing table. 5. Select Make live and select Save. 6. G...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[grammar] ~1010-~1010: The verb ‘Sign into’ is not standard English, except in the context of the law (“The bill was signed into law”). Write “Sign in to”. For websites and computers, other options are “log in to” or “log on to”.
Context: ...ed. ## Step 4: Deploy the workflow 1. Sign into your [Kinde dashboard](https://kinde.co...
(SIGN_INTO)
[uncategorized] ~1028-~1028: The official spelling of this programming framework is “Next.js”.
Context: ...est the workflow 1. Deploy your sample NextJS project to the internet, [such as Verce...
(NODE_JS)
[uncategorized] ~1033-~1033: The noun “sign-up” is spelled with a hyphen.
Context: ...project in a browser and go through the sign up process. You will see the plan selectio...
(SIGN_UP_HYPHEN)
🔇 Additional comments (4)
src/content/docs/workflows/workflow-tutorials/check-plan-change-eligibility.mdx (4)
123-699: Well-implemented UI and server logic.The dashboard component, server actions, and styling demonstrate solid Next.js patterns with proper error handling, form validation, and accessibility considerations. The entitlement-checking logic properly integrates with Kinde's Account API, and cache invalidation with
revalidatePathis correctly used.
702-753: Solid API endpoint implementation.The endpoint correctly uses
force-dynamicto ensure real-time usage data retrieval (critical for this use case), properly validates thekindeIdparameter, and returns the expected JSON structure for workflow consumption.
807-948: Well-explained workflow implementation with comprehensive code documentation.The workflow correctly implements plan change eligibility checking by comparing current usage against requested plan limits. The code explanation section (lines 950–1006) is thorough and walks developers through the logic effectively. Integration with environment variables is properly configured for the next steps.
1-1054: Comprehensive, well-structured tutorial with solid code examples.This tutorial effectively guides developers through setting up automatic plan downgrade eligibility checks using Kinde billing and workflows. The code examples follow Next.js and TypeScript best practices, the step-by-step instructions are clear and logical, and the testing section provides realistic validation steps. The integration of Prisma, server actions, Kinde authentication, and workflows is well-coordinated.
Primary observations:
- Code quality is high with proper error handling, validation, and accessibility considerations
- Instructions are thorough and include helpful deployment/environment setup details
- The testing scenario effectively validates the entire workflow
Minor issues flagged above relate to framework naming consistency ("NextJS" → "Next.js") and grammatical/style improvements that have been addressed in separate comments.
tutorial - check plan change eligibility
Learn how to set up automatic downgrade eligibility checks using Kinde billing and workflows.
Related issues & labels (optional)
Summary by CodeRabbit