-
Notifications
You must be signed in to change notification settings - Fork 48
add: b2b per usage billing setup guide
#653
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
WalkthroughAdds an "Implementation guides" entry to the Billing sidebar and introduces a new B2B SaaS per-usage billing implementation guide documenting org-scoped billing, admin-managed billing, Seat + metered pricing, onboarding patterns, and usage tracking. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
|
Hi @tamalchowdhury, I’d really appreciate your feedback on this PR when you have a moment. I want to make sure it aligns well with Kinde’s style and conventions, so any suggestions or improvements you notice would be very helpful. Thanks in advance! |
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: 2
🤖 Fix all issues with AI agents
In
`@src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx`:
- Line 14: Update the document metadata by changing the `updated` front-matter
value from "2025-01-27" to "2026-01-27" so the file's `updated` field reflects
the correct 2026 date; locate the `updated:` metadata entry in the MDX
front-matter and replace the year accordingly.
- Around line 1-18: The filename in the frontmatter and file path uses
"b2b-sass-per-usage-billing-setup.mdx" (typo: "sass")—rename the file to
"b2b-saas-per-usage-billing-setup.mdx" and update any internal references/links
to the old name (e.g., nav/sidebar entries or cross-doc links) so they point to
"b2b-saas-per-usage-billing-setup.mdx"; ensure the page title/frontmatter
remains unchanged except for any filename-based fields that reference the old
name.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdxsrc/data/sidebarData.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-27T18:42:29.479Z
Learnt from: victoreronmosele
Repo: kinde-oss/documentation PR: 647
File: src/content/docs/developer-tools/sdks/native/ios-sdk.mdx:278-297
Timestamp: 2025-12-27T18:42:29.479Z
Learning: In MDX documentation files (e.g., any API reference docs), when documenting parameters (like loginHint, connectionId), prefer listing them in the API reference Arguments section and link to detailed documentation pages instead of duplicating descriptions, format specs, or validation rules inline. This follows the 'document once, reference anywhere' principle.
Applied to files:
src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx
🪛 LanguageTool
src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx
[style] ~209-~209: The double modal “required Intended” is nonstandard (only accepted in certain dialects). Consider “to be Intended”.
Context: ...dashboard) - No custom code required - Intended for internal or low-volume use ### O...
(NEEDS_FIXED)
🔇 Additional comments (6)
src/data/sidebarData.ts (1)
249-254: LGTM!The new "Implementation guides" entry follows the established pattern and correctly references the
billing/implementation-guidedirectory where the new documentation resides.src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdx (5)
42-150: LGTM!The setup sections (Stripe connection, billing plan configuration, pricing table, and role creation) are well-structured with clear step-by-step instructions and appropriate external references.
162-184: LGTM!The code examples for organization creation are clear and demonstrate both the React SDK approach and direct authorization URL method appropriately.
197-255: LGTM!The user join patterns are well-documented with three practical options covering different B2B use cases. The
orgCodeapproach is appropriately marked as the recommended default.Note: The static analysis hint about line 209 is a false positive—"required" and "Intended" are separate bullet points, not a double modal.
256-277: LGTM!Good clarity that seat counts must be manually submitted, with practical trigger examples and multiple integration paths (API, Workflows, webhooks).
279-287: LGTM!The troubleshooting section addresses a common issue with clear verification steps.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
Show resolved
Hide resolved
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
Outdated
Show resolved
Hide resolved
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: 2
🤖 Fix all issues with AI agents
In
`@src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx`:
- Around line 134-150: The "Key" field in the "Create a Billing Admin role"
section is inconsistent with other fields; update the markdown for the Key line
in the Billing Admin role block so it matches the others by changing "Key:
billing-admin" to "**Key:** billing-admin" within the same section (the block
that configures Name, Key, Assign, System permission).
- Around line 201-203: Replace the vague bullet "The appropriate authentication
method is enabled" with a specific guidance: list supported auth flows (e.g.,
RegisterLink/LoginLink for orgCode, domain-based SSO via direct auth URLs, and
manual invite flow), state which flow is required for each billing setup option,
and add a pointer to the authentication examples in Section 5 (lines 163–184) or
Kinde's auth docs; keep the existing "Org → Policies → Allow org members to be
auto-added" bullet as-is.
🧹 Nitpick comments (1)
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx (1)
42-52: Consider using relative links for internal documentation.Line 52 uses an absolute URL for internal documentation. If your documentation system supports it, using relative paths (e.g.,
/billing/payment-management/manage-stripe-connection/) can prevent broken links across different environments and improve maintainability.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-27T18:42:29.479Z
Learnt from: victoreronmosele
Repo: kinde-oss/documentation PR: 647
File: src/content/docs/developer-tools/sdks/native/ios-sdk.mdx:278-297
Timestamp: 2025-12-27T18:42:29.479Z
Learning: In MDX documentation files (e.g., any API reference docs), when documenting parameters (like loginHint, connectionId), prefer listing them in the API reference Arguments section and link to detailed documentation pages instead of duplicating descriptions, format specs, or validation rules inline. This follows the 'document once, reference anywhere' principle.
Applied to files:
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
🪛 LanguageTool
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
[style] ~209-~209: The double modal “required Intended” is nonstandard (only accepted in certain dialects). Consider “to be Intended”.
Context: ...dashboard) - No custom code required - Intended for internal or low-volume use ### O...
(NEEDS_FIXED)
🔇 Additional comments (8)
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx (8)
1-18: LGTM! Frontmatter is well-structured.The metadata is comprehensive and appropriate for this implementation guide. The updated date (2026-01-15) correctly reflects the current timeframe.
20-41: LGTM! Clear introduction and logical flow.The guide overview provides a well-structured implementation roadmap that will help developers understand the complete process upfront.
54-124: LGTM! Comprehensive billing plan configuration.The step-by-step instructions with specific field names and values make this section highly actionable. The inclusion of optional base subscription charges adds helpful flexibility.
125-132: LGTM! Clear and concise pricing table setup.
152-195: LGTM! Clear organization creation flow with practical examples.Both the React SDK and direct authorization URL examples are well-formatted and demonstrate the signup flow effectively. The behavior description helps developers understand what to expect.
206-254: LGTM! Well-organized user join patterns.The three options (manual, orgCode-based, and domain-based) are clearly explained with appropriate code examples. The recommendation to use orgCode as the default is helpful guidance.
256-277: LGTM! Critical information about manual seat tracking.The explicit note that Kinde doesn't automatically calculate seat counts is crucial for developers. The various submission methods (API, Workflows, webhooks) provide flexibility for different architectures.
279-287: LGTM! Helpful troubleshooting guidance.The verification checklist for the pricing table issue provides clear, actionable steps for debugging.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
Outdated
Show resolved
Hide resolved
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
Outdated
Show resolved
Hide resolved
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Hi @Arobce thanks a lot for the mention. I am also in the process of creating an updated style guide for the docs so it will be helpful to create the guides in one unified standard. In the meantime, I will review the doc. |
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: 2
🤖 Fix all issues with AI agents
In
`@src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx`:
- Around line 224-228: The displayed link text "Signin" inside the LoginLink
component is a typo and should be changed to "Sign in" for consistency; locate
the LoginLink usage (LoginLink orgCode="org_8d350c10295bf") and update its inner
text from "Signin" to "Sign in" so it matches other occurrences like "Sign up".
- Around line 257-278: The example link to "Track org seat usage workflow"
pointing to trackOrgSeatUsageWorkflow.ts is broken (404); either remove the
linked example or replace the link with a valid workflow example URL (or point
to a local example file), and update the surrounding text in the "How to submit
usage" section so the list item no longer references a missing resource (adjust
the bullet that mentions the workflow example and the anchor text "Track org
seat usage workflow" accordingly).
🧹 Nitpick comments (1)
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx (1)
200-204: Add a "Prerequisites" header for clarity.The bullet points at lines 202-203 appear to be prerequisites for Options 2 and 3, but they're presented without context after the introductory sentence. This structure may confuse readers about whether these are requirements or options.
📝 Suggested clarification
Once an organization exists, additional users can join using multiple supported approaches. +**Prerequisites for self-signup options (Options 2 and 3):** + - The appropriate authentication (email + password, email + code, etc.) method is enabled - **Org → Policies → Allow org members to be auto-added** is enabled
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-27T18:42:29.479Z
Learnt from: victoreronmosele
Repo: kinde-oss/documentation PR: 647
File: src/content/docs/developer-tools/sdks/native/ios-sdk.mdx:278-297
Timestamp: 2025-12-27T18:42:29.479Z
Learning: In MDX documentation files (e.g., any API reference docs), when documenting parameters (like loginHint, connectionId), prefer listing them in the API reference Arguments section and link to detailed documentation pages instead of duplicating descriptions, format specs, or validation rules inline. This follows the 'document once, reference anywhere' principle.
Applied to files:
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
🪛 LanguageTool
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
[style] ~210-~210: The double modal “required Intended” is nonstandard (only accepted in certain dialects). Consider “to be Intended”.
Context: ...dashboard) - No custom code required - Intended for internal or low-volume use ### O...
(NEEDS_FIXED)
🔇 Additional comments (3)
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx (3)
20-40: Well-structured guide overview.The introduction clearly outlines the architecture pattern and the high-level implementation flow. The numbered steps provide a good roadmap for readers.
54-126: Clear per-user billing configuration instructions.The metered feature configuration is well-documented with specific field values and explanations. The optional base subscription charge section provides good flexibility guidance.
163-185: Good code examples for both React SDK and direct URL.Both the
RegisterLinkcomponent usage and the direct authorization URL provide developers with flexible integration options.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
Show resolved
Hide resolved
src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx
Outdated
Show resolved
Hide resolved
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
🤖 Fix all issues with AI agents
In
`@src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx`:
- Line 224: Update the heading text "Option 2: Allow self sign-up using an
organization code (recommended)" to hyphenate the compound noun; change "self
sign-up" to "self-sign-up" so the heading reads "Option 2: Allow self-sign-up
using an organization code (recommended)"; locate and edit the heading string in
the document where that exact line appears.
| - No custom code required | ||
| - Intended for internal or low-volume usage | ||
|
|
||
| ### Option 2: Allow self sign-up using an organization code (recommended) |
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.
Hyphenate “self‑sign‑up” in the heading.
Line 224 uses a compound noun; hyphenation improves grammar and consistency.
✏️ Proposed copy edit
-### Option 2: Allow self sign-up using an organization code (recommended)
+### Option 2: Allow self-sign-up using an organization code (recommended)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ### Option 2: Allow self sign-up using an organization code (recommended) | |
| ### Option 2: Allow self-sign-up using an organization code (recommended) |
🧰 Tools
🪛 LanguageTool
[grammar] ~224-~224: Use a hyphen to join words.
Context: ...w-volume usage ### Option 2: Allow self sign-up using an organization code (reco...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents
In
`@src/content/docs/billing/implementation-guide/b2b-saas-per-usage-billing-setup.mdx`
at line 224, Update the heading text "Option 2: Allow self sign-up using an
organization code (recommended)" to hyphenate the compound noun; change "self
sign-up" to "self-sign-up" so the heading reads "Option 2: Allow self-sign-up
using an organization code (recommended)"; locate and edit the heading string in
the document where that exact line appears.
Description (required)
Added a comprehensive implementation guide for B2B SaaS billing with organizations and per-user pricing in Kinde.
Changes:
src/content/docs/billing/implementation-guide/b2b-sass-per-usage-billing-setup.mdxsrc/data/sidebarData.tsto include new "Implementation guides" section under BillingKey features:
Related issues & labels
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.