Skip to content

feat(app): point dev/preview at any website via NEXT_PUBLIC_SCREENPIPE_WEB_URL#3867

Merged
louis030195 merged 1 commit into
mainfrom
claude/dev-web-url-override
Jun 5, 2026
Merged

feat(app): point dev/preview at any website via NEXT_PUBLIC_SCREENPIPE_WEB_URL#3867
louis030195 merged 1 commit into
mainfrom
claude/dev-web-url-override

Conversation

@louis030195

Copy link
Copy Markdown
Collaborator

What

Lets bun tauri dev drive 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.

# against a #238 preview (already has prod Clerk/Supabase/Stripe — zero local setup):
NEXT_PUBLIC_SCREENPIPE_WEB_URL=https://<your-238-preview>.vercel.app \
NEXT_PUBLIC_SCREENPIPE_FORCE_BILLING_GATE=true \
bun tauri dev

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"]
Loading

Changes

  • lib/web-url.tsscreenpipeWebUrl(path, fallbackHost) helper, reads NEXT_PUBLIC_SCREENPIPE_WEB_URL.
  • 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).

Notes

  • The native "sign in" window still opens prod login. That's fine against a preview (shared Clerk). A fully-local website would also need that redirected (Rust open_login_window), out of scope here.
  • Only the pricing/auth path is rerouted; the other ~330 prod URLs are unchanged.

Validation

  • tsc --noEmit clean, next lint clean, 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

…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>
@louis030195 louis030195 merged commit 6743e22 into main Jun 5, 2026
15 of 18 checks passed
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.

1 participant