feat(app): point dev/preview at any website via NEXT_PUBLIC_SCREENPIPE_WEB_URL#3867
Merged
Conversation
…E_WEB_URL So `bun tauri dev` can drive the auth + entitlement flow against a Vercel preview or a local website, without touching prod or any other URL. Unset = production behavior (defaults preserved). - lib/web-url.ts: screenpipeWebUrl(path, fallbackHost) helper - loadUser -> /api/user, auth-guard -> /login, gate PRICING_URL -> /onboarding now route through it - NEXT_PUBLIC_SCREENPIPE_FORCE_BILLING_GATE=true forces the gate visible in dev (dev otherwise bypasses it via NODE_ENV) The native login window still opens prod login, which is fine against a preview (shared Clerk); a fully-local website would also need that redirected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Lets
bun tauri devdrive the auth + entitlement flow against a Vercel preview or a local website, so you can test the pricing gate without prod data or local key setup. Unset env = production behavior, so prod is untouched.Flow
flowchart LR A["bun tauri dev"] --> B{"NEXT_PUBLIC_SCREENPIPE_WEB_URL set?"} B -->|yes| P["preview / localhost:3000<br/>(/api/user, /onboarding)"] B -->|no| Q["prod screenpi.pe / screenpipe.com"] A -. "FORCE_BILLING_GATE=true" .-> G["gate visible in dev"]Changes
lib/web-url.ts—screenpipeWebUrl(path, fallbackHost)helper, readsNEXT_PUBLIC_SCREENPIPE_WEB_URL.loadUser→/api/user,auth-guard→/login, gatePRICING_URL→/onboardingnow route through it.NEXT_PUBLIC_SCREENPIPE_FORCE_BILLING_GATE=trueforces the gate visible in dev (dev otherwise bypasses it viaNODE_ENV).Notes
open_login_window), out of scope here.Validation
tsc --noEmitclean,next lintclean, vitest 15/15 (entitlement logic + gate component).You can pull the branch and run it now without merging:
git fetch origin claude/dev-web-url-override && git checkout claude/dev-web-url-override🤖 Generated with Claude Code