Skip to content

Update/supabase #448

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

Merged
merged 5 commits into from
Jun 17, 2025
Merged

Conversation

tamalchowdhury
Copy link
Contributor

@tamalchowdhury tamalchowdhury commented Jun 17, 2025

Description (required)

Updated the Supabase integration doc to reflect the new boilerplate changes.

Related issues & labels (optional)

  • Closes #
  • Suggested label:

Summary by CodeRabbit

  • Documentation

    • Improved integration guide for Kinde and Supabase with Next.js, clarifying environment variable sources and updating instructions for consistency.
    • Updated post-login redirect URL and preview instructions to reflect new locations for example components.
  • Refactor

    • Streamlined authentication UI, simplifying button logic and renaming components for clarity.
    • Consolidated and reorganized example components and updated their display location and URLs.

Copy link
Contributor

coderabbitai bot commented Jun 17, 2025

Walkthrough

The integration guide for Kinde and Supabase with Next.js was updated for clarity and correctness. Key changes include improved documentation, renamed and refactored authentication components, relocation and rewriting of Supabase client logic, new middleware for session updates, consolidation of example components, and adjustments to environment variables and URLs.

Changes

Files/Groups Change Summary
src/content/docs/integrate/third-party-tools/... Updated documentation for clearer integration steps, clarified environment variable sources.
components/auth-button.tsx Renamed from header-auth.tsx, simplified logic, updated export signature, removed sign-out form.
lib/supabase/server.ts Moved from utils/supabase/server.ts, rewritten in TypeScript, improved JWT and cookie handling.
lib/supabase/middleware.ts Added new middleware with updateSession for session sync, includes detailed usage comments.
components/hero.tsx Moved and renamed TodoList from app/todo/page.tsx, updated import paths and UI structure.
app/todo/page.tsx Example component removed, logic moved to components/hero.tsx.
.env.local Updated post-login redirect URL from /todo to /.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AuthButton
    participant SupabaseServerClient
    participant Middleware

    User->>AuthButton: Clicks Sign In/Sign Out
    AuthButton->>SupabaseServerClient: Checks session, renders UI
    User->>AuthButton: Interacts (sign in/sign out)
    AuthButton->>SupabaseServerClient: Triggers authentication
    SupabaseServerClient->>Middleware: updateSession(request)
    Middleware-->>SupabaseServerClient: Returns updated response
    SupabaseServerClient-->>AuthButton: Session updated
    AuthButton-->>User: Updates UI (greeting or auth buttons)
Loading

Possibly related PRs

  • Feat/supabase #354: Introduced the initial Kinde-Supabase integration documentation, which this PR refines and builds upon.

Suggested reviewers

  • clairekinde11
  • oliwolff1

Poem

In the garden of code where carrots grow,
Integration guides now clearly show.
Auth buttons hop, components shift,
Supabase and Kinde, a seamless lift.
With middleware magic and docs anew,
This bunny celebrates—thanks to the crew! 🥕


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (2)
src/content/docs/integrate/third-party-tools/kinde-supabase.mdx (2)

195-244: Supabase server client setup with JWT integration.
The createClient function properly signs the Kinde ID token and falls back to the anon key. As an optional enhancement, consider using the Supabase service role key for server-side operations that require elevated privileges while still preserving RLS protections.


294-361: Hero component example added.
The Hero component correctly fetches and renders the todo list. Verify your import alias (@/lib/supabase/server) is defined in your Next.js configuration. Optionally, extract the inline styles into reusable CSS classes or Tailwind utility classes for better maintainability.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9abf1a5 and ff0120e.

📒 Files selected for processing (1)
  • src/content/docs/integrate/third-party-tools/kinde-supabase.mdx (4 hunks)
🔇 Additional comments (5)
src/content/docs/integrate/third-party-tools/kinde-supabase.mdx (5)

130-131: Consistent path quoting in code examples.
Using quoted paths for the mkdir and touch commands improves readability and avoids shell parsing issues.


149-149: Clarified Supabase environment variable sources.
Separating the Data API URL and the Anon public key makes the instructions more precise and reduces ambiguity for new users.


162-193: Updated authentication UI component snippet.
The new AuthButton implementation is concise and correctly leverages getKindeServerSession. Please verify that components/auth-button.tsx uses the .tsx extension and that your Next.js path alias (@kinde-oss/kinde-auth-nextjs) is configured in tsconfig.json or next.config.js.


245-282: Validate hasEnvVars usage in middleware.
Ensure that hasEnvVars is a boolean constant; if it’s a function, update the check to if (!hasEnvVars()). Otherwise the middleware skip logic may not behave as expected.


369-371: Post-login redirect URL updated.
The .env.local snippet now redirects users to / after login, aligning with the relocated to-do example.

@clairekinde11 clairekinde11 self-requested a review June 17, 2025 23:14
@clairekinde11 clairekinde11 merged commit dd2dd67 into kinde-oss:main Jun 17, 2025
5 checks passed
@tamalchowdhury tamalchowdhury deleted the Update/supabase branch August 5, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants