Skip to content

Conversation

jog1t
Copy link
Contributor

@jog1t jog1t commented Oct 1, 2025

TL;DR

Conditionally initialize Clerk authentication based on app type

What changed?

Modified the auth.ts file to only initialize the Clerk authentication client when the application is running in cloud mode. When not in cloud mode, the clerk variable is set to null (cast as Clerk type).

How to test?

  1. Verify that authentication works correctly in cloud environments
  2. Confirm that the application doesn't attempt to initialize Clerk in non-cloud environments
  3. Check that no authentication errors occur in either environment

Why make this change?

This change prevents unnecessary Clerk initialization in non-cloud environments where authentication might be handled differently or not needed. This improves efficiency and prevents potential errors from attempting to use Clerk with invalid or missing credentials in development or other non-cloud contexts.

Copy link

vercel bot commented Oct 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
rivet-cloud Ready Ready Preview Comment Oct 1, 2025 5:13pm
rivet-inspector Ready Ready Preview Comment Oct 1, 2025 5:13pm
rivet-site Ready Ready Preview Comment Oct 1, 2025 5:13pm

@jog1t jog1t requested a review from NathanFlurry October 1, 2025 17:06
Copy link
Contributor Author

jog1t commented Oct 1, 2025


How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

claude bot commented Oct 1, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

Copy link

pkg-pr-new bot commented Oct 1, 2025

Open in StackBlitz

npm i https://pkg.pr.new/rivet-dev/engine/@rivetkit/engine-runner@3028
npm i https://pkg.pr.new/rivet-dev/engine/@rivetkit/engine-runner-protocol@3028

commit: f432ebf

Copy link
Contributor

graphite-app bot commented Oct 1, 2025

Graphite Automations

"Test" took an action on this PR • (10/01/25)

1 assignee was added to this PR based on Kacper Wojciechowski's automation.

Copy link
Contributor

graphite-app bot commented Oct 1, 2025

Merge activity

  • Oct 1, 5:17 PM UTC: jog1t added this pull request to the Graphite merge queue.
  • Oct 1, 5:18 PM UTC: CI is running for this pull request on a draft pull request (#3029) due to your merge queue CI optimization settings.
  • Oct 1, 5:18 PM UTC: Merged by the Graphite merge queue via draft PR: #3029.

graphite-app bot pushed a commit that referenced this pull request Oct 1, 2025
### TL;DR

Conditionally initialize Clerk authentication based on app type

### What changed?

Modified the `auth.ts` file to only initialize the Clerk authentication client when the application is running in cloud mode. When not in cloud mode, the clerk variable is set to null (cast as Clerk type).

### How to test?

1. Verify that authentication works correctly in cloud environments
2. Confirm that the application doesn't attempt to initialize Clerk in non-cloud environments
3. Check that no authentication errors occur in either environment

### Why make this change?

This change prevents unnecessary Clerk initialization in non-cloud environments where authentication might be handled differently or not needed. This improves efficiency and prevents potential errors from attempting to use Clerk with invalid or missing credentials in development or other non-cloud contexts.
@graphite-app graphite-app bot closed this Oct 1, 2025
@graphite-app graphite-app bot deleted the 10-01-fix_init_clerk_only_on_cloud branch October 1, 2025 17:18
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