Repository navigation
feat(claim-db-worker): pass the CLI's command tag on to sign-in - #98
Merged
Merged
Conversation
The claim button always sent utm_source=create-db-frontend, so a signup from a claimed database could not be credited to the command that made it. The claim page now sends its own utm_source, utm_medium and utm_content to /api/auth/url, and the route keeps only known values: create-db, create-pg, create-postgres (and the two existing web tags), cli or claim_button, and the four output modes. A free-text tag from --user-agent or the env file's PRISMA_ACTOR_NAME/PRISMA_ACTOR_PROJECT becomes create-db, so no value from a user's environment reaches the signup. A page without tags keeps the old create-db-frontend / claim_button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
✅ Preview CLIs & Workers are live! Test the CLIs locally under tag npx create-db@pr98
npx create-pg@pr98
npx create-postgres@pr98Worker URLs
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
claim-db-worker | adc1927 | Commit Preview URL Branch Preview URL |
Nov 26 2026, 11:02 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
create-db-worker | adc1927 | Commit Preview URL Branch Preview URL |
Nov 26 2026, 11:00 AM |
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
The claim button now passes the CLI's tag on to sign-in, so a signup that started with
npx create-db(orcreate-pg,create-postgres) is credited to that command instead of the genericcreate-db-frontendclaim button.app/claim/page.tsx: the button's request to/api/auth/urlincludes the page's ownutm_source,utm_mediumandutm_content, which the CLI put on the claim URL.lib/claim-campaign.ts(new):claimCampaign()keeps known values only:utm_source:create-db,create-pg,create-postgres, plus the two existing web tagscreate-db-frontendandcreate_db_web;utm_medium:cliorclaim_button;utm_content: the CLI output modesdefault,json,env,quiet.app/api/auth/url/route.ts: uses those tags on theauth.prisma.io/authorizeURL instead of the hard-coded pair.Privacy
The CLI's
utm_sourceon the claim URL is the hidden--user-agentflag when it is set, elsePRISMA_ACTOR_NAME/PRISMA_ACTOR_PROJECTfrom the user's env file, else the command name. The first two are free text and can name a person or a project. They are never passed on:utm_sourcebecomescreate-db(the mediumcliis kept);create-db-frontend/claim_button;What changes in the data
New claim signups show
create-db,create-pgorcreate-postgresas theirutm_source,clias their medium and the output mode asutm_content, where they used to showcreate-db-frontend/claim_button. A series built onutm_source = create-db-frontendneeds to include the command names from the deploy date. The signup is still recognisable as a developer-tool signup byutm_medium(cliorclaim_button).Testing
vitest runinapps/claim-db-worker: 24 pass, including 11 new: the route passescreate-pg/cli/jsonthrough, replaces aJane Doe/acme-secret-apptag withcreate-dband never puts it on the URL, keeps the old pair for a page without tags;claimCampaign()normalises case and whitespace and drops unknown mediums and content; the claim page sends its tags in the request body.tsc --noEmitpasses.Needs a human review before merge.
🤖 Generated with Claude Code