Skip to content

Conversation

@aidankmcalister
Copy link
Member

@aidankmcalister aidankmcalister commented Nov 21, 2025

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive guide for integrating Clerk authentication with an Astro app and persisting users with Prisma/Postgres — includes setup, SSR/middleware, webhook handling, testing, troubleshooting, and deployment notes.
    • Updated site navigation to add the new Clerk + Astro integration guide.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

Walkthrough

Adds a new Clerk + Astro + Prisma (Postgres) integration guide documenting setup, Clerk configuration (SSR/middleware/UI), Prisma schema and client, webhook handling (verification + upsert), env typing, ngrok/local exposure, Astro server config, testing, troubleshooting, and deployment notes; also updates the site sidebar to include the guide.

Changes

Cohort / File(s) Change Summary
New Clerk–Astro Integration Guide
content/800-guides/420-clerk-astro.mdx
New comprehensive guide covering prerequisites, project setup, Clerk keys and SSR integration, middleware and UI snippets, Astro config, Prisma installation and User schema with clerkId, env.d.ts typing, reusable Prisma client example (src/lib/prisma.ts), Clerk webhook handler (src/pages/api/webhooks/clerk.ts) with signature verification and upsert logic, ngrok/local exposure steps, webhook registration, testing, troubleshooting, and deployment notes.
Sidebar Navigation Update
sidebars.ts
Adds guides/clerk-astro entry under Guides → Integration Solutions in the site sidebar.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Review focus:
    • Validate webhook example: signature verification logic, explicit error responses, and upsert transaction correctness.
    • Confirm Prisma client pattern (src/lib/prisma.ts) and env.d.ts snippets follow the project’s TS/ESM conventions.
    • Check code snippets for accurate imports/paths and matching environment variable names to avoid copy-paste issues.

Possibly related PRs

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding a Clerk + Astro integration guide. It directly maps to the new documentation file and sidebar entry.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

@github-actions
Copy link
Contributor

Images automagically compressed by Calibre's image-actions

Compression reduced images by 85.4%, saving 314.2 KB.

Filename Before After Improvement Visual comparison
static/img/guides/prisma-clerk-astro-cover.png 367.9 KB 53.7 KB 85.4% View diff

@github-actions
Copy link
Contributor

@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2241
✅ Successful 2207
⏳ Timeouts 0
🔀 Redirected 4
👻 Excluded 24
❓ Unknown 0
🚫 Errors 5
⛔ Unsupported 1

Errors per input

Errors in 200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx

Errors in 200-orm/800-more/400-comparisons/03-prisma-and-mongoose.mdx

Errors in 800-guides/420-clerk-astro.mdx

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 21, 2025

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: b8b8d47
Status: ✅  Deploy successful!
Preview URL: https://951d6097.docs-51g.pages.dev
Branch Preview URL: https://dc-5239-astro-clerk-guide.docs-51g.pages.dev

View logs

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: 2

🧹 Nitpick comments (1)
content/800-guides/420-clerk-astro.mdx (1)

175-175: Consider removing unused tsx dependency.

The tsx package is installed here but never used in the guide. Unless there's a specific reason for including it that should be documented, consider removing it to keep dependencies minimal.

Apply this diff if tsx is not needed:

-npm install prisma tsx @types/pg --save-dev
+npm install prisma @types/pg --save-dev
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc410ce and 709f572.

⛔ Files ignored due to path filters (1)
  • static/img/guides/prisma-clerk-astro-cover.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • content/800-guides/420-clerk-astro.mdx (1 hunks)
  • sidebars.ts (1 hunks)
🧰 Additional context used
🪛 LanguageTool
content/800-guides/420-clerk-astro.mdx

[uncategorized] ~57-~57: The official name of this software platform is spelled with a capital “H”.
Context: .... :::info For this guide, the Google, Github, and Email sign in options will be used...

(GITHUB)

🔇 Additional comments (2)
sidebars.ts (1)

394-394: LGTM! Sidebar entry correctly placed.

The new guide is properly added to the Integration Solutions category alongside the existing Clerk + Next.js guide, maintaining consistency.

content/800-guides/420-clerk-astro.mdx (1)

1-552: Well-structured and comprehensive guide.

This documentation provides clear step-by-step instructions for integrating Clerk authentication with Astro and Prisma Postgres. The troubleshooting section is particularly helpful, and the code examples follow Astro best practices (like using import.meta.env for environment variables).

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 21, 2025
@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2241
✅ Successful 2209
⏳ Timeouts 0
🔀 Redirected 2
👻 Excluded 24
❓ Unknown 0
🚫 Errors 5
⛔ Unsupported 1

Errors per input

Errors in 200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx

Errors in 200-orm/800-more/400-comparisons/03-prisma-and-mongoose.mdx

Errors in 800-guides/420-clerk-astro.mdx

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 21, 2025
@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2240
✅ Successful 2208
⏳ Timeouts 0
🔀 Redirected 3
👻 Excluded 24
❓ Unknown 0
🚫 Errors 4
⛔ Unsupported 1

Errors per input

Errors in 200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx

Errors in 200-orm/800-more/400-comparisons/03-prisma-and-mongoose.mdx

Errors in 800-guides/320-permit-io-access-control.mdx

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 21, 2025
@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2240
✅ Successful 2206
⏳ Timeouts 0
🔀 Redirected 5
👻 Excluded 24
❓ Unknown 0
🚫 Errors 4
⛔ Unsupported 1

Errors per input

Errors in 200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx

Errors in 200-orm/800-more/400-comparisons/03-prisma-and-mongoose.mdx

Errors in 800-guides/420-clerk-astro.mdx

@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2240
✅ Successful 2208
⏳ Timeouts 0
🔀 Redirected 3
👻 Excluded 24
❓ Unknown 0
🚫 Errors 4
⛔ Unsupported 1

Errors per input

Errors in 200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx

Errors in 200-orm/800-more/400-comparisons/03-prisma-and-mongoose.mdx

Errors in 800-guides/320-permit-io-access-control.mdx

coderabbitai[bot]
coderabbitai bot previously approved these changes Nov 22, 2025
Copy link
Member

@mhartington mhartington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the min version of node needed then it's good

@github-actions
Copy link
Contributor

🍈 Lychee Link Check Report

Note: Links are cached for 5 minutes. Failed links (timeouts, rate limits) are retried in a second run with longer timeout.

📊 Results Overview

Status Count
🔍 Total 2240
✅ Successful 2206
⏳ Timeouts 0
🔀 Redirected 4
👻 Excluded 24
❓ Unknown 0
🚫 Errors 5
⛔ Unsupported 1

Errors per input

Errors in 200-orm/050-overview/100-introduction/250-should-you-use-prisma.mdx

Errors in 200-orm/050-overview/500-databases/880-supabase.mdx

Errors in 200-orm/200-prisma-client/150-using-raw-sql/200-raw-queries.mdx

Errors in 200-orm/800-more/400-comparisons/03-prisma-and-mongoose.mdx

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 (1)
content/800-guides/420-clerk-astro.mdx (1)

55-55: Correct GitHub capitalization.

The official name is "GitHub" with a capital "H" to match official branding.

-For this guide, the Google, Github, and Email sign in options will be used.
+For this guide, the Google, GitHub, and Email sign in options will be used.
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02c6e0f and b8b8d47.

