Repository navigation
feat(create-helpbase): login-first scaffolder (funnel capture) - #13
Conversation
Moves the login prompt from after-source-selection to step 1, right after project-name validation. Fires on every cold scaffold regardless of source kind — previously gated on `source.kind !== "skip"`, which meant Skip users (picking sample content) walked through the whole scaffolder without ever being asked to claim a subdomain. 100% funnel leak on that path. Reframed the prompt copy as a perk, not a gate: was: "Log in to helpbase free? (500k tokens/day, no card — 30s browser flow)" now: "Claim your free docs URL? (docs-<hex>.helpbase.dev + 500k AI tokens/day, no card)" Leading with the concrete subdomain URL converts better than the abstract "sign in" ask — founders told us as much during the first cold dogfood of 0.4.0 this morning. Other changes: - BYOK users (ANTHROPIC_API_KEY / OPENAI_API_KEY / AI_GATEWAY_API_KEY) no longer skip the prompt. Subdomain reservation is orthogonal to AI creds; BYOK users benefit from a reserved deploy target. - HELPBASE_TOKEN env var skips the prompt (CI users pre-issue tokens). - Declined-login users see `npx helpbase login` as the first line of the end-of-scaffold "What next" block so the path to a subdomain stays visible. Logged-in users don't see the redundant hint. create-helpbase 0.4.0 → 0.5.0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 46 minutes and 30 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe create-helpbase CLI authentication flow is restructured: login prompting moves earlier (before source selection), the prompt copy refocuses on claiming a free docs URL, and BYOK users are no longer exempted from auth prompts. Post-scaffold messaging conditionally includes login instructions based on auth state. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/create-helpbase/src/index.ts`:
- Around line 428-429: Refresh the auth state immediately before computing
loggedIn for the "What next" render: instead of relying on the in-memory
authToken, re-read the persisted token from disk (the same function used
elsewhere to load/write the saved auth token that the ship-it-now/login path
uses) and use that fresh value when computing loggedIn (i.e., compute loggedIn =
!!freshDiskToken || !!process.env.HELPBASE_TOKEN?.trim()). Update the code
around the existing authToken / HELPBASE_TOKEN usage so the UI reflects a user
who logged in via the ship-it-now path.
- Around line 193-198: authToken is only read from disk via
readHelpbaseAuthToken(), so when HELPBASE_TOKEN is set the prompt is skipped but
the token isn't passed into generation functions and loggedIn is computed
incorrectly; fix by initializing authToken to prefer
process.env.HELPBASE_TOKEN?.trim() fallback to readHelpbaseAuthToken(), ensure
runRepoGeneration(...) and runUrlGeneration(...) are invoked with that resolved
authToken (and modify runUrlGeneration to accept a token parameter instead of
re-reading disk), and recompute the loggedIn state after any fallback login so
it reflects the final auth token value (referencing readHelpbaseAuthToken,
process.env.HELPBASE_TOKEN, runRepoGeneration, runUrlGeneration, and loggedIn).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b8837e93-2490-4d12-a856-e8d8ec8081eb
📒 Files selected for processing (3)
CHANGELOG.mdpackages/create-helpbase/package.jsonpackages/create-helpbase/src/index.ts
…h state Two CodeRabbit findings on PR #13: CR#1 (Major): `authToken` was initialized only from ~/.helpbase/auth.json via readHelpbaseAuthToken(). When a CI user set `HELPBASE_TOKEN`, the step-1 login prompt was correctly skipped, but the env token never reached `generateArticlesFromContent` / `generateFromRepo` — AI gen failed MissingApiKey and the scaffolder silently fell back to sample content. Now: initialize with disk-OR-env, and thread the resolved token through `runUrlGeneration` (which was re-reading disk) and `runRepoGeneration` (already accepted it). CR#2 (Minor): the "What next" block computed `loggedIn` from the in-memory `authToken` variable, which stays undefined if the user declined step-1 but logged in later via the ship-it-now subprocess (that path writes the token file but doesn't mutate the outer variable). Now re-read disk when computing `loggedIn` so the redundant "run helpbase login" hint doesn't show to users who just logged in. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Closes the Skip-path funnel leak caught in the 2026-04-19 cold-start dogfood: users who picked Skip walked through the whole scaffolder without ever being asked to claim a subdomain — no email captured, no retargeting hook, no reserved
docs-<hex>.helpbase.dev.Change: move the login prompt from after-source-selection to step 1 (right after project-name validation). Fires on every cold scaffold. Reframe copy to lead with the concrete subdomain URL.
create-helpbase 0.4.0 → 0.5.0.
UX before (0.4.0)
UX after (0.5.0)
Other changes bundled
ANTHROPIC_API_KEY/OPENAI_API_KEY/AI_GATEWAY_API_KEY.HELPBASE_TOKENenv var skips the prompt silently. CI users pre-issue tokens; no point making them browser-flow.npx helpbase loginas the first line with a clear subdomain-claim hint; logged-in users skip the redundant line.Test plan
pnpm -F create-helpbase typecheck— greenpnpm -F create-helpbase test— 47 tests greenpnpm typecheck(monorepo) — 5/5 greennode scripts/sync-templates.mjs— no driftnpx helpbase loginhintexpect): "Claim your free docs URL?" fires as the FIRST prompt before source selection--deploy)🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes - v0.5.0