📒 Files selected for processing (1)
  • content/800-guides/420-clerk-astro.mdx (1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: 2025-10-03T19:30:57.554Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7157
File: content/800-guides/400-deno-integration.mdx:188-190
Timestamp: 2025-10-03T19:30:57.554Z
Learning: For the prisma/docs repository, do not suggest changes to code blocks when reviewing documentation pull requests.

Applied to files:

  • content/800-guides/420-clerk-astro.mdx
📚 Learning: 2025-11-20T21:00:02.587Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7301
File: content/800-guides/410-cloudflare-workers.mdx:87-107
Timestamp: 2025-11-20T21:00:02.587Z
Learning: Do not suggest changes to `prisma.config.ts` files in the prisma/docs repository, as the code examples are intentional for documentation purposes.

Applied to files:

  • content/800-guides/420-clerk-astro.mdx
📚 Learning: 2025-10-08T16:23:00.388Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:85-90
Timestamp: 2025-10-08T16:23:00.388Z
Learning: For .mdx files in the prisma/docs repository: Only flag code snippets for (1) exposed secrets with real-looking values that should be placeholders (e.g., API keys, database passwords, AWS credentials), or (2) blatant syntax errors like missing parentheses, brackets, braces, or mismatched delimiters. Do not flag code quality issues, anti-patterns, security vulnerabilities, missing error handling, unused variables, or any other bad practices, as documentation intentionally shows problematic code.

Applied to files:

  • content/800-guides/420-clerk-astro.mdx
📚 Learning: 2025-10-08T16:24:58.382Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:168-176
Timestamp: 2025-10-08T16:24:58.382Z
Learning: For .mdx documentation files specifically, once a suggestion is resolved without implementation, never re-suggest that same change again. Respect the team's judgment that the resolution represents a final decision.

Applied to files:

  • content/800-guides/420-clerk-astro.mdx
📚 Learning: 2025-10-10T13:13:30.534Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7167
File: content/900-ai/prompts/astro.mdx:84-85
Timestamp: 2025-10-10T13:13:30.534Z
Learning: Do not review or comment on files in the `ai/prompts/` directory or matching the path pattern `content/900-ai/prompts/` in the prisma/docs repository.

Applied to files:

  • content/800-guides/420-clerk-astro.mdx
📚 Learning: 2025-10-08T16:22:57.129Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:50-66
Timestamp: 2025-10-08T16:22:57.129Z
Learning: In `.mdx` files, do NOT flag or suggest changes for the following code quality issues even if they represent poor practices: React anti-patterns (using var instead of useState, direct DOM manipulation), missing keys in .map() iterations, non-serializable props in getServerSideProps, unused variables, missing error handling, SQL injection vulnerabilities (unless actively showing how to fix them), insecure cookie settings, missing TypeScript types, PrismaClient instantiation patterns, or any other code quality, security, or performance issues. Documentation code snippets are copied from source code and often intentionally show "before" examples or common mistakes.

Applied to files:

  • content/800-guides/420-clerk-astro.mdx
📚 Learning: 2025-10-14T11:41:08.844Z
Learnt from: carlagn
Repo: prisma/docs PR: 7183
File: content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/050-database-glossary.mdx:561-567
Timestamp: 2025-10-14T11:41:08.844Z
Learning: Ignore the file `content/200-orm/800-more/600-help-and-troubleshooting/050-dataguide/050-database-glossary.mdx` in future reviews as per user request. Issues in this file were addressed in PR #7185.

Applied to files:

  • content/800-guides/420-clerk-astro.mdx
📚 Learning: 2025-10-08T16:24:58.382Z
Learnt from: aidankmcalister
Repo: prisma/docs PR: 7165
File: content/800-guides/550-test-guide.mdx:168-176
Timestamp: 2025-10-08T16:24:58.382Z
Learning: When a review suggestion is marked as resolved but the suggested change was NOT implemented, do not re-suggest the same change in future reviews or commits. A resolved comment indicates the maintainer has intentionally decided not to implement the suggestion.

Applied to files:

  • content/800-guides/420-clerk-astro.mdx
🪛 LanguageTool
content/800-guides/420-clerk-astro.mdx

[uncategorized] ~55-~55: The official name of this software platform is spelled with a capital “H”.
Context: .... :::info For this guide, the Google, Github, and Email sign in options will be used...

(GITHUB)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Check internal links
  • GitHub Check: Cloudflare Pages

@aidankmcalister aidankmcalister merged commit b2961f8 into main Nov 24, 2025
8 of 9 checks passed
@aidankmcalister aidankmcalister deleted the DC-5239-astro-clerk-guide branch November 24, 2025 16:42
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.

3 participants