App shell / Sign-in seam
Sign-in seam
Working demo sign-in with server-verified sessions, ready to swap for the auth pack you choose.
Included with Boost OS
Complete payment, authentication, database, and mobile app systems your agent adapts to your web or mobile app. Inspect every module and file purpose before you buy.
19 of 19 collected. Every drop is included with the one-time $199 Boost OS Plus license.
Search every module and file across the collection, or filter by vendor and module.
App shell / Sign-in seam
Working demo sign-in with server-verified sessions, ready to swap for the auth pack you choose.
App shell / Agent payments
Agent-initiated payments arrive with a payments pack and write plan changes through the same seam.
App shell / Telemetry seam
An event catalog and error reporting with log-only defaults; GA4, PostHog, or Sentry plug in later.
App shell / Customer portal
Hosted billing management arrives with your payments pack and links from the dashboard once wired.
App shell / Refunds
Revocations flow through the same plan-write seam that grants use, so refunds never need shell changes.
App shell / Events
Provider events arrive with the packs you install; the shell keeps one clean mount pattern for them.
App shell / Account state
Account records with plan, provisioning, and welcome state, kept behind the one storage adapter.
App shell / Paid access seam
Reads the stored plan and gives payments packs one write method for grants and revocations.
App shell / Email seam
A neutral sending contract with a log-only default; Resend or Mailgun plug in when you want real delivery.
App shell / Verify
A live setup report that names what is wired, what still runs on defaults, and the file to open next.
App shell / Shared library
Validated settings, shared types, page metadata helpers, and the single storage adapter behind every module.
App shell / Setup
The canonical stack declaration, a setup script that prepares local settings, and the choose-your-stack guide.
Stripe / Checkout
Creates one-time and recurring Checkout sessions with trusted customer and product details.
Stripe / Agentic commerce
Accepts agent-initiated payments with scoped Shared Payment Tokens and resumes flows that need buyer action.
Stripe / Usage billing
Reports AI token or request usage to Stripe meters so customers pay for what they use.
Stripe / Customer portal
Opens hosted sessions where customers manage plans, payment methods, and cancellations.
Stripe / Refunds and disputes
Issues refunds, revokes the access they paid for, and records disputes for review.
Stripe / Webhooks
Verifies signed Stripe events and routes each delivery once.
Stripe / Subscriptions
Keeps billing changes, cancellations, and customer access aligned with Stripe.
Stripe / Fulfillment
Turns confirmed payments into access without duplicate orders or grants.
Stripe / Emails
Sends payment and subscription messages when customers need confirmation.
Stripe / Verify
Checks the full payment path and easy-to-miss event cases before launch.
Stripe / Shared library
Centralizes typed Stripe setup and payment helpers across every route.
Stripe / Setup
Maps required Stripe settings and integration points into your app.
Firebase / Authentication
Connects browser sign-in to server-verified sessions so protected pages do not rely on a browser check alone.
Firebase / Agent payments
Pairs Firebase account and access data with Stripe's agent-payment flow for scoped machine purchases.
Firebase / Usage billing
Records product usage in Firebase and reports billable totals to a connected payment provider.
Firebase / Billing portal
Connects signed-in Firebase accounts to hosted plan, payment method, and cancellation controls.
Firebase / Refunds and disputes
Keeps refunded purchases, access revocation, and dispute records aligned with Firebase account data.
Firebase / Events
Handles Firebase and connected-service events with validation, clear routing, and repeat-safe processing.
Firebase / Account state
Keeps user status, roles, and access changes consistent across authentication and stored app data.
Firebase / Background work
Runs trusted follow-up work after account or data changes without repeating the same action.
Firebase / Emails
Covers account, security, and activity messages that need to match the customer's current state.
Firebase / Verify
Checks authentication, data rules, and protected operations before users depend on them.
Firebase / Shared library
Keeps Firebase clients, admin access, and typed data helpers in one consistent layer.
Firebase / Setup
Maps Firebase project settings, local configuration, rules, and app integration points.
Supabase / Authentication
Connects browser sign-in, server sessions, and protected routes without trusting browser state alone.
Supabase / Agent payments
Pairs Supabase account and access data with Stripe's agent-payment flow for scoped machine purchases.
Supabase / Usage billing
Stores product usage in Supabase and reports billable totals to a connected payment provider.
Supabase / Billing portal
Connects signed-in Supabase accounts to hosted plan, payment method, and cancellation controls.
Supabase / Refunds and disputes
Keeps refunded purchases, access revocation, and dispute records aligned with Supabase account data.
Supabase / Events
Receives database and connected-service events, validates them, and routes trusted work safely.
Supabase / Account state
Keeps profiles, roles, memberships, and access changes aligned with authenticated users.
Supabase / Background work
Runs follow-up database and service work with repeat-safe handling for retries.
Supabase / Emails
Sends account and activity messages based on trusted data from your server.
Supabase / Verify
Checks authentication, row-level security, and trusted server operations before launch.
Supabase / Shared library
Centralizes browser and server Supabase clients with typed helpers for consistent data access.
Supabase / Setup
Maps project settings, local configuration, database rules, and the connection points in your app.
Clerk / Authentication
Connects browser sign-in to server-verified sessions so private routes do not trust browser state alone.
Clerk / Agent access
Gives approved AI workers limited access tied to a real Clerk user or organization.
Clerk / Usage tracking
Records product usage against Clerk users and organizations for billing or limits.
Clerk / Account management
Lets signed-in customers manage their profile, security settings, and organization membership.
Clerk / Access reversal
Removes paid access after refunds while preserving the customer's Clerk account and history.
Clerk / User events
Verifies Clerk webhooks and routes user, session, and organization changes once.
Clerk / Organizations and roles
Keeps memberships, roles, and app permissions aligned with Clerk organization data.
Clerk / User data linking
Connects Clerk user IDs to app records without creating duplicate customer data.
Clerk / Account emails
Coordinates account and security messages with the customer's current Clerk state.
Clerk / Verify
Checks sign-in, protected routes, webhooks, and role rules before customers rely on them.
Clerk / Shared library
Centralizes Clerk clients, session checks, and typed identity helpers across the app.
Clerk / Setup
Maps Clerk keys, middleware, redirect URLs, and application settings into your Next.js app.
Cloudflare / Worker routes
Handles trusted requests in Cloudflare Workers with clear inputs, responses, and error paths.
Cloudflare / Agent routes
Gives approved AI workers limited edge endpoints for reading data and taking actions.
Cloudflare / Rate limits
Counts requests and blocks repeated traffic before it overwhelms paid services or stored data.
Cloudflare / Customer access
Connects signed-in customers to their D1 records and R2 files through trusted routes.
Cloudflare / Data reversal
Reverses access or stored state after a refund without deleting needed account history.
Cloudflare / Edge webhooks
Verifies signed webhook requests at the edge and processes repeat deliveries safely.
Cloudflare / Account state
Keeps customer status and feature access aligned in D1 across edge requests.
Cloudflare / Background work
Moves follow-up work out of customer requests and prevents the same job from running twice.
Cloudflare / Service messages
Sends customer messages after trusted Worker actions and records the result.
Cloudflare / Deploy verification
Checks routes, bindings, D1 access, R2 access, and signed events after deployment.
Cloudflare / D1 and R2
Centralizes typed database queries, file storage helpers, and Cloudflare bindings.
Cloudflare / Deployment setup
Maps Worker settings, environment bindings, migrations, routes, and deployment commands.
Vercel / Server routes
Shapes trusted Next.js routes for Vercel with clear runtime and timeout choices.
Vercel / Agent endpoints
Protects hosted endpoints that let approved AI workers read data or take actions.
Vercel / Rate limits
Limits repeated requests in middleware before they consume paid services or server time.
Vercel / Protected pages
Gates customer pages in middleware and confirms access again on the server.
Vercel / Access changes
Keeps hosted customer access aligned when paid features are removed or refunded.
Vercel / Scheduled jobs
Runs Vercel cron routes on schedule with authorization and repeat-safe processing.
Vercel / Environment state
Keeps preview and production configuration separate while requiring the same critical values.
Vercel / Caching
Caches public work deliberately without leaking private responses between customers.
Vercel / Deploy messages
Sends customer or team messages after trusted hosted jobs complete or fail.
Vercel / Verify route
Checks environment values, protected routes, cron authorization, and deployed service health.
Vercel / Shared hosting library
Centralizes environment validation, caching rules, and request helpers for Vercel.
Vercel / Domains and setup
Maps project settings, custom domains, environment values, and deployment checks.
OpenAI / Model requests
Sends OpenAI requests from the server with trusted model settings and customer context.
OpenAI / Tool calling
Lets models choose approved app actions while your server validates every input and result.
OpenAI / Usage billing
Records token usage and sends billable totals to the Stripe pack without double counting.
OpenAI / Customer limits
Shows customers their AI usage and enforces the limits tied to their account.
OpenAI / Usage corrections
Corrects failed or refunded AI usage records without erasing the original request history.
OpenAI / Response events
Routes completed background responses and connected service events with repeat-safe handling.
OpenAI / Model access
Keeps model choices, feature limits, and account access aligned with the customer's plan.
OpenAI / Streaming
Streams model output to the browser while handling disconnects and completed responses safely.
OpenAI / AI job messages
Notifies customers when longer AI work completes, fails, or needs their attention.
OpenAI / Verify
Checks streaming, tool permissions, output shapes, retries, and spending caps before launch.
OpenAI / OpenAI library
Centralizes the OpenAI client, model settings, output checks, and retry rules.
OpenAI / Setup
Maps API keys, approved models, spending limits, and app integration points.
Claude / Messages API
Sends Claude requests from the server with trusted model settings and customer context.
Claude / Agent loops
Runs controlled tool-use steps until the work completes or reaches a firm stopping rule.
Claude / Usage metering
Records input, output, and cached tokens for customer limits and connected billing.
Claude / Worker controls
Lets customers see usage, pause work, and manage limits for their Claude worker.
Claude / Usage corrections
Corrects failed or refunded Claude usage while preserving the original work history.
Claude / Worker events
Receives triggers for always-on work and processes repeat deliveries safely.
Claude / Model access
Keeps model choices, worker limits, and account access aligned with the customer's plan.
Claude / Streaming
Streams Claude output while saving completed messages and handling browser disconnects.
Claude / Worker messages
Notifies customers when Claude finishes work, reaches a limit, or needs a decision.
Claude / Verify
Checks tool permissions, loop limits, caching, streaming, and spending caps before launch.
Claude / Claude library
Centralizes the Anthropic client, tool definitions, model settings, and prompt cache rules.
Claude / Setup
Maps API keys, approved models, tool permissions, spending caps, and worker settings.
Gemini / Model requests
Sends Gemini requests from the server with trusted model settings and customer context.
Gemini / Function calling
Lets Gemini choose approved app functions while your server validates every input and result.
Gemini / Usage metering
Records model usage for customer limits, spending caps, and connected billing.
Gemini / Customer limits
Shows customers their Gemini usage and enforces the limits tied to their account.
Gemini / Usage corrections
Corrects failed or refunded Gemini usage without erasing the original request history.
Gemini / Response events
Routes completed background responses and connected service events without duplicate work.
Gemini / Model access
Keeps model choices, media features, and account limits aligned with the customer's plan.
Gemini / Multimodal input
Accepts images, video, and audio with file checks before sending them to Gemini.
Gemini / AI job messages
Notifies customers when longer Gemini work completes, fails, or needs attention.
Gemini / Verify
Checks streaming, functions, media inputs, usage records, and spending caps before launch.
Gemini / Gemini library
Centralizes the Gemini client, model settings, media helpers, and response checks.
Gemini / Setup
Maps API keys, approved models, media limits, spending caps, and app integration points.
MCP / Server connection
Accepts MCP connections through a clear server route with trusted request handling.
MCP / Tools and schemas
Defines approved tools and the exact input shapes each chat agent must send.
MCP / Tool usage
Records tool calls against customers for limits, reviews, and connected billing.
MCP / Connection management
Lets customers review and revoke the chat agents connected to their account.
MCP / Access reversal
Revokes paid tool access while preserving records of earlier agent actions.
MCP / App events
Turns trusted app events into updates that connected chat agents can use.
MCP / Tool permissions
Keeps available tools and action limits aligned with each customer's access.
MCP / App actions
Connects approved MCP tools to real app data and actions without exposing internal code.
MCP / Connection messages
Notifies customers about new connections, sensitive actions, and revoked access.
MCP / Verify
Checks authentication, tool inputs, permissions, actions, and deployed connections.
MCP / MCP library
Centralizes server setup, tool definitions, authentication, and response helpers.
MCP / Deploy and setup
Maps server settings, public URLs, authentication values, and client connection steps.
GA4 / Purchase events
Sends trusted GA4 purchase events with stable order, product, and revenue details.
GA4 / Agent attribution
Records when an approved AI agent starts or assists a customer action.
GA4 / Funnel checkpoints
Tracks the consistent steps customers take from first visit through paid use.
GA4 / Customer activity
Measures account and billing actions without sending private customer details.
GA4 / Refund events
Sends server-side refund events that reverse the matching recorded revenue.
GA4 / Server events
Turns trusted payment and app events into GA4 records without duplicate counts.
GA4 / Lifecycle events
Tracks trial, activation, upgrade, cancellation, and return checkpoints consistently.
GA4 / Attribution
Carries campaign details from the first click to the final trusted sale.
GA4 / Campaign links
Builds consistent campaign links for customer emails without leaking private data.
GA4 / Event verification
Checks event names, required values, consent, and delivery before reports are trusted.
GA4 / Analytics library
Centralizes event names, safe properties, attribution values, and server delivery helpers.
GA4 / Client tag and consent
Maps the GA4 tag, consent choices, environment values, and Next.js page tracking.
Resend / Receipt emails
Sends trusted purchase receipts with stable order details after payment is confirmed.
Resend / Agent messages
Lets approved AI workers send limited customer emails through the same provider rules.
Resend / Send limits
Tracks email volume against account limits and prevents accidental sending loops.
Resend / Email preferences
Lets customers manage allowed message types while preserving required account notices.
Resend / Refund emails
Sends clear refund confirmations tied to the original purchase and customer.
Resend / Delivery events
Verifies Resend webhooks and records delivered, bounced, and complained-about messages once.
Resend / Contact lists
Keeps customer contact state and allowed messages aligned without duplicate records.
Resend / Send queue
Runs follow-up email work after trusted app events without sending the same message twice.
Resend / Templates
Builds reusable account, receipt, and activity emails with consistent content and data.
Resend / Verify
Checks sender identity, templates, delivery events, and failure paths before launch.
Resend / Email provider
Centralizes the Resend client behind a provider contract your app can replace later.
Resend / Domain setup
Maps API keys, sender addresses, domain records, and webhook values into your app.
Mailgun / Receipt emails
Sends trusted purchase receipts through Mailgun after payment is confirmed.
Mailgun / Agent messages
Lets approved AI workers send limited customer emails through the same provider rules.
Mailgun / Send limits
Tracks Mailgun volume against account limits and prevents accidental sending loops.
Mailgun / Email preferences
Lets customers manage allowed message types while preserving required account notices.
Mailgun / Refund emails
Sends refund confirmations tied to the original purchase and customer record.
Mailgun / Delivery webhooks
Verifies Mailgun events and records deliveries, bounces, and complaints once.
Mailgun / Mailing lists
Keeps list membership and allowed messages aligned without duplicate customer records.
Mailgun / Send queue
Runs follow-up email work after trusted app events without sending duplicates.
Mailgun / Messages API
Builds and sends reusable account, receipt, and activity messages through Mailgun.
Mailgun / Verify
Checks domains, templates, event signatures, and failure paths before launch.
Mailgun / Email provider
Centralizes the Mailgun client behind a provider contract your app can replace later.
Mailgun / Domain verification
Maps API keys, sending domains, DNS records, and webhook settings into your app.
Sentry / Route errors
Captures failed customer requests with enough safe context to reproduce the problem.
Sentry / AI error context
Records failed AI work and tool steps without sending private prompts or customer data.
Sentry / Error volume
Measures repeated failures so one noisy error does not hide a wider customer problem.
Sentry / Customer context
Connects errors to the affected account without exposing private customer details.
Sentry / Payment failures
Captures refund and payment errors with the order context needed to resolve them.
Sentry / Alert routing
Routes urgent Sentry alerts to the right person or service with clear ownership.
Sentry / Noise control
Filters expected failures and groups repeat errors so real customer problems stand out.
Sentry / Fix loop
Connects an error to reproduction, repair, deployment, and proof that the fix worked.
Sentry / Error messages
Sends useful internal alerts and customer follow-ups without exposing sensitive details.
Sentry / Verify
Triggers safe test errors and confirms browser, server, alerts, and releases are connected.
Sentry / Monitoring library
Centralizes safe context, ignored errors, tags, and Sentry capture helpers.
Sentry / Source maps and releases
Maps Sentry keys, source map uploads, release tags, and Next.js configuration.
PostHog / Conversion events
Captures trusted checkout and purchase checkpoints without sending private payment details.
PostHog / AI feature events
Measures approved AI actions and results without recording private prompts or outputs.
PostHog / Product usage
Records the actions that show whether customers reach the product's intended outcome.
PostHog / Account context
Links useful account properties to events without exposing private customer data.
PostHog / Revenue reversals
Records refunds against the original purchase so revenue funnels stay accurate.
PostHog / Server events
Captures trusted app and payment events on the server without duplicate records.
PostHog / Feature flags
Rolls features out by account while keeping browser and server decisions aligned.
PostHog / Funnels
Connects consistent product checkpoints into funnels that reveal where customers stop.
PostHog / Campaign events
Measures useful email actions with safe campaign details and consistent names.
PostHog / Event verification
Checks event names, allowed details, flags, and delivery before reports are trusted.
PostHog / Analytics library
Centralizes approved events, safe properties, customer context, and capture helpers.
PostHog / Session setup
Maps PostHog keys, browser loading, server capture, session context, and privacy choices.
Expo / App store releases
Moves signed builds through TestFlight, App Store, and Play Store release steps.
Expo / AI app features
Connects approved AI features to trusted mobile screens, account data, and server routes.
Expo / Build and update pipelines
Tracks cloud builds and over-the-air updates across development, preview, and production.
Expo / Account screens
Shapes profile and account screens around trusted sessions and stored customer data.
Expo / Update rollbacks
Reverts a bad over-the-air update by moving installed apps back to a known release.
Expo / Build status hooks
Receives build and submission status changes without processing the same result twice.
Expo / Release channels
Keeps development, preview, and production updates on separate release paths.
Expo / Over-the-air updates
Sends JavaScript fixes to installed apps while keeping native changes in store releases.
Expo / Push notifications
Sends account and activity messages to registered devices with clear permission checks.
Expo / Release checks
Checks app settings, signing, builds, update channels, and store requirements before release.
Expo / Mobile library
Centralizes secure storage, session handling, device details, and Expo service helpers.
Expo / EAS and app setup
Maps EAS projects, app identifiers, signing, release channels, and environment values.
RevenueCat / Purchases
Starts subscriptions and one-time purchases through the native iOS and Android store sheets.
RevenueCat / Server-driven paywalls
Changes products, layouts, and A/B tests from RevenueCat without another app review.
RevenueCat / Subscription status
Reads current purchase and renewal state without relying on stale device data.
RevenueCat / Customer center
Lets customers review purchases, manage subscriptions, and find billing help inside the app.
RevenueCat / Refunds and grace periods
Handles refunded purchases and temporary billing issues without removing access too early.
RevenueCat / Purchase webhooks
Receives trusted purchase lifecycle events and processes repeat deliveries once.
RevenueCat / Subscription lifecycle
Keeps trials, renewals, cancellations, expirations, and product changes aligned.
RevenueCat / Entitlement access
Turns active entitlements into app access tied to the correct customer record.
RevenueCat / Billing notifications
Sends useful messages for renewals, billing issues, refunds, and expired access.
RevenueCat / Receipt validation
Confirms store receipts and customer identity before paid app access changes.
RevenueCat / Purchases library
Centralizes RevenueCat clients, customer identity, products, purchases, and entitlement checks.
RevenueCat / Store and SDK setup
Maps App Store, Play Store, RevenueCat, product, and mobile SDK settings.
Whop / Embedded checkout
Places Whop checkout inside a product page or sends customers through a trusted checkout link.
Whop / Whop apps
Connects approved agent-driven sales and Whop app actions to trusted account checks.
Whop / Plans and pricing
Reads current product, plan, and pricing data before showing a purchase option.
Whop / Member portal
Lets signed-in members review products, access, purchases, and account details.
Whop / Refunds and disputes
Records refunds and disputes while keeping paid access aligned with the purchase.
Whop / Purchase webhooks
Verifies Whop purchase events and processes repeat deliveries without duplicate work.
Whop / Memberships
Keeps active, canceled, expired, and changed memberships aligned with app access.
Whop / Access unlocks
Turns a confirmed purchase into product access tied to the correct app account.
Whop / Purchase emails
Sends purchase, membership, refund, and access messages when customers need them.
Whop / License validation
Checks active memberships and licenses on the server before granting product access.
Whop / Whop client library
Centralizes the Whop client, member identity, checkout, and access helpers.
Whop / API keys and app setup
Maps Whop API keys, app settings, webhook values, products, and account connections.
src/checkout/demo-session.ts
App shell / Checkout
Signs and verifies the temporary session cookie used while the app has no auth provider.
TypeScript
84 lines
src/checkout/ensure-provisioned.ts
App shell / Checkout
Creates the app account on first sign-in and attempts its one welcome message.
TypeScript
30 lines
src/checkout/PROVIDERS.md
App shell / Checkout
The auth seam is `getSessionUser` plus `SESSION_PROVIDER` in `session-user.ts`.
Markdown
20 lines
src/checkout/require-user.ts
App shell / Checkout
Redirects signed-out visitors before a protected server page does any work.
TypeScript
16 lines
src/checkout/session-user.ts
App shell / Checkout
Turns the active server-verified session into the user shape every page reads.
TypeScript
33 lines
src/checkout/signin-route.ts
App shell / Checkout
Handles the temporary name-only sign-in form used before an auth pack is wired.
TypeScript
42 lines
src/checkout/signout-route.ts
App shell / Checkout
Signs out the demo user by expiring the temporary session cookie.
TypeScript
13 lines
src/emails/console-provider.ts
App shell / Emails
Prints an email to the server terminal instead of sending it to a real address.
TypeScript
10 lines
src/emails/PROVIDERS.md
App shell / Emails
The email seam is `sendAppEmail` in `send-email.ts`.
Markdown
16 lines
src/emails/send-email.ts
App shell / Emails
Sends every app email through one provider-neutral entry point.
TypeScript
22 lines
src/emails/welcome-email.ts
App shell / Emails
Builds the plain welcome message sent after an account is first provisioned.
TypeScript
18 lines
src/fulfillment/access.ts
App shell / Fulfillment
Reads the stored account plan to decide whether a signed-in user has paid access.
TypeScript
11 lines
src/fulfillment/PROVIDERS.md
App shell / Fulfillment
| Provider | Install command | What it gives you | | --- | --- | --- | | Stripe | `npx -y boostmyagent starter stripe` | Checkout, payment events, access grants, and refunds.
Markdown
16 lines
src/lib/app-adapter.ts
App shell / Shared plumbing
The seam between this shell and your application's own storage.
TypeScript
93 lines
src/lib/demo-store.ts
App shell / Shared plumbing
In-memory account storage so the shell runs before any database exists.
TypeScript
53 lines
src/lib/env.ts
App shell / Shared plumbing
Reads and validates the settings your app needs at startup, in one place.
TypeScript
56 lines
src/lib/seo.ts
App shell / Shared plumbing
Builds consistent page details for search engines and shared links.
TypeScript
43 lines
src/lib/types.ts
App shell / Shared plumbing
Shared types for the app shell: who is signed in and what their account holds.
TypeScript
31 lines
.env.example
App shell / Setup and docs
Configuration required by this starter pack.
Config
12 lines
ADAPT.md
App shell / Setup and docs
Give these instructions to the coding agent working in the buyer's project.
Markdown
155 lines
AGENTS.md
App shell / Setup and docs
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data.
Markdown
9 lines
app/api/session/signin/route.ts
App shell / Setup and docs
Mounts the demo sign-in handler at its public app address.
TypeScript
8 lines
app/api/session/signout/route.ts
App shell / Setup and docs
Mounts the demo sign-out handler at its public app address.
TypeScript
8 lines
app/api/verify/route.ts
App shell / Setup and docs
Mounts the live setup report at its public app address.
TypeScript
9 lines
app/dashboard/page.tsx
App shell / Setup and docs
Shows the signed-in account and the paid-access seam.
TypeScript
81 lines
app/globals.css
App shell / Setup and docs
Configuration required by this starter pack.
CSS
365 lines
app/layout.tsx
App shell / Setup and docs
Provides the shared page frame, navigation, and search details.
TypeScript
39 lines
app/not-found.tsx
App shell / Setup and docs
Gives missing pages a useful way back to the app.
TypeScript
14 lines
app/page.tsx
App shell / Setup and docs
Introduces the runnable app shell, its live stack state, and every pack that plugs in.
TypeScript
108 lines
app/robots.ts
App shell / Setup and docs
Tells search engines which public pages they may visit.
TypeScript
17 lines
app/signin/page.tsx
App shell / Setup and docs
Shows the demo sign-in form or points to the active auth provider.
TypeScript
47 lines
app/sitemap.ts
App shell / Setup and docs
Lists the public pages that search engines should discover.
TypeScript
15 lines
app/tilt-card.tsx
App shell / Setup and docs
Gives a card pointer-tracked tilt and glare, with zero dependencies.
TypeScript
63 lines
CLAUDE.md
App shell / Setup and docs
Configuration required by this starter pack.
Markdown
1 lines
next-env.d.ts
App shell / Setup and docs
/ <reference types="next" />
TypeScript
7 lines
OPERATIONS.md
App shell / Setup and docs
1.
Markdown
48 lines
package.json
App shell / Setup and docs
Configuration required by this starter pack.
JSON
25 lines
README.md
App shell / Setup and docs
This starter is a complete runnable application frame that works the moment it is installed.
Markdown
61 lines
src/setup/check-setup.ts
App shell / Setup and docs
Prepares local settings and reports which app providers are ready.
TypeScript
141 lines
src/setup/stack-config.ts
App shell / Setup and docs
The canonical stack declaration: one trusted record of which provider owns
TypeScript
60 lines
src/setup/stack-options.ts
App shell / Setup and docs
The catalog of everything that can plug into this shell, with live state:
TypeScript
133 lines
src/setup/STACK.md
App shell / Setup and docs
Each concern has license-included choices.
Markdown
69 lines
starter.json
App shell / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
App shell / Setup and docs
**Sign in returns to the sign-in page**
Markdown
55 lines
tsconfig.json
App shell / Setup and docs
Configuration required by this starter pack.
JSON
41 lines
src/usage/PROVIDERS.md
App shell / Usage billing
Analytics flows through `trackEvent` in `track-event.ts`.
Markdown
17 lines
src/usage/report-error.ts
App shell / Usage billing
Reports app failures without letting the reporting path break the app.
TypeScript
20 lines
src/usage/track-event.ts
App shell / Usage billing
Keeps product analytics behind one event catalog and one forwarding function.
TypeScript
25 lines
src/verify/verify-route.ts
App shell / Verify your setup
Serves setup check results three ways: a styled page for browsers, plain
TypeScript
141 lines
src/verify/verify-setup.ts
App shell / Verify your setup
Runs the ordered setup checks that explain what is ready and what needs attention.
TypeScript
111 lines
src/agentic/accept-agent-payment.ts
Stripe / Agentic commerce
Creates and confirms a scoped agent payment with a Shared Payment Token.
TypeScript
253 lines
src/agentic/MACHINE_PAYMENTS.md
Stripe / Agentic commerce
The seller-side payment code in this module can also charge an agent for API access.
Markdown
36 lines
src/agentic/spt-webhooks.ts
Stripe / Agentic commerce
Routes Shared Payment Token state changes to buyer action and payment resumption handlers.
TypeScript
140 lines
src/checkout/create-session-route.ts
Stripe / Checkout
Creates a Stripe-hosted Checkout Session for one trusted catalog product.
TypeScript
74 lines
src/checkout/create-usage-session-route.ts
Stripe / Checkout
Creates a Stripe-hosted Checkout Session that subscribes a customer to the metered price.
TypeScript
47 lines
src/checkout/SUCCESS_CANCEL.md
Stripe / Checkout
Create `/checkout/success` and `/checkout/cancel` in your Next.js app.
Markdown
9 lines
src/emails/configured-provider.ts
Stripe / Emails
Selects the transactional email provider named in the environment.
TypeScript
23 lines
src/emails/console-provider.ts
Stripe / Emails
Development email provider: prints the receipt to the server terminal instead of sending it.
TypeScript
18 lines
src/emails/mailgun-provider.ts
Stripe / Emails
Implements transactional email delivery with Mailgun's HTTP API.
TypeScript
40 lines
src/emails/purchase-receipt.ts
Stripe / Emails
Emails a plain receipt and access note after one-time fulfillment succeeds.
TypeScript
43 lines
src/emails/send-email.ts
Stripe / Emails
Sends one transactional email through a provider supplied by your app.
TypeScript
22 lines
src/fulfillment/grant-access.ts
Stripe / Fulfillment
Grants one-time purchase access through the app-owned billing adapter.
TypeScript
41 lines
src/lib/app-adapter.ts
Stripe / Shared plumbing
Connects generic Stripe handlers to your app's database and access rules.
TypeScript
190 lines
src/lib/env.ts
Stripe / Shared plumbing
Reads payment and email settings from the environment and rejects missing values.
TypeScript
126 lines
src/lib/stripe-client.ts
Stripe / Shared plumbing
Creates the Stripe client and verifies webhook signatures for Node or edge runtimes.
TypeScript
38 lines
src/lib/types.ts
Stripe / Shared plumbing
Defines the app-owned storage operations that payment handlers need.
TypeScript
118 lines
src/portal/create-portal-session.ts
Stripe / Customer portal
Creates a Stripe Billing Portal session for a signed-in app account.
TypeScript
34 lines
src/portal/portal-configuration.ts
Stripe / Customer portal
Creates an optional Billing Portal configuration with common self-service features.
TypeScript
36 lines
src/products/one-time-product.ts
Stripe / Products
The trusted catalog of one-time products this starter sells.
TypeScript
86 lines
src/products/usage-product.ts
Stripe / Products
The trusted definition of this starter's metered usage billing, in a single place.
TypeScript
29 lines
src/refunds/issue-refund.ts
Stripe / Refunds and disputes
Issues a full or partial refund and revokes the access granted by that payment.
TypeScript
68 lines
src/refunds/refund-webhooks.ts
Stripe / Refunds and disputes
Handles refunded charges and new disputes without coupling Stripe to your database.
TypeScript
124 lines
.env.example
Stripe / Setup and docs
Configuration required by this starter pack.
Config
47 lines
ADAPT.md
Stripe / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
140 lines
app/api/stripe/checkout/route.ts
Stripe / Setup and docs
POST /api/stripe/checkout starts a Stripe-hosted Checkout Session for the one-time product.
TypeScript
5 lines
app/api/stripe/usage-checkout/route.ts
Stripe / Setup and docs
POST /api/stripe/usage-checkout subscribes a customer to the metered usage price.
TypeScript
5 lines
app/api/stripe/verify/route.ts
Stripe / Setup and docs
GET /api/stripe/verify reports missing settings and confirms a test-mode Stripe connection.
TypeScript
5 lines
app/api/stripe/webhook/route.ts
Stripe / Setup and docs
POST /api/stripe/webhook is the only path that grants access after payment.
TypeScript
5 lines
app/buy/route.ts
Stripe / Setup and docs
A working purchase page: shows every catalog product with a Buy button that starts checkout.
TypeScript
56 lines
app/checkout/cancel/route.ts
Stripe / Setup and docs
Browser return page when a buyer leaves Stripe Checkout without paying.
TypeScript
20 lines
app/checkout/success/route.ts
Stripe / Setup and docs
Browser return page after Stripe redirects a buyer back from a completed payment.
TypeScript
29 lines
OPERATIONS.md
Stripe / Setup and docs
The code handles the machines.
Markdown
19 lines
package.json
Stripe / Setup and docs
Configuration required by this starter pack.
JSON
18 lines
README.md
Stripe / Setup and docs
This starter gives a Next.js App Router application a secure Stripe Checkout flow, signed webhook handling, one-time fulfillment, subscription lifecycle helpers, transactional email, and a readable verification route.
Markdown
99 lines
src/setup/create-one-time-product.ts
Stripe / Setup and docs
One-off setup script: creates every catalog product and price in Stripe test mode.
TypeScript
102 lines
src/setup/create-usage-meter.ts
Stripe / Setup and docs
One-off setup script: creates the usage billing meter and metered monthly price in Stripe
TypeScript
115 lines
starter.json
Stripe / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Stripe / Setup and docs
Find your symptom, apply the fix.
Markdown
39 lines
tsconfig.json
Stripe / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/subscriptions/activate-on-first-payment.ts
Stripe / Subscriptions
Activates recurring access only after Stripe reports a successful paid invoice.
TypeScript
49 lines
src/subscriptions/handle-cancellation.ts
Stripe / Subscriptions
Ends recurring access when Stripe confirms the current subscription was deleted.
TypeScript
30 lines
src/subscriptions/invoice-details.ts
Stripe / Subscriptions
Extracts subscription and customer IDs from Stripe invoices across API shapes.
TypeScript
39 lines
src/subscriptions/sync-status.ts
Stripe / Subscriptions
Converts a Stripe subscription into the status record your app stores.
TypeScript
49 lines
src/usage/metered-price-setup.md
Stripe / Usage billing
Use this module when a customer pays for measured work such as AI tokens, generated images, minutes, or API requests.
Markdown
17 lines
src/usage/record-billable-usage.ts
Stripe / Usage billing
Records one unit of billable work for a signed-in account: claims it in app storage,
TypeScript
65 lines
src/usage/report-usage.ts
Stripe / Usage billing
Reports AI token or request usage to a Stripe billing meter.
TypeScript
56 lines
src/verify/route.ts
Stripe / Verify your setup
Reports missing settings, the Stripe connection, the email provider, and storage readiness.
TypeScript
166 lines
src/webhooks/handlers/charge-dispute-created.ts
Stripe / Webhook handlers
Records a new charge dispute and immediately suspends the related paid access.
TypeScript
41 lines
src/webhooks/handlers/checkout-session-completed.ts
Stripe / Webhook handlers
Validates a completed one-time Checkout Session before granting access.
TypeScript
75 lines
src/webhooks/handlers/customer-subscription-created.ts
Stripe / Webhook handlers
Stores a new Stripe subscription without granting paid access early.
TypeScript
13 lines
src/webhooks/handlers/customer-subscription-deleted.ts
Stripe / Webhook handlers
Removes recurring access after Stripe deletes the customer's current subscription.
TypeScript
13 lines
src/webhooks/handlers/customer-subscription-updated.ts
Stripe / Webhook handlers
Synchronizes plan, status, and scheduled cancellation changes from Stripe.
TypeScript
13 lines
src/webhooks/handlers/invoice-payment-action-required.ts
Stripe / Webhook handlers
Records when a subscription payment needs customer authentication.
TypeScript
24 lines
src/webhooks/handlers/invoice-payment-failed.ts
Stripe / Webhook handlers
Records a failed subscription invoice and Stripe's next retry time.
TypeScript
26 lines
src/webhooks/handlers/invoice-payment-succeeded.ts
Stripe / Webhook handlers
Records a paid invoice and activates recurring access after a positive payment.
TypeScript
11 lines
src/webhooks/handlers/payment-intent-payment-failed.ts
Stripe / Webhook handlers
Records a failed standalone PaymentIntent without granting or removing access.
TypeScript
31 lines
src/webhooks/route.ts
Stripe / Webhook handlers
Verifies Stripe webhook signatures and routes each event to its handler.
TypeScript
148 lines
src/checkout/account-model.ts
Firebase / Checkout
The trusted definition of this app's account model: roles, collections, and project checks.
TypeScript
67 lines
src/checkout/current-session.ts
Firebase / Checkout
Verifies the server session cookie used by every protected page and route.
TypeScript
58 lines
src/checkout/session-login-route.ts
Firebase / Checkout
Exchanges a verified Firebase ID token for a secure server session cookie.
TypeScript
75 lines
src/checkout/session-logout-route.ts
Firebase / Checkout
Clears the Firebase session cookie and returns the user to the sign-in page.
TypeScript
35 lines
src/emails/configured-provider.ts
Firebase / Emails
Selects the transactional email provider named in the environment.
TypeScript
18 lines
src/emails/console-provider.ts
Firebase / Emails
Development email provider: prints account emails to the server terminal.
TypeScript
16 lines
src/emails/security-alert-email.ts
Firebase / Emails
Alerts the app operator after a Firebase account is suspended.
TypeScript
33 lines
src/emails/send-email.ts
Firebase / Emails
Sends one account email through a provider supplied by your app.
TypeScript
22 lines
src/emails/welcome-email.ts
Firebase / Emails
Sends the welcome message for a newly provisioned Firebase account.
TypeScript
33 lines
src/fulfillment/example-followup-job.ts
Firebase / Fulfillment
An example follow-up job; copy this file to create your own background work.
TypeScript
27 lines
src/fulfillment/run-job-once.ts
Firebase / Fulfillment
Runs background work once for each durable job ID, even when the caller retries.
TypeScript
27 lines
src/lib/app-adapter.ts
Firebase / Shared plumbing
Connects generic Firebase handlers to your app's own records and access rules.
TypeScript
138 lines
src/lib/env.ts
Firebase / Shared plumbing
Reads Firebase and session settings from the environment and rejects missing values.
TypeScript
97 lines
src/lib/firebase-admin.ts
Firebase / Shared plumbing
Creates the server-side Firebase Admin clients from validated environment settings.
TypeScript
40 lines
src/lib/types.ts
Firebase / Shared plumbing
Defines the app-owned storage operations that authentication handlers need.
TypeScript
40 lines
.env.example
Firebase / Setup and docs
Configuration required by this starter pack.
Config
42 lines
ADAPT.md
Firebase / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
110 lines
app/account/route.ts
Firebase / Setup and docs
A working protected page; the server, not the browser, decided this user may see it.
TypeScript
63 lines
app/api/firebase/verify/route.ts
Firebase / Setup and docs
GET /api/firebase/verify reports missing settings and checks the Firebase connection.
TypeScript
10 lines
app/api/session/login/route.ts
Firebase / Setup and docs
POST /api/session/login exchanges a Firebase ID token for a secure session cookie.
TypeScript
10 lines
app/api/session/logout/route.ts
Firebase / Setup and docs
POST /api/session/logout clears the Firebase session cookie and returns to sign-in.
TypeScript
10 lines
app/signin/route.ts
Firebase / Setup and docs
A working sign-in page; replace it with your app's real page whenever you are ready.
TypeScript
160 lines
firestore.rules
Firebase / Setup and docs
Configuration required by this starter pack.
RULES
35 lines
OPERATIONS.md
Firebase / Setup and docs
The human moments.
Markdown
44 lines
package.json
Firebase / Setup and docs
Configuration required by this starter pack.
JSON
20 lines
README.md
Firebase / Setup and docs
This starter gives a Next.js App Router application server-verified Firebase sign-in, account state and roles kept in sync between Firebase and your own records, repeat-safe auth events, run-once background work, account emails, deny-by-default Firestore security rules with an automated deploy script, and a readable verification route.
Markdown
78 lines
src/setup/deploy-firestore-rules.ts
Firebase / Setup and docs
One-off setup script: deploys firestore.rules to the configured Firebase project.
TypeScript
90 lines
starter.json
Firebase / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Firebase / Setup and docs
Symptom first, fix first, cause second.
Markdown
77 lines
tsconfig.json
Firebase / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/subscriptions/account-status.ts
Firebase / Subscriptions
Keeps account suspension state in sync between Firebase and your app.
TypeScript
21 lines
src/subscriptions/roles.ts
Firebase / Subscriptions
Assigns an allowed app role through Firebase custom claims and records the change.
TypeScript
30 lines
src/verify/route.ts
Firebase / Verify your setup
Reports missing settings, the Firebase connection, account email, rules, and adapter readiness.
TypeScript
218 lines
src/webhooks/auth-events.ts
Firebase / Webhook handlers
Runs authentication event work once while keeping failed work available for retry.
TypeScript
27 lines
src/webhooks/handlers/account-deleted.ts
Firebase / Webhook handlers
Deletes one Firebase user and repeat-safely removes that account's app data.
TypeScript
33 lines
src/webhooks/handlers/first-sign-in.ts
Firebase / Webhook handlers
Provisions an app profile and sends one welcome email after the first sign-in.
TypeScript
21 lines
src/checkout/account-model.ts
Supabase / Checkout
The trusted definition of this app's account model: roles, tables, and configuration checks.
TypeScript
69 lines
src/checkout/auth-callback-route.ts
Supabase / Checkout
Exchanges a Supabase PKCE callback code for session cookies and provisions the account.
TypeScript
68 lines
src/checkout/current-session.ts
Supabase / Checkout
Verifies the Supabase user used by every protected page and route.
TypeScript
84 lines
src/checkout/ensure-provisioned.ts
Supabase / Checkout
Ensures a verified Supabase account has exactly one app profile.
TypeScript
24 lines
src/checkout/session-logout-route.ts
Supabase / Checkout
Clears this browser's Supabase session and returns the user to sign-in.
TypeScript
26 lines
src/emails/configured-provider.ts
Supabase / Emails
Selects the transactional email provider named in the environment.
TypeScript
18 lines
src/emails/console-provider.ts
Supabase / Emails
Development email provider: prints account emails to the server terminal.
TypeScript
16 lines
src/emails/security-alert-email.ts
Supabase / Emails
Alerts the app operator after a Supabase account is suspended.
TypeScript
33 lines
src/emails/send-email.ts
Supabase / Emails
Sends one account email through a provider supplied by your app.
TypeScript
22 lines
src/emails/welcome-email.ts
Supabase / Emails
Sends the welcome message for a newly provisioned Supabase account.
TypeScript
33 lines
src/fulfillment/example-followup-job.ts
Supabase / Fulfillment
An example follow-up job; copy this file to create your own background work.
TypeScript
27 lines
src/fulfillment/run-job-once.ts
Supabase / Fulfillment
Runs background work once for each durable job ID, even when the caller retries.
TypeScript
27 lines
src/lib/app-adapter.ts
Supabase / Shared plumbing
Connects generic Supabase handlers to your app's own records and access rules.
TypeScript
153 lines
src/lib/env.ts
Supabase / Shared plumbing
Reads Supabase and app settings from the environment and rejects missing values.
TypeScript
97 lines
src/lib/supabase-server.ts
Supabase / Shared plumbing
Provides the two server-side Supabase clients: an admin client and a per-request client.
TypeScript
60 lines
src/lib/types.ts
Supabase / Shared plumbing
Defines the app-owned storage operations that authentication handlers need.
TypeScript
45 lines
.env.example
Supabase / Setup and docs
Configuration required by this starter pack.
Config
34 lines
ADAPT.md
Supabase / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
100 lines
app/account/route.ts
Supabase / Setup and docs
A working protected page; Supabase Auth, not the browser, decides who may see it.
TypeScript
117 lines
app/api/auth/callback/route.ts
Supabase / Setup and docs
GET /api/auth/callback exchanges Supabase OAuth and email-link codes for a session.
TypeScript
10 lines
app/api/session/logout/route.ts
Supabase / Setup and docs
POST /api/session/logout clears this browser's Supabase session and returns to sign-in.
TypeScript
10 lines
app/api/supabase/verify/route.ts
Supabase / Setup and docs
GET /api/supabase/verify reports whether the Supabase starter is configured.
TypeScript
10 lines
app/signin/route.ts
Supabase / Setup and docs
A working Supabase sign-in page; replace it with your app's real page when ready.
TypeScript
185 lines
migrations/0001_init.sql
Supabase / Setup and docs
Configuration required by this starter pack.
SQL
46 lines
OPERATIONS.md
Supabase / Setup and docs
The human moments.
Markdown
50 lines
package.json
Supabase / Setup and docs
Configuration required by this starter pack.
JSON
22 lines
README.md
Supabase / Setup and docs
This starter gives a Next.js App Router application browser sign-in backed by server-verified Supabase cookie sessions, account state and roles kept in sync between Supabase and your own records, repeat-safe auth events, run-once background work, account emails, deny-by-default Row Level Security with an automated schema deploy script, and a readable verification route.
Markdown
94 lines
src/setup/deploy-schema.ts
Supabase / Setup and docs
Applies every migrations/*.sql file in name order and records each completed migration.
TypeScript
97 lines
starter.json
Supabase / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Supabase / Setup and docs
Symptom first, fix first, cause second.
Markdown
75 lines
tsconfig.json
Supabase / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/subscriptions/account-status.ts
Supabase / Subscriptions
Keeps account suspension state in sync between Supabase and your app.
TypeScript
36 lines
src/subscriptions/roles.ts
Supabase / Subscriptions
Assigns an allowed app role through Supabase app_metadata and records the change.
TypeScript
39 lines
src/verify/route.ts
Supabase / Verify your setup
Reports missing settings, Supabase connectivity, database schema, email, and adapter readiness.
TypeScript
194 lines
src/webhooks/auth-events.ts
Supabase / Webhook handlers
Runs authentication event work once while keeping failed work available for retry.
TypeScript
29 lines
src/webhooks/handlers/account-deleted.ts
Supabase / Webhook handlers
Deletes one Supabase user and repeat-safely removes that account's app data.
TypeScript
33 lines
src/webhooks/handlers/first-sign-in.ts
Supabase / Webhook handlers
Provisions an app profile and sends one welcome email after the first sign-in.
TypeScript
25 lines
src/checkout/account-model.ts
Clerk / Checkout
The trusted definition of this app's account model: roles and configuration checks.
TypeScript
59 lines
src/checkout/current-session.ts
Clerk / Checkout
Verifies the Clerk session used by every protected page and route.
TypeScript
73 lines
src/checkout/ensure-provisioned.ts
Clerk / Checkout
Ensures a verified Clerk account has exactly one app profile.
TypeScript
48 lines
src/checkout/session-logout-route.ts
Clerk / Checkout
Revokes the current Clerk session and returns the user to sign-in.
TypeScript
26 lines
src/emails/configured-provider.ts
Clerk / Emails
Selects the transactional email provider named in the environment.
TypeScript
18 lines
src/emails/console-provider.ts
Clerk / Emails
Development email provider: prints account emails to the server terminal.
TypeScript
16 lines
src/emails/security-alert-email.ts
Clerk / Emails
Alerts the app operator after an account is suspended.
TypeScript
33 lines
src/emails/send-email.ts
Clerk / Emails
Sends one account email through a provider supplied by your app.
TypeScript
22 lines
src/emails/welcome-email.ts
Clerk / Emails
Sends the welcome message for a newly provisioned account.
TypeScript
34 lines
src/fulfillment/example-followup-job.ts
Clerk / Fulfillment
An example follow-up job; copy this file to create your own background work.
TypeScript
27 lines
src/fulfillment/run-job-once.ts
Clerk / Fulfillment
Runs background work once for each durable job ID, even when the caller retries.
TypeScript
27 lines
src/lib/app-adapter.ts
Clerk / Shared plumbing
The seam between this starter and your application's own storage.
TypeScript
158 lines
src/lib/clerk-server.ts
Clerk / Shared plumbing
Provides the server-side Clerk client used by every protected route and handler.
TypeScript
19 lines
src/lib/env.ts
Clerk / Shared plumbing
Reads and validates every environment setting this starter uses.
TypeScript
74 lines
src/lib/types.ts
Clerk / Shared plumbing
Defines the app-owned storage operations that authentication handlers need.
TypeScript
40 lines
.env.example
Clerk / Setup and docs
Configuration required by this starter pack.
Config
27 lines
ADAPT.md
Clerk / Setup and docs
Give these instructions to the coding agent working in the buyer's project.
Markdown
108 lines
app/account/route.ts
Clerk / Setup and docs
A working protected page; Clerk, not the browser, decides who may see it.
TypeScript
105 lines
app/api/clerk/verify/route.ts
Clerk / Setup and docs
GET /api/clerk/verify reports whether the Clerk starter is configured.
TypeScript
10 lines
app/api/clerk/webhook/route.ts
Clerk / Setup and docs
POST /api/clerk/webhook verifies and processes Clerk webhook deliveries.
TypeScript
10 lines
app/api/session/logout/route.ts
Clerk / Setup and docs
POST /api/session/logout revokes this browser's Clerk session and returns to sign-in.
TypeScript
10 lines
app/signin/route.ts
Clerk / Setup and docs
Loads Clerk's zero-dependency sign-in surface for a working starter page.
TypeScript
71 lines
OPERATIONS.md
Clerk / Setup and docs
The human moments.
Markdown
49 lines
package.json
Clerk / Setup and docs
Configuration required by this starter pack.
JSON
18 lines
README.md
Clerk / Setup and docs
This starter gives an application Clerk-hosted browser sign-in backed by server-verified sessions, account state and roles kept in sync between Clerk and your own records, repeat-safe webhook processing, run-once background work, app emails, and a readable verification route.
Markdown
93 lines
starter.json
Clerk / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Clerk / Setup and docs
Symptom first, fix first, cause second.
Markdown
56 lines
tsconfig.json
Clerk / Setup and docs
Configuration required by this starter pack.
JSON
17 lines
src/subscriptions/account-status.ts
Clerk / Subscriptions
Keeps account suspension state in sync between Clerk and your app.
TypeScript
27 lines
src/subscriptions/roles.ts
Clerk / Subscriptions
Assigns an allowed app role through Clerk publicMetadata and records the change.
TypeScript
30 lines
src/verify/route.ts
Clerk / Verify your setup
Reports missing settings, Clerk connectivity, webhook, email, and adapter readiness.
TypeScript
221 lines
src/webhooks/auth-events.ts
Clerk / Webhook handlers
Runs Clerk authentication event work once while keeping failed work available for retry.
TypeScript
27 lines
src/webhooks/handlers/user-created.ts
Clerk / Webhook handlers
Provisions an app profile from Clerk's verified user.created webhook payload.
TypeScript
55 lines
src/webhooks/handlers/user-deleted.ts
Clerk / Webhook handlers
Removes app data after Clerk verifies a user.deleted webhook event.
TypeScript
11 lines
src/webhooks/route.ts
Clerk / Webhook handlers
Verifies and dispatches Clerk webhook deliveries through the shared event claim.
TypeScript
67 lines
src/agentic/agent-route.ts
Cloudflare / Agentic commerce
Gives approved AI agents narrow read and create actions through separate bearer tokens.
TypeScript
115 lines
src/checkout/create-record-route.ts
Cloudflare / Checkout
Creates one authenticated customer's D1 record through a trusted Worker route.
TypeScript
57 lines
src/checkout/list-records-route.ts
Cloudflare / Checkout
Lists D1 records owned by the authenticated customer.
TypeScript
18 lines
src/emails/service-messages.ts
Cloudflare / Emails
Sends neutral service messages with a zero-signup console default.
TypeScript
44 lines
src/fulfillment/background-jobs.ts
Cloudflare / Fulfillment
Claims repeat-safe background work and runs it through the Worker lifecycle.
TypeScript
43 lines
src/lib/app-adapter.ts
Cloudflare / Shared plumbing
Connects generic Cloudflare handlers to your app's identity and domain reactions.
TypeScript
88 lines
src/lib/bindings.ts
Cloudflare / Shared plumbing
Centralizes access to Cloudflare bindings for every route and storage helper.
TypeScript
44 lines
src/lib/d1.ts
Cloudflare / Shared plumbing
Implements typed, parameterized D1 queries over the shipped migration.
TypeScript
360 lines
src/lib/demo-identity.ts
Cloudflare / Shared plumbing
Provides demo bearer-token identity for the first local end-to-end run.
TypeScript
37 lines
src/lib/env.ts
Cloudflare / Shared plumbing
Reads Worker and setup-script settings and rejects missing or unsafe values.
TypeScript
49 lines
src/lib/r2.ts
Cloudflare / Shared plumbing
Stores and streams customer files through customer-scoped R2 object keys.
TypeScript
69 lines
src/lib/types.ts
Cloudflare / Shared plumbing
Defines the shared records and adapter operations used across the starter.
TypeScript
72 lines
src/portal/customer-file-routes.ts
Cloudflare / Customer portal
Uploads and streams files inside the authenticated customer's R2 prefix.
TypeScript
88 lines
src/refunds/data-reversal.ts
Cloudflare / Refunds and disputes
Revokes the exact access grant created for a stored external reference.
TypeScript
29 lines
.env.example
Cloudflare / Setup and docs
Configuration required by this starter pack.
Config
16 lines
ADAPT.md
Cloudflare / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
119 lines
app/api/edge/agent/route.ts
Cloudflare / Setup and docs
Mounts scoped agent record actions at /api/edge/agent.
TypeScript
5 lines
app/api/edge/files/route.ts
Cloudflare / Setup and docs
Mounts customer-scoped R2 upload and download at /api/edge/files.
TypeScript
5 lines
app/api/edge/records/route.ts
Cloudflare / Setup and docs
Mounts authenticated record creation and listing at /api/edge/records.
TypeScript
6 lines
app/api/edge/verify/route.ts
Cloudflare / Setup and docs
Mounts deployment verification at /api/edge/verify.
TypeScript
5 lines
app/api/edge/webhook/route.ts
Cloudflare / Setup and docs
Mounts the signed webhook receiver at /api/edge/webhook.
TypeScript
5 lines
app/demo/route.ts
Cloudflare / Setup and docs
Serves a dependency-free page for clicking through records and R2 uploads.
TypeScript
113 lines
migrations/0001_init.sql
Cloudflare / Setup and docs
Configuration required by this starter pack.
SQL
86 lines
OPERATIONS.md
Cloudflare / Setup and docs
The code handles normal requests.
Markdown
30 lines
package.json
Cloudflare / Setup and docs
Configuration required by this starter pack.
JSON
22 lines
README.md
Cloudflare / Setup and docs
This starter gives a Next.js App Router application production-ready Worker routes, D1 records, customer-scoped R2 files, two-tier rate limiting, signed webhooks, background work, and deployment verification.
Markdown
89 lines
src/setup/create-bucket.ts
Cloudflare / Setup and docs
Creates every R2 bucket in the canonical deployment catalog.
TypeScript
54 lines
src/setup/create-database.ts
Cloudflare / Setup and docs
Creates the canonical D1 database and applies the starter schema locally.
TypeScript
134 lines
src/setup/create-webhook-secret.ts
Cloudflare / Setup and docs
Generates a strong webhook signing secret without writing it to disk.
TypeScript
18 lines
src/setup/deployment-config.ts
Cloudflare / Setup and docs
Defines the trusted catalog of Cloudflare resources this starter deploys.
TypeScript
66 lines
src/setup/seed-demo-session.ts
Cloudflare / Setup and docs
Seeds one local demo customer and rotates its bearer session token.
TypeScript
71 lines
starter.json
Cloudflare / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Cloudflare / Setup and docs
Find the symptom and apply the fix first.
Markdown
75 lines
tsconfig.json
Cloudflare / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
types/cloudflare-env.d.ts
Cloudflare / Setup and docs
Declares every Cloudflare binding the starter reads at run time.
TypeScript
22 lines
wrangler.toml
Cloudflare / Setup and docs
Configuration required by this starter pack.
TOML
37 lines
src/subscriptions/account-state.ts
Cloudflare / Subscriptions
Keeps customer account status and access grants aligned in D1.
TypeScript
62 lines
src/usage/rate-limit.ts
Cloudflare / Usage billing
Applies two Cloudflare rate-limit windows before expensive route work begins.
TypeScript
43 lines
src/verify/route.ts
Cloudflare / Verify your setup
Reports environment, binding, storage, limiter, adapter, and message readiness.
TypeScript
248 lines
src/webhooks/route.ts
Cloudflare / Webhook handlers
Verifies, claims, and dispatches signed webhook events exactly once.
TypeScript
77 lines
src/webhooks/verify-signature.ts
Cloudflare / Webhook handlers
Verifies timestamped HMAC-SHA256 webhook signatures with Web Crypto.
TypeScript
76 lines
src/agentic/agent-route.ts
Vercel / Agentic commerce
Authorizes one narrow agent action through the application adapter.
TypeScript
41 lines
src/checkout/create-record-route.ts
Vercel / Checkout
Creates a trusted customer record from validated request fields.
TypeScript
56 lines
src/checkout/list-records-route.ts
Vercel / Checkout
Lists only records owned by the authenticated customer.
TypeScript
16 lines
src/emails/service-messages.ts
Vercel / Emails
Sends customer service messages through a console-default provider seam.
TypeScript
41 lines
src/fulfillment/cron-route.ts
Vercel / Fulfillment
Runs the cataloged rollup job after verifying Vercel's cron bearer secret.
TypeScript
28 lines
src/lib/app-adapter.ts
Vercel / Shared plumbing
Connects generic Vercel handlers to your app's identity, durable data, and domain reactions.
TypeScript
110 lines
src/lib/cache.ts
Vercel / Shared plumbing
Builds public CDN responses and private authenticated responses.
TypeScript
44 lines
src/lib/demo-identity.ts
Vercel / Shared plumbing
Resolves the local demo customer from a bearer token created by seed:demo.
TypeScript
26 lines
src/lib/demo-store.ts
Vercel / Shared plumbing
Provides local demo records, claims, usage, and account state through globalThis.
TypeScript
82 lines
src/lib/env.ts
Vercel / Shared plumbing
Reads and validates the settings used by handlers and setup checks.
TypeScript
71 lines
src/lib/types.ts
Vercel / Shared plumbing
Defines the shared records and adapter operations used across the starter.
TypeScript
55 lines
src/lib/verify-signature.ts
Vercel / Shared plumbing
Verifies a raw webhook body against the hexadecimal x-signature header.
TypeScript
39 lines
src/portal/account-overview-route.ts
Vercel / Customer portal
Serves the signed-in customer's account overview: status plus their records.
TypeScript
28 lines
src/refunds/data-reversal.ts
Vercel / Refunds and disputes
Reverses customer data or access through an exact stored reference.
TypeScript
22 lines
.env.example
Vercel / Setup and docs
Configuration required by this starter pack.
Config
10 lines
ADAPT.md
Vercel / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
95 lines
app/api/platform/account/route.ts
Vercel / Setup and docs
Mounts the portal module's account overview at /api/platform/account.
TypeScript
4 lines
app/api/platform/agent/route.ts
Vercel / Setup and docs
Mounts the narrow agent authorization handler at /api/platform/agent.
TypeScript
3 lines
app/api/platform/cron/rollup/route.ts
Vercel / Setup and docs
Mounts the secret-verified rollup cron handler at /api/platform/cron/rollup.
TypeScript
3 lines
app/api/platform/records/route.ts
Vercel / Setup and docs
Mounts the trusted checkout record handlers at /api/platform/records.
TypeScript
3 lines
app/api/platform/usage/route.ts
Vercel / Setup and docs
Mounts the repeat-safe usage handler at /api/platform/usage.
TypeScript
3 lines
app/api/platform/verify/route.ts
Vercel / Setup and docs
Mounts deployment checks at /api/platform/verify.
TypeScript
3 lines
app/api/platform/webhook/route.ts
Vercel / Setup and docs
Mounts the signed webhook handler at /api/platform/webhook.
TypeScript
3 lines
app/demo/route.ts
Vercel / Setup and docs
Serves a dependency-free page for testing records, usage, and deployment checks.
TypeScript
101 lines
OPERATIONS.md
Vercel / Setup and docs
The code handles normal requests.
Markdown
74 lines
package.json
Vercel / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
proxy.ts
Vercel / Setup and docs
Replaces the deprecated middleware.ts convention in Next.js 16; a leftover middleware.ts is ignored at build time.
TypeScript
7 lines
README.md
Vercel / Setup and docs
This starter gives a Next.js App Router application secret-verified cron jobs, signed webhooks, trusted customer records, repeat-safe usage metering, CDN caching helpers, environment discipline, and deployment verification on Vercel.
Markdown
105 lines
src/setup/check-vercel-config.ts
Vercel / Setup and docs
Cross-checks the shipped vercel.json, proxy convention, and canonical catalog.
TypeScript
82 lines
src/setup/deployment-config.ts
Vercel / Setup and docs
Defines the canonical cron, environment, and route catalog for this starter.
TypeScript
40 lines
src/setup/seed-demo-session.ts
Vercel / Setup and docs
Generates a local bearer token for the demo identity helper.
TypeScript
18 lines
starter.json
Vercel / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Vercel / Setup and docs
Find the symptom and apply the fix first.
Markdown
75 lines
tsconfig.json
Vercel / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
vercel.json
Vercel / Setup and docs
Configuration required by this starter pack.
JSON
9 lines
src/subscriptions/account-state.ts
Vercel / Subscriptions
Changes a customer's stored account status through the application adapter.
TypeScript
26 lines
src/usage/record-usage-route.ts
Vercel / Usage billing
Records a customer usage amount once under a client-supplied idempotency key.
TypeScript
62 lines
src/verify/route.ts
Vercel / Verify your setup
Reports environment, identity, message, and cron-catalog readiness.
TypeScript
113 lines
src/webhooks/route.ts
Vercel / Webhook handlers
Verifies, claims, and dispatches signed webhook events exactly once.
TypeScript
66 lines
src/agentic/get-order-status-tool.ts
OpenAI / Agentic commerce
Defines the account-scoped order-status tool available to OpenAI responses.
TypeScript
43 lines
src/agentic/run-tool-loop.ts
OpenAI / Agentic commerce
Runs a capped OpenAI function-tool loop and records all step usage once.
TypeScript
176 lines
src/agentic/tool-registry.ts
OpenAI / Agentic commerce
Keeps the only tools OpenAI may request in one explicit application allowlist.
TypeScript
43 lines
src/agentic/tools-route.ts
OpenAI / Agentic commerce
Handles guarded tool-loop requests and maps allowlist failures to safe responses.
TypeScript
102 lines
src/checkout/ask-route.ts
OpenAI / Checkout
Handles guarded ask requests and maps expected failures to plain HTTP responses.
TypeScript
86 lines
src/checkout/create-response.ts
OpenAI / Checkout
Creates one allowance-checked OpenAI response and records its usage exactly once.
TypeScript
109 lines
src/checkout/structured-response.ts
OpenAI / Checkout
Creates a guarded OpenAI response constrained to a caller-supplied JSON schema.
TypeScript
90 lines
src/emails/job-notification.ts
OpenAI / Emails
Sends best-effort status notifications for completed or failed AI jobs.
TypeScript
48 lines
src/emails/send-notification.ts
OpenAI / Emails
Sends a job notification through the console default or a provider supplied by your app.
TypeScript
43 lines
src/fulfillment/stream-response.ts
OpenAI / Fulfillment
Streams a guarded OpenAI response while preserving usage records after disconnects.
TypeScript
163 lines
src/fulfillment/stream-route.ts
OpenAI / Fulfillment
Handles guarded streaming requests and returns the server-sent event response.
TypeScript
82 lines
src/lib/app-adapter.ts
OpenAI / Shared plumbing
Connects generic OpenAI handlers to your app's database, accounts, and limits.
TypeScript
167 lines
src/lib/approved-models.ts
OpenAI / Shared plumbing
The trusted catalog of models this app may call, with per-model limits.
TypeScript
72 lines
src/lib/env.ts
OpenAI / Shared plumbing
Reads OpenAI and notification settings from the environment and rejects missing values.
TypeScript
83 lines
src/lib/openai-client.ts
OpenAI / Shared plumbing
Creates the single server-side OpenAI client the whole starter shares.
TypeScript
22 lines
src/lib/request-account.ts
OpenAI / Shared plumbing
Resolves which app account is making an AI request.
TypeScript
12 lines
src/lib/types.ts
OpenAI / Shared plumbing
Shared types for the OpenAI starter: the adapter contract, usage records, and tool results.
TypeScript
122 lines
src/lib/with-retries.ts
OpenAI / Shared plumbing
Retries an OpenAI call on rate limits and transient server errors, nothing else.
TypeScript
50 lines
src/portal/usage-page-route.ts
OpenAI / Customer portal
Renders a dependency-free usage page for the signed-in app account.
TypeScript
131 lines
src/portal/usage-summary.ts
OpenAI / Customer portal
Builds the signed-in account's allowance, usage totals, and recent request summary.
TypeScript
30 lines
src/refunds/correct-usage.ts
OpenAI / Refunds and disputes
Records an auditable token correction against one exact usage request.
TypeScript
29 lines
.env.example
OpenAI / Setup and docs
Configuration required by this starter pack.
Config
25 lines
ADAPT.md
OpenAI / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
118 lines
app/api/openai/ask/route.ts
OpenAI / Setup and docs
POST /api/openai/ask returns one guarded OpenAI answer.
TypeScript
5 lines
app/api/openai/background/route.ts
OpenAI / Setup and docs
POST /api/openai/background starts a guarded background response.
TypeScript
5 lines
app/api/openai/stream/route.ts
OpenAI / Setup and docs
POST /api/openai/stream returns one guarded OpenAI text stream.
TypeScript
5 lines
app/api/openai/tools/route.ts
OpenAI / Setup and docs
POST /api/openai/tools executes one guarded OpenAI tool loop.
TypeScript
5 lines
app/api/openai/verify/route.ts
OpenAI / Setup and docs
GET /api/openai/verify reports missing settings and confirms OpenAI model access.
TypeScript
5 lines
app/api/openai/webhook/route.ts
OpenAI / Setup and docs
POST /api/openai/webhook receives signed background response events from OpenAI.
TypeScript
5 lines
app/chat/route.ts
OpenAI / Setup and docs
A clickable chat page for trying the guarded OpenAI ask and streaming routes.
TypeScript
127 lines
app/usage/route.ts
OpenAI / Setup and docs
GET /usage is a working usage page for the signed-in account.
TypeScript
5 lines
OPERATIONS.md
OpenAI / Setup and docs
The code handles the machines.
Markdown
29 lines
package.json
OpenAI / Setup and docs
Configuration required by this starter pack.
JSON
17 lines
README.md
OpenAI / Setup and docs
This starter gives a Next.js App Router application a guarded server-side OpenAI integration: model requests with spending checks, streaming, tool calling, structured outputs, usage metering, signed background-response webhooks, and a readable verification route.
Markdown
87 lines
src/setup/check-setup.ts
OpenAI / Setup and docs
Checks OpenAI access, approved models, and optional modules without creating anything.
TypeScript
96 lines
starter.json
OpenAI / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
OpenAI / Setup and docs
Find your symptom, apply the fix.
Markdown
72 lines
tsconfig.json
OpenAI / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/subscriptions/plan-model-access.ts
OpenAI / Subscriptions
Defines the trusted plan catalog and enforces which accounts may use each model.
TypeScript
89 lines
src/usage/billable-rollup.ts
OpenAI / Usage billing
Summarizes raw model usage into account totals that a billing layer can consume.
TypeScript
53 lines
src/usage/record-billable-usage.ts
OpenAI / Usage billing
Claims each OpenAI request once and records its token usage through the app adapter.
TypeScript
69 lines
src/usage/spending-cap.ts
OpenAI / Usage billing
Blocks an OpenAI request when the app account does not have enough allowance.
TypeScript
25 lines
src/verify/route.ts
OpenAI / Verify your setup
Reports OpenAI settings, model access, plan rules, spending guards, and storage readiness.
TypeScript
255 lines
src/webhooks/background-route.ts
OpenAI / Webhook handlers
Accepts a guarded prompt and starts an OpenAI background response.
TypeScript
86 lines
src/webhooks/create-background-response.ts
OpenAI / Webhook handlers
Starts an allowance-checked background response whose completion arrives by webhook.
TypeScript
63 lines
src/webhooks/handlers/response-completed.ts
OpenAI / Webhook handlers
Retrieves a completed background response, records usage, and runs optional follow-up steps.
TypeScript
78 lines
src/webhooks/handlers/response-not-completed.ts
OpenAI / Webhook handlers
Releases a failed background request claim and sends a best-effort status notice.
TypeScript
39 lines
src/webhooks/route.ts
OpenAI / Webhook handlers
Verifies OpenAI webhook signatures and processes each delivery exactly once.
TypeScript
94 lines
src/agentic/get-order-status-tool.ts
Claude / Agentic commerce
Defines the account-scoped order-status tool available to Anthropic messages.
TypeScript
34 lines
src/agentic/run-tool-loop.ts
Claude / Agentic commerce
Runs a capped Anthropic tool loop and records all step usage once.
TypeScript
178 lines
src/agentic/tool-registry.ts
Claude / Agentic commerce
Keeps the only tools Anthropic may request in one explicit application allowlist.
TypeScript
43 lines
src/agentic/tools-route.ts
Claude / Agentic commerce
Handles guarded tool-loop requests and maps allowlist failures to safe responses.
TypeScript
102 lines
src/batches/batch-route.ts
Claude / Batches
Submits guarded Claude batches and polls ended batches for exactly-once processing.
TypeScript
184 lines
src/batches/create-batch.ts
Claude / Batches
Submits allowance-checked Claude Message Batch items with server-minted identities.
TypeScript
115 lines
src/batches/process-batch-results.ts
Claude / Batches
Processes each finished Claude batch item once and records only billable successes.
TypeScript
119 lines
src/caching/prompt-cache.ts
Claude / Caching
Marks the last stable system block as an Anthropic prompt-cache breakpoint.
TypeScript
28 lines
src/checkout/ask-route.ts
Claude / Checkout
Handles guarded ask requests and maps expected failures to plain HTTP responses.
TypeScript
86 lines
src/checkout/create-message.ts
Claude / Checkout
Creates one allowance-checked Anthropic message and records its usage exactly once.
TypeScript
122 lines
src/emails/job-notification.ts
Claude / Emails
Sends best-effort status notifications for completed or failed AI jobs.
TypeScript
48 lines
src/emails/send-notification.ts
Claude / Emails
Sends a job notification through the console default or a provider supplied by your app.
TypeScript
43 lines
src/fulfillment/stream-response.ts
Claude / Fulfillment
Streams a guarded Anthropic message while preserving usage records after disconnects.
TypeScript
258 lines
src/fulfillment/stream-route.ts
Claude / Fulfillment
Handles guarded streaming requests and returns the server-sent event response.
TypeScript
82 lines
src/lib/anthropic-client.ts
Claude / Shared plumbing
Creates the single server-side Anthropic client the whole starter shares.
TypeScript
22 lines
src/lib/app-adapter.ts
Claude / Shared plumbing
Connects generic Claude handlers to your app's database, accounts, and limits.
TypeScript
167 lines
src/lib/approved-models.ts
Claude / Shared plumbing
The trusted catalog of models this app may call, with per-model limits.
TypeScript
79 lines
src/lib/env.ts
Claude / Shared plumbing
Reads Anthropic and notification settings from the environment and rejects missing values.
TypeScript
74 lines
src/lib/request-account.ts
Claude / Shared plumbing
Resolves which app account is making an AI request.
TypeScript
12 lines
src/lib/types.ts
Claude / Shared plumbing
Shared types for the Claude starter: the adapter contract, usage records, and tool results.
TypeScript
132 lines
src/lib/with-retries.ts
Claude / Shared plumbing
Retries an Anthropic call on rate limits and transient server errors, nothing else.
TypeScript
51 lines
src/portal/usage-page-route.ts
Claude / Customer portal
Renders a dependency-free usage page for the signed-in app account.
TypeScript
141 lines
src/portal/usage-summary.ts
Claude / Customer portal
Builds the signed-in account's allowance, usage totals, and recent request summary.
TypeScript
56 lines
src/refunds/correct-usage.ts
Claude / Refunds and disputes
Records an auditable token correction against one exact usage request.
TypeScript
29 lines
.env.example
Claude / Setup and docs
Configuration required by this starter pack.
Config
23 lines
ADAPT.md
Claude / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
133 lines
app/api/claude/ask/route.ts
Claude / Setup and docs
POST /api/claude/ask returns one guarded Anthropic answer.
TypeScript
6 lines
app/api/claude/batch/route.ts
Claude / Setup and docs
POST /api/claude/batch submits a guarded batch; GET polls and processes ended results.
TypeScript
7 lines
app/api/claude/stream/route.ts
Claude / Setup and docs
POST /api/claude/stream returns one guarded Anthropic text stream.
TypeScript
6 lines
app/api/claude/tools/route.ts
Claude / Setup and docs
POST /api/claude/tools executes one guarded Anthropic tool loop.
TypeScript
6 lines
app/api/claude/verify/route.ts
Claude / Setup and docs
GET /api/claude/verify reports missing settings and confirms Anthropic model access.
TypeScript
7 lines
app/chat/route.ts
Claude / Setup and docs
A clickable chat page for trying the guarded Claude ask and streaming routes.
TypeScript
126 lines
app/usage/route.ts
Claude / Setup and docs
GET /usage is a working usage page for the signed-in account.
TypeScript
7 lines
OPERATIONS.md
Claude / Setup and docs
The code handles the machines.
Markdown
38 lines
package.json
Claude / Setup and docs
Configuration required by this starter pack.
JSON
17 lines
README.md
Claude / Setup and docs
This starter gives a Next.js App Router application a guarded server-side Anthropic integration: Claude requests with spending checks, streaming, tool calling, structured outputs, prompt caching, usage metering, asynchronous Message Batches, and a readable verification route.
Markdown
93 lines
src/setup/check-setup.ts
Claude / Setup and docs
Checks Anthropic access, approved models, and optional modules without creating anything.
TypeScript
91 lines
starter.json
Claude / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Claude / Setup and docs
Find your symptom, apply the fix.
Markdown
85 lines
tsconfig.json
Claude / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/structured/structured-response.ts
Claude / Structured
Creates a guarded Anthropic message constrained to a caller-supplied JSON schema.
TypeScript
99 lines
src/subscriptions/plan-model-access.ts
Claude / Subscriptions
Defines the trusted plan catalog and enforces which accounts may use each model.
TypeScript
89 lines
src/usage/billable-rollup.ts
Claude / Usage billing
Summarizes raw model usage into account totals that a billing layer can consume.
TypeScript
57 lines
src/usage/record-billable-usage.ts
Claude / Usage billing
Claims each Anthropic request once and records its full token usage through the app adapter.
TypeScript
80 lines
src/usage/spending-cap.ts
Claude / Usage billing
Blocks an Anthropic request when the app account does not have enough allowance.
TypeScript
25 lines
src/verify/route.ts
Claude / Verify your setup
Reports Anthropic settings, model access, plan rules, spending guards, and storage readiness.
TypeScript
252 lines
src/agentic/get-order-status-tool.ts
Gemini / Agentic commerce
Defines the account-scoped order-status function available to Gemini.
TypeScript
40 lines
src/agentic/run-tool-loop.ts
Gemini / Agentic commerce
Runs a capped Gemini function loop and records all step usage once.
TypeScript
187 lines
src/agentic/tool-registry.ts
Gemini / Agentic commerce
Keeps every executable Gemini function in one explicit application allowlist.
TypeScript
35 lines
src/agentic/tools-route.ts
Gemini / Agentic commerce
Validates Gemini function-loop requests and maps guardrail failures to JSON.
TypeScript
100 lines
src/checkout/ask-route.ts
Gemini / Checkout
Handles guarded ask requests and maps expected failures to plain HTTP responses.
TypeScript
130 lines
src/checkout/generate-answer.ts
Gemini / Checkout
Generates one allowance-checked Gemini answer and records its usage exactly once.
TypeScript
117 lines
src/emails/send-notification.ts
Gemini / Emails
Sends account-scoped job messages through the console default or your provider.
TypeScript
51 lines
src/fallback/with-model-fallback.ts
Gemini / Fallback
Runs a Gemini call across the catalog's fallback chain and both API keys.
TypeScript
81 lines
src/fulfillment/stream-response.ts
Gemini / Fulfillment
Streams one guarded Gemini response while preserving billing after browser disconnects.
TypeScript
194 lines
src/fulfillment/stream-route.ts
Gemini / Fulfillment
Validates guarded streaming requests and maps failures to plain JSON responses.
TypeScript
81 lines
src/lib/app-adapter.ts
Gemini / Shared plumbing
The seam between this starter and YOUR application.
TypeScript
125 lines
src/lib/approved-models.ts
Gemini / Shared plumbing
The trusted list of Gemini models this app may call.
TypeScript
107 lines
src/lib/classify-gemini-error.ts
Gemini / Shared plumbing
Classifies a failed Gemini call so the fallback module can decide what to do.
TypeScript
73 lines
src/lib/env.ts
Gemini / Shared plumbing
Validated environment access.
TypeScript
53 lines
src/lib/gemini-client.ts
Gemini / Shared plumbing
One Gemini client per API key for the whole app.
TypeScript
31 lines
src/lib/request-account.ts
Gemini / Shared plumbing
Resolves which app account is making an AI request.
TypeScript
8 lines
src/lib/types.ts
Gemini / Shared plumbing
Shared types for the Gemini starter: the adapter contract, usage records, and tool results.
TypeScript
124 lines
src/media/build-media-parts.ts
Gemini / Media
Validates inline media and converts it to Gemini request parts.
TypeScript
102 lines
src/portal/usage-summary.ts
Gemini / Customer portal
Builds one account's allowance, Gemini token totals, and recent requests.
TypeScript
61 lines
src/refunds/correct-usage.ts
Gemini / Refunds and disputes
Records an auditable token correction against one exact Gemini request.
TypeScript
28 lines
.env.example
Gemini / Setup and docs
Configuration required by this starter pack.
Config
28 lines
ADAPT.md
Gemini / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
132 lines
app/api/gemini/ask/route.ts
Gemini / Setup and docs
POST /api/gemini/ask returns one guarded Gemini answer.
TypeScript
6 lines
app/api/gemini/stream/route.ts
Gemini / Setup and docs
Mounts the guarded Gemini stream handler in the Next.js App Router.
TypeScript
4 lines
app/api/gemini/structured/route.ts
Gemini / Setup and docs
Mounts the guarded Gemini structured-output handler in the Next.js App Router.
TypeScript
4 lines
app/api/gemini/tools/route.ts
Gemini / Setup and docs
Mounts the guarded Gemini function-loop handler in the Next.js App Router.
TypeScript
4 lines
app/api/gemini/verify/route.ts
Gemini / Setup and docs
GET /api/gemini/verify reports missing settings and validates local Gemini configuration.
TypeScript
5 lines
app/chat/page.tsx
Gemini / Setup and docs
Renders a dependency-free client page for trying the guarded Gemini ask route.
TypeScript
181 lines
app/usage/page.tsx
Gemini / Setup and docs
Renders a server-side usage summary for the current application account.
TypeScript
210 lines
OPERATIONS.md
Gemini / Setup and docs
The code handles the machines.
Markdown
42 lines
package.json
Gemini / Setup and docs
Configuration required by this starter pack.
JSON
17 lines
README.md
Gemini / Setup and docs
This starter gives a Next.js App Router application a guarded server-side Gemini integration: model requests with spending checks, streaming, function calling, structured outputs, multimodal input, a production-mined model and key fallback chain, honest usage metering, and a readable verification route.
Markdown
88 lines
src/setup/check-setup.ts
Gemini / Setup and docs
Checks Gemini environment settings and model fallback chains from the terminal.
TypeScript
111 lines
starter.json
Gemini / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Gemini / Setup and docs
Find your symptom, apply the fix.
Markdown
81 lines
tsconfig.json
Gemini / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/structured/generate-structured.ts
Gemini / Structured
Generates schema-constrained Gemini JSON and records usage before parsing it.
TypeScript
132 lines
src/structured/structured-route.ts
Gemini / Structured
Validates support-triage requests and maps structured-output failures to JSON.
TypeScript
94 lines
src/subscriptions/plan-model-access.ts
Gemini / Subscriptions
Defines trusted plan-to-model access and checks one account before model use.
TypeScript
85 lines
src/usage/billable-rollup.ts
Gemini / Usage billing
Turns raw usage rows into the numbers a billing job or dashboard needs.
TypeScript
68 lines
src/usage/record-billable-usage.ts
Gemini / Usage billing
Claims each Gemini request once and records its full token usage through the app adapter.
TypeScript
77 lines
src/usage/spending-cap.ts
Gemini / Usage billing
Blocks a Gemini request when the app account does not have enough allowance.
TypeScript
25 lines
src/verify/verify-route.ts
Gemini / Verify your setup
Serves Gemini setup checks in the same JSON shape on every request.
TypeScript
12 lines
src/verify/verify-setup.ts
Gemini / Verify your setup
Checks Gemini settings, the model catalog, fallback chains, the connection,
TypeScript
267 lines
src/agentic/action-policy.ts
MCP / Agentic commerce
Applies a deny-by-default policy before an MCP tool performs a destructive action.
TypeScript
28 lines
src/checkout/register-record-tools.ts
MCP / Checkout
Registers create and list tools for customer-owned application records.
TypeScript
91 lines
src/emails/service-messages.ts
MCP / Emails
Sends account service messages through a neutral provider seam.
TypeScript
26 lines
src/fulfillment/register-job-tools.ts
MCP / Fulfillment
Registers background-job start and status tools using opaque durable handles.
TypeScript
88 lines
src/lib/app-adapter.ts
MCP / Shared plumbing
Connects MCP tools to your app's identity, durable data, and domain reactions.
TypeScript
111 lines
src/lib/demo-identity.ts
MCP / Shared plumbing
Resolves the local demo customer from a bearer token created by seed:demo,
TypeScript
42 lines
src/lib/demo-store.ts
MCP / Shared plumbing
Provides development-only records, usage, account state, jobs, and claims.
TypeScript
116 lines
src/lib/env.ts
MCP / Shared plumbing
Reads and validates the settings used by identity, webhooks, and messages.
TypeScript
33 lines
src/lib/server.ts
MCP / Shared plumbing
Builds one fully registered MCP server for stdio or one HTTP request.
TypeScript
62 lines
src/lib/types.ts
MCP / Shared plumbing
Defines the application-owned data that MCP tools read and change.
TypeScript
74 lines
src/portal/register-file-tools.ts
MCP / Customer portal
Registers a read-only tool for customer file metadata.
TypeScript
42 lines
src/refunds/register-reversal-tool.ts
MCP / Refunds and disputes
Registers a guarded destructive tool for reversing one exact stored record.
TypeScript
80 lines
.env.example
MCP / Setup and docs
Configuration required by this starter pack.
Config
8 lines
ADAPT.md
MCP / Setup and docs
Give these instructions to the coding agent working in the buyer's TypeScript project.
Markdown
103 lines
app/api/mcp/route.ts
MCP / Setup and docs
Mounts SDK v2's web-standard MCP handler for hosted applications.
TypeScript
20 lines
app/api/webhooks/route.ts
MCP / Setup and docs
Mounts the app-side signed partner event handler.
TypeScript
8 lines
OPERATIONS.md
MCP / Setup and docs
1.
Markdown
67 lines
package.json
MCP / Setup and docs
Configuration required by this starter pack.
JSON
21 lines
README.md
MCP / Setup and docs
This starter exposes your application's records, file metadata, usage, account state, jobs, and guarded actions to your MCP client over stdio or stateless HTTP.
Markdown
101 lines
src/setup/check-server.ts
MCP / Setup and docs
Checks SDK currency, server construction, registered tools, and required settings.
TypeScript
66 lines
src/setup/run-stdio.ts
MCP / Setup and docs
Starts the MCP server on stdin and stdout for local client connections.
TypeScript
27 lines
src/setup/seed-demo-session.ts
MCP / Setup and docs
Generates local tokens for the demo identity and demo action-approval helpers.
TypeScript
35 lines
starter.json
MCP / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
MCP / Setup and docs
Remove every `console.log` call from code used by the stdio process.
Markdown
57 lines
tsconfig.json
MCP / Setup and docs
Configuration required by this starter pack.
JSON
16 lines
src/subscriptions/register-account-tools.ts
MCP / Subscriptions
Registers the customer account-status reader and the suspended-account gate.
TypeScript
49 lines
src/usage/register-usage-tools.ts
MCP / Usage billing
Registers repeat-safe usage recording for the signed-in customer.
TypeScript
70 lines
src/verify/register-verify-tool.ts
MCP / Verify your setup
Registers a read-only setup report for settings, identity, and runtime currency.
TypeScript
56 lines
src/webhooks/route.ts
MCP / Webhook handlers
Verifies, claims, and applies signed partner events exactly once.
TypeScript
64 lines
src/webhooks/verify-signature.ts
MCP / Webhook handlers
Verifies partner event signatures over the exact raw request body.
TypeScript
22 lines
src/activity/account-activity.ts
GA4 / Activity
Records account behavior without placing identity or personal data in event parameters.
TypeScript
40 lines
src/agentic/agent-attribution.ts
GA4 / Agentic commerce
Records approved AI agent assistance without fingerprinting unknown automated traffic.
TypeScript
46 lines
src/attribution/first-touch.ts
GA4 / Attribution
Captures the first campaign visit and attaches it to an order for later purchase stitching.
TypeScript
52 lines
src/browser/track-browser.ts
GA4 / Browser
Tracks approved browser events through gtag or the consent-aware first-party relay.
TypeScript
58 lines
src/campaigns/campaign-links.ts
GA4 / Campaigns
Builds consistent campaign URLs while rejecting values that look like personal data.
TypeScript
28 lines
src/events/event-catalog.ts
GA4 / Events
Defines every allowed event name, safe parameter, and revenue product in one place.
TypeScript
151 lines
src/funnels/funnel-steps.ts
GA4 / Funnels
Defines the ordered funnel steps used by browser and relay tracking.
TypeScript
25 lines
src/lib/app-adapter.ts
GA4 / Shared plumbing
Connects GA4 event senders to your app's attribution, deduplication, and purchase records.
TypeScript
96 lines
src/lib/client-id.ts
GA4 / Shared plumbing
Extracts GA4 client identifiers and maintains a first-party browser fallback.
TypeScript
92 lines
src/lib/env.ts
GA4 / Shared plumbing
Reads GA4 and purchase settings from the environment and rejects invalid values.
TypeScript
81 lines
src/lib/mp-client.ts
GA4 / Shared plumbing
Sends trusted server events to GA4 through the Measurement Protocol.
TypeScript
155 lines
src/lib/types.ts
GA4 / Shared plumbing
Defines the shared event, attribution, catalog, and app-owned storage shapes.
TypeScript
68 lines
src/purchases/send-purchase.ts
GA4 / Purchases
Sends one deduplicated purchase from the trusted payment-confirmation path, never a browser success page.
TypeScript
97 lines
src/refunds/send-refund.ts
GA4 / Refunds and disputes
Reverses revenue only for the exact recorded purchase and uses the same client identifier.
TypeScript
70 lines
.env.example
GA4 / Setup and docs
Configuration required by this starter pack.
Config
20 lines
ADAPT.md
GA4 / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
127 lines
app/analytics-demo/route.ts
GA4 / Setup and docs
Serves a dependency-free GA4 demo page with consent, browser events, and a purchase simulation.
TypeScript
96 lines
app/api/analytics/demo-purchase/route.ts
GA4 / Setup and docs
Simulates the trusted server signal and runs the complete purchase reporting flow.
TypeScript
68 lines
app/api/analytics/track/route.ts
GA4 / Setup and docs
Ready-to-serve mount.
TypeScript
3 lines
app/api/analytics/verify/route.ts
GA4 / Setup and docs
Ready-to-serve mount.
TypeScript
9 lines
OPERATIONS.md
GA4 / Setup and docs
The code handles event delivery.
Markdown
53 lines
package.json
GA4 / Setup and docs
Configuration required by this starter pack.
JSON
14 lines
README.md
GA4 / Setup and docs
This starter gives a Next.js App Router application consent-aware GA4 browser tagging, trusted server revenue events, first-party relay tracking, attribution helpers, and a readable verification route.
Markdown
88 lines
src/setup/check-setup.ts
GA4 / Setup and docs
Checks GA4 setup through the validation endpoint because dashboard automation requires OAuth.
TypeScript
103 lines
src/setup/consent.ts
GA4 / Setup and docs
Reads, writes, and replays the visitor's Consent Mode choice.
TypeScript
26 lines
src/setup/ga4-tag.ts
GA4 / Setup and docs
Builds the dependency-free GA4 head tags with Consent Mode v2 ordering.
TypeScript
70 lines
starter.json
GA4 / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
GA4 / Setup and docs
Find your symptom and apply the fix first.
Markdown
91 lines
tsconfig.json
GA4 / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/subscriptions/lifecycle-events.ts
GA4 / Subscriptions
Records stable subscription lifecycle stages through the trusted server event seam.
TypeScript
49 lines
src/verify/route.ts
GA4 / Verify your setup
Reports GA4 settings, catalog alignment, storage readiness, consent, and validation results.
TypeScript
184 lines
src/webhooks/DATA_MANAGER_API.md
GA4 / Webhook handlers
Google placed the GA4 Measurement Protocol in maintenance mode in December 2025.
Markdown
11 lines
src/webhooks/server-events.ts
GA4 / Webhook handlers
Sends trusted backend events and handles the consent-aware first-party browser relay.
TypeScript
119 lines
src/agentic/agent-send.ts
Resend / Agentic commerce
Lets an approved AI agent send catalog messages within hard hourly and daily caps.
TypeScript
79 lines
src/checkout/purchase-receipt.ts
Resend / Checkout
Sends one editable purchase receipt after a trusted server event.
TypeScript
68 lines
src/emails/send-message.ts
Resend / Emails
Sends every catalog message through suppression checks, Resend, and outbound recording.
TypeScript
82 lines
src/emails/welcome-email.ts
Resend / Emails
Builds and sends the editable welcome message from the catalog.
TypeScript
41 lines
src/fulfillment/follow-up-message.ts
Resend / Fulfillment
Sends at most one follow-up catalog message for each trusted app event.
TypeScript
40 lines
src/lib/app-adapter.ts
Resend / Shared plumbing
Connects generic Resend handlers to your app's database and email records.
TypeScript
203 lines
src/lib/env.ts
Resend / Shared plumbing
Reads Resend and app settings from the environment and rejects missing values.
TypeScript
105 lines
src/lib/message-catalog.ts
Resend / Shared plumbing
The one trusted list of every message this app can send.
TypeScript
95 lines
src/lib/resend-client.ts
Resend / Shared plumbing
Calls the Resend REST API directly with fetch.
TypeScript
123 lines
src/lib/types.ts
Resend / Shared plumbing
Shared types for the email adapter contract and delivery event handling.
TypeScript
120 lines
src/portal/clear-suppression.ts
Resend / Customer portal
Clears a Resend suppression after a human confirms the address is safe again.
TypeScript
21 lines
src/portal/topic-preferences.ts
Resend / Customer portal
Stores topic choices and blocks marketing messages without explicit opt-in.
TypeScript
73 lines
src/refunds/refund-confirmation.ts
Resend / Refunds and disputes
Sends a refund confirmation to the exact address stored with the purchase receipt.
TypeScript
72 lines
.env.example
Resend / Setup and docs
Configuration required by this starter pack.
Config
38 lines
ADAPT.md
Resend / Setup and docs
Give these instructions to the coding agent working in the buyer's TypeScript app.
Markdown
194 lines
app/api/resend/send-test/route.ts
Resend / Setup and docs
Accepts the email-test form and sends one catalog welcome message.
TypeScript
87 lines
app/api/resend/verify/route.ts
Resend / Setup and docs
Mounts the offline Resend pack health check at GET /api/resend/verify.
TypeScript
7 lines
app/api/resend/webhook/route.ts
Resend / Setup and docs
Mounts the Resend delivery webhook at POST /api/resend/webhook.
TypeScript
9 lines
app/email-test/route.ts
Resend / Setup and docs
Serves a clickable page for sending the starter's welcome email end to end.
TypeScript
43 lines
OPERATIONS.md
Resend / Setup and docs
The code handles routine sends and events.
Markdown
89 lines
package.json
Resend / Setup and docs
Configuration required by this starter pack.
JSON
16 lines
README.md
Resend / Setup and docs
This starter gives a TypeScript, Next.js-style app a safe Resend email flow using plain Web `Request` and `Response` route handlers.
Markdown
130 lines
src/setup/check-domain.ts
Resend / Setup and docs
Checks the Resend sending domain and prints DNS records that still need attention.
TypeScript
164 lines
src/setup/create-webhook.ts
Resend / Setup and docs
Creates the Resend delivery webhook and prints its one-time signing secret.
TypeScript
169 lines
starter.json
Resend / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Resend / Setup and docs
Find the symptom and apply the fix first.
Markdown
129 lines
tsconfig.json
Resend / Setup and docs
Configuration required by this starter pack.
JSON
20 lines
src/subscriptions/contacts.ts
Resend / Subscriptions
Adds, updates, and removes contacts while mirroring their state in the application.
TypeScript
84 lines
src/subscriptions/segment-broadcast.ts
Resend / Subscriptions
Creates and sends one catalog announcement through a configured Resend segment.
TypeScript
60 lines
src/usage/send-volume-guard.ts
Resend / Usage billing
Stops runaway automated email loops before they exhaust the account's send limit.
TypeScript
28 lines
src/verify/route.ts
Resend / Verify your setup
Reports offline checks for Resend settings, storage, and message configuration.
TypeScript
164 lines
src/webhooks/handlers/email-bounced.ts
Resend / Webhook handlers
Records Resend bounces with safe permanent and temporary failure handling.
TypeScript
50 lines
src/webhooks/handlers/email-complained.ts
Resend / Webhook handlers
Records Resend spam complaints and suppresses the recipient from future sends.
TypeScript
34 lines
src/webhooks/handlers/email-delivered.ts
Resend / Webhook handlers
Records a Resend delivery event against the matching outbound message.
TypeScript
22 lines
src/webhooks/handlers/email-delivery-delayed.ts
Resend / Webhook handlers
Records delayed Resend deliveries as temporary failures without suppressing recipients.
TypeScript
23 lines
src/webhooks/handlers/email-failed.ts
Resend / Webhook handlers
Records Resend send failures without suppressing recipients for sender-side problems.
TypeScript
26 lines
src/webhooks/handlers/email-suppressed.ts
Resend / Webhook handlers
Mirrors Resend suppression events into local delivery and suppression records.
TypeScript
47 lines
src/webhooks/route.ts
Resend / Webhook handlers
Verifies, claims, and dispatches every Resend delivery webhook event.
TypeScript
135 lines
src/webhooks/verify-signature.ts
Resend / Webhook handlers
Verifies Resend webhook signatures and rejects stale Svix timestamps.
TypeScript
68 lines
src/agentic/agent-send.ts
Mailgun / Agentic commerce
Lets an approved AI agent send catalog messages within hard hourly and daily caps.
TypeScript
75 lines
src/checkout/purchase-receipt.ts
Mailgun / Checkout
Sends one editable purchase receipt after a trusted server event.
TypeScript
62 lines
src/emails/send-message.ts
Mailgun / Emails
Sends every catalog message through suppression checks, Mailgun, and outbound recording.
TypeScript
76 lines
src/emails/welcome-email.ts
Mailgun / Emails
Builds and sends the editable welcome message from the catalog.
TypeScript
41 lines
src/fulfillment/follow-up-message.ts
Mailgun / Fulfillment
Sends at most one follow-up catalog message for each trusted app event.
TypeScript
37 lines
src/lib/app-adapter.ts
Mailgun / Shared plumbing
Connects generic Mailgun handlers to your app's database and email records.
TypeScript
184 lines
src/lib/env.ts
Mailgun / Shared plumbing
Reads Mailgun and app settings from the environment and rejects missing values.
TypeScript
109 lines
src/lib/mailgun-client.ts
Mailgun / Shared plumbing
Calls the Mailgun REST API directly with fetch.
TypeScript
108 lines
src/lib/message-catalog.ts
Mailgun / Shared plumbing
The one trusted list of every message this app can send.
TypeScript
94 lines
src/lib/types.ts
Mailgun / Shared plumbing
Shared types for the email adapter contract and delivery event handling.
TypeScript
101 lines
src/portal/clear-transactional-suppression.ts
Mailgun / Customer portal
Clears a Mailgun unsubscribe suppression for a support-critical transactional message.
TypeScript
19 lines
src/portal/email-preferences.ts
Mailgun / Customer portal
Stores marketing choices and blocks marketing messages without explicit opt-in.
TypeScript
42 lines
src/refunds/refund-confirmation.ts
Mailgun / Refunds and disputes
Sends a refund confirmation to the exact address stored with the purchase receipt.
TypeScript
71 lines
.env.example
Mailgun / Setup and docs
Configuration required by this starter pack.
Config
35 lines
ADAPT.md
Mailgun / Setup and docs
Give these instructions to the coding agent working in the buyer's TypeScript app.
Markdown
186 lines
app/api/mailgun/send-test/route.ts
Mailgun / Setup and docs
Accepts the email-test form and sends one catalog welcome message.
TypeScript
87 lines
app/api/mailgun/verify/route.ts
Mailgun / Setup and docs
Mounts the offline Mailgun pack health check at GET /api/mailgun/verify.
TypeScript
7 lines
app/api/mailgun/webhook/route.ts
Mailgun / Setup and docs
Mounts the Mailgun delivery webhook at POST /api/mailgun/webhook.
TypeScript
9 lines
app/email-test/route.ts
Mailgun / Setup and docs
Serves a clickable page for sending the starter's welcome email end to end.
TypeScript
43 lines
OPERATIONS.md
Mailgun / Setup and docs
The code handles routine sends and events.
Markdown
77 lines
package.json
Mailgun / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
README.md
Mailgun / Setup and docs
This starter gives a TypeScript, Next.js-style app a safe Mailgun email flow using plain Web `Request` and `Response` route handlers.
Markdown
131 lines
src/setup/check-domain.ts
Mailgun / Setup and docs
Checks the Mailgun sending domain and prints the DNS records that still need attention.
TypeScript
132 lines
src/setup/create-webhooks.ts
Mailgun / Setup and docs
Creates or updates every Mailgun delivery webhook used by this starter.
TypeScript
156 lines
starter.json
Mailgun / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Mailgun / Setup and docs
Find the symptom and apply the fix first.
Markdown
99 lines
tsconfig.json
Mailgun / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/subscriptions/broadcast-to-list.ts
Mailgun / Subscriptions
Sends one catalog message through the configured Mailgun mailing list.
TypeScript
19 lines
src/subscriptions/mailing-list-members.ts
Mailgun / Subscriptions
Adds, updates, and removes members from the configured Mailgun mailing list.
TypeScript
54 lines
src/usage/send-volume-guard.ts
Mailgun / Usage billing
Stops runaway automated email loops before they exhaust the account's send limit.
TypeScript
28 lines
src/verify/route.ts
Mailgun / Verify your setup
Reports offline checks for Mailgun settings, storage, and message configuration.
TypeScript
151 lines
src/webhooks/handlers/message-complained.ts
Mailgun / Webhook handlers
Records Mailgun spam complaints and suppresses the recipient from future sends.
TypeScript
33 lines
src/webhooks/handlers/message-delivered.ts
Mailgun / Webhook handlers
Records a Mailgun delivery event against the matching outbound message.
TypeScript
31 lines
src/webhooks/handlers/message-failed.ts
Mailgun / Webhook handlers
Records temporary and permanent Mailgun delivery failures with safe suppression behavior.
TypeScript
56 lines
src/webhooks/handlers/message-unsubscribed.ts
Mailgun / Webhook handlers
Records Mailgun unsubscribe events and suppresses the recipient from marketing sends.
TypeScript
33 lines
src/webhooks/route.ts
Mailgun / Webhook handlers
Verifies, claims, and dispatches every Mailgun delivery webhook event.
TypeScript
142 lines
src/webhooks/verify-signature.ts
Mailgun / Webhook handlers
Verifies Mailgun webhook signatures and rejects stale signature timestamps.
TypeScript
45 lines
src/agentic/agent-report.ts
Sentry / Agentic commerce
Lets approved AI agents file scrubbed diagnostic events within hard daily caps.
TypeScript
66 lines
src/browser/reporter-snippet.ts
Sentry / Browser
Provides a dependency-free browser error reporter for the first-party tunnel.
TypeScript
88 lines
src/crons/monitor-catalog.ts
Sentry / Crons
Declares the one trusted catalog of scheduled jobs monitored by Sentry.
TypeScript
55 lines
src/crons/run-monitored-job.ts
Sentry / Crons
Wraps a scheduled job with Sentry check-ins, failure capture, and run records.
TypeScript
170 lines
src/errors/capture.ts
Sentry / Errors
Captures server-side errors and messages as Sentry events.
TypeScript
198 lines
src/lib/app-adapter.ts
Sentry / Shared plumbing
Connects generic Sentry handlers to your app's database and notification
TypeScript
132 lines
src/lib/dsn.ts
Sentry / Shared plumbing
Parses the Sentry DSN into the pieces every raw API call needs.
TypeScript
68 lines
src/lib/env.ts
Sentry / Shared plumbing
Reads and validates the settings this pack needs from the environment.
TypeScript
73 lines
src/lib/scrub.ts
Sentry / Shared plumbing
Removes likely secrets from context before anything is sent to Sentry.
TypeScript
38 lines
src/lib/sentry-client.ts
Sentry / Shared plumbing
Sends envelopes to Sentry's ingestion endpoint with plain fetch calls.
TypeScript
145 lines
src/lib/types.ts
Sentry / Shared plumbing
Shared types for the monitoring adapter contract and Sentry event handling.
TypeScript
92 lines
src/releases/release.ts
Sentry / Releases
Creates and finalizes Sentry releases through the server-only Web API.
TypeScript
67 lines
.env.example
Sentry / Setup and docs
Configuration required by this starter pack.
Config
44 lines
ADAPT.md
Sentry / Setup and docs
Give these instructions to the coding agent working in the buyer's TypeScript app.
Markdown
205 lines
app/api/sentry/reporter/route.ts
Sentry / Setup and docs
Serves the dependency-free browser reporter at GET /api/sentry/reporter.
TypeScript
17 lines
app/api/sentry/send-test/route.ts
Sentry / Setup and docs
Sends one server-side test error from POST /api/sentry/send-test.
TypeScript
33 lines
app/api/sentry/tunnel/route.ts
Sentry / Setup and docs
Mounts the first-party Sentry envelope tunnel at POST /api/sentry/tunnel.
TypeScript
3 lines
app/api/sentry/verify/route.ts
Sentry / Setup and docs
Mounts the offline Sentry pack health check at GET /api/sentry/verify.
TypeScript
7 lines
app/api/sentry/webhook/route.ts
Sentry / Setup and docs
Mounts the Sentry webhook at POST /api/sentry/webhook.
TypeScript
3 lines
app/error-test/route.ts
Sentry / Setup and docs
Serves a clickable page for sending a test server error into Sentry.
TypeScript
56 lines
OPERATIONS.md
Sentry / Setup and docs
The code handles routine captures, check-ins, signatures, duplicate deliveries, and quota guards.
Markdown
84 lines
package.json
Sentry / Setup and docs
Configuration required by this starter pack.
JSON
17 lines
README.md
Sentry / Setup and docs
This starter gives a TypeScript, Next.js-style app server error capture, browser error reporting, signed Sentry webhooks, cron check-ins, release tracking, and guarded agent diagnostics using plain Web `Request` and `Response` route handlers.
Markdown
167 lines
src/setup/check-dsn.ts
Sentry / Setup and docs
Parses the configured Sentry DSN and optionally sends one quota-spending test.
TypeScript
98 lines
src/setup/create-release.ts
Sentry / Setup and docs
Creates and finalizes a Sentry release from local environment settings.
TypeScript
146 lines
src/setup/webhook-setup.ts
Sentry / Setup and docs
Prints the manual Sentry webhook setup path and checks the local Client Secret.
TypeScript
64 lines
starter.json
Sentry / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Sentry / Setup and docs
Find the symptom and apply the fix first.
Markdown
117 lines
tsconfig.json
Sentry / Setup and docs
Configuration required by this starter pack.
JSON
20 lines
src/tunnel/route.ts
Sentry / Tunnel
Validates and forwards browser error envelopes through a first-party route.
TypeScript
146 lines
src/usage/capture-budget-guard.ts
Sentry / Usage billing
Drops excess captures locally before a crash loop can consume billed Sentry quota.
TypeScript
26 lines
src/verify/route.ts
Sentry / Verify your setup
Reports offline checks for Sentry settings, storage, monitors, and rate limits.
TypeScript
141 lines
src/webhooks/handlers/event-alert.ts
Sentry / Webhook handlers
Turns Sentry issue-alert rule deliveries into operator alerts and issue records.
TypeScript
87 lines
src/webhooks/handlers/installation.ts
Sentry / Webhook handlers
Accepts Sentry integration installation lifecycle webhooks.
TypeScript
7 lines
src/webhooks/handlers/issue.ts
Sentry / Webhook handlers
Mirrors Sentry issue lifecycle changes and alerts the operator about new issues.
TypeScript
87 lines
src/webhooks/handlers/metric-alert.ts
Sentry / Webhook handlers
Notifies the operator when a Sentry metric alert changes state.
TypeScript
44 lines
src/webhooks/route.ts
Sentry / Webhook handlers
Verifies, claims, and dispatches Sentry Integration Platform webhooks.
TypeScript
93 lines
src/webhooks/verify-signature.ts
Sentry / Webhook handlers
Verifies Sentry Integration Platform webhook signatures against the raw request body.
TypeScript
39 lines
src/account/account-context.ts
PostHog / Account
Updates allowlisted person and group context without accepting browser-posted identity.
TypeScript
40 lines
src/agentic/ai-events.ts
PostHog / Agentic commerce
Records allowlisted AI feature actions without prompts, outputs, or free text.
TypeScript
29 lines
src/browser/capture-browser.ts
PostHog / Browser
Captures catalog-approved browser events without letting analytics break the page.
TypeScript
22 lines
src/campaigns/campaign-events.ts
PostHog / Campaigns
Builds consistent UTM links and safe campaign event properties without personal data.
TypeScript
36 lines
src/conversions/send-conversion.ts
PostHog / Conversions
Sends one deduplicated purchase from a trusted payment-confirmation path.
TypeScript
78 lines
src/events/event-catalog.ts
PostHog / Events
Defines every allowed event name, safe property, and conversion product in one place.
TypeScript
126 lines
src/flags/feature-flags.ts
PostHog / Flags
Evaluates feature flags on the server and builds flicker-free browser bootstrap data.
TypeScript
58 lines
src/funnels/funnel-steps.ts
PostHog / Funnels
Defines the ordered product funnel used by browser and trusted server tracking.
TypeScript
18 lines
src/lib/app-adapter.ts
PostHog / Shared plumbing
Connects PostHog senders to your app's identities, deduplication, and conversion records.
TypeScript
82 lines
src/lib/dedupe-uuid.ts
PostHog / Shared plumbing
Derives one stable event UUID from a dedupe key so retries collapse server-side.
TypeScript
26 lines
src/lib/env.ts
PostHog / Shared plumbing
Reads PostHog and conversion settings from the environment and rejects invalid values.
TypeScript
106 lines
src/lib/posthog-server.ts
PostHog / Shared plumbing
Creates the server SDK singleton and provides never-throw capture and flush helpers.
TypeScript
78 lines
src/lib/types.ts
PostHog / Shared plumbing
Defines the shared event, identity, conversion, flag, and app-owned storage shapes.
TypeScript
39 lines
src/refunds/send-refund.ts
PostHog / Refunds and disputes
Records a refund only against the exact stored conversion and original distinct id.
TypeScript
69 lines
.env.example
PostHog / Setup and docs
Configuration required by this starter pack.
Config
20 lines
ADAPT.md
PostHog / Setup and docs
Give these instructions to the coding agent working in the buyer's Next.js project.
Markdown
130 lines
app/api/posthog/demo-conversion/route.ts
PostHog / Setup and docs
Simulates a trusted payment signal and runs the complete conversion flow.
TypeScript
79 lines
app/api/posthog/verify/route.ts
PostHog / Setup and docs
Ready-to-serve verification mount for a Next.js App Router application.
TypeScript
8 lines
app/product-analytics-demo/route.ts
PostHog / Setup and docs
Serves a dependency-free PostHog demo page with consent and conversion retry controls.
TypeScript
71 lines
instrumentation-client.ts
PostHog / Setup and docs
Copy this client initializer to the app root beside package.json in Next.js 15.3+.
TypeScript
30 lines
OPERATIONS.md
PostHog / Setup and docs
The code handles event delivery.
Markdown
50 lines
package.json
PostHog / Setup and docs
Configuration required by this starter pack.
JSON
18 lines
README.md
PostHog / Setup and docs
This starter gives a Next.js App Router application consent-aware product analytics, trusted server conversions, first-party proxy guidance, feature flags, funnels, and a readable verification route.
Markdown
100 lines
src/setup/check-setup.ts
PostHog / Setup and docs
Verifies PostHog settings because project and key creation remain dashboard work.
TypeScript
83 lines
src/setup/consent.ts
PostHog / Setup and docs
Reads consent cookies and wires browser grant or denial into PostHog capture.
TypeScript
34 lines
src/setup/POSTHOG_NEXT.md
PostHog / Setup and docs
`@posthog/next` combines proxy setup, server-rendered flag bootstrapping, and identity synchronization for Next.js applications.
Markdown
15 lines
src/setup/proxy-rewrites.ts
PostHog / Setup and docs
Builds ordered first-party proxy rewrites and documents the matching Next.js settings.
TypeScript
57 lines
starter.json
PostHog / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
PostHog / Setup and docs
Find the symptom and apply the fix first.
Markdown
88 lines
tsconfig.json
PostHog / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/usage/product-usage.ts
PostHog / Usage billing
Records allowlisted product activation and outcome events for server-resolved accounts.
TypeScript
37 lines
src/verify/route.ts
PostHog / Verify your setup
Reports PostHog settings, catalog alignment, storage readiness, and live delivery.
TypeScript
218 lines
src/webhooks/server-events.ts
PostHog / Webhook handlers
Sends catalog-checked trusted server events with durable deduplication.
TypeScript
60 lines
src/ai/provider.ts
Expo / Ai
Defines the server-side AI provider seam and built-in echo placeholder.
TypeScript
67 lines
src/config/release-config.ts
Expo / Config
The one trusted definition of this app's identity and release channels.
TypeScript
106 lines
src/lib/api-client.ts
Expo / Shared plumbing
Calls this pack's API routes from the app, attaching the session token.
TypeScript
45 lines
src/lib/app-adapter.ts
Expo / Shared plumbing
Connects this pack's routes and scripts to your app's accounts and storage.
TypeScript
121 lines
src/lib/env.ts
Expo / Shared plumbing
Validates server-side environment values per module, with errors that name
TypeScript
66 lines
src/lib/load-env.ts
Expo / Shared plumbing
Loads .env values for this pack's Node scripts without adding a dependency.
TypeScript
47 lines
src/lib/secure-store.ts
Expo / Shared plumbing
Secure on-device storage for the app session token (lib module).
TypeScript
29 lines
src/lib/types.ts
Expo / Shared plumbing
Shared types for the adapter contract, webhook payloads, and module inputs.
TypeScript
74 lines
src/notifications/register-for-push.ts
Expo / Notifications
Registers and removes this device's push token through authenticated API routes.
TypeScript
73 lines
src/notifications/send-push-cli.ts
Expo / Notifications
Sends a push notification from the command line and checks its first receipts.
TypeScript
78 lines
src/notifications/send-push.ts
Expo / Notifications
Sends Expo push notifications and checks their delivery receipts.
TypeScript
192 lines
src/pipelines/list-status.ts
Expo / Pipelines
Lists recent EAS builds and updates so builders can see what is built and live.
TypeScript
251 lines
src/releases/store-preflight.ts
Expo / Releases
Checks known store submission blockers before a builder starts store review.
TypeScript
146 lines
src/rollbacks/plan-rollback.ts
Expo / Rollbacks
Plans an EAS update rollback with full group IDs but never runs the rollback.
TypeScript
271 lines
.env.example
Expo / Setup and docs
Configuration required by this starter pack.
Config
28 lines
ADAPT.md
Expo / Setup and docs
Give these instructions to the coding agent working in the buyer's project.
Markdown
87 lines
app/_layout.tsx
Expo / Setup and docs
Defines the app's root navigation and shared dark header.
TypeScript
27 lines
app/account.tsx
Expo / Setup and docs
Demonstrates stored sessions, account profile loading, and push registration.
TypeScript
309 lines
app/api/ai+api.ts
Expo / Setup and docs
Handles authenticated AI requests through the configured server-side provider.
TypeScript
129 lines
app/api/eas-webhook+api.ts
Expo / Setup and docs
Receives signed EAS build and submission webhook events.
TypeScript
84 lines
app/api/profile+api.ts
Expo / Setup and docs
Returns the signed-in account's profile through the app adapter.
TypeScript
57 lines
app/api/push-tokens+api.ts
Expo / Setup and docs
Stores and removes Expo push tokens for signed-in app accounts.
TypeScript
178 lines
app/index.tsx
Expo / Setup and docs
Shows the running release, update controls, and release pipeline links.
TypeScript
219 lines
app.config.ts
Expo / Setup and docs
Expo app config.
TypeScript
72 lines
eas.json
Expo / Setup and docs
Configuration required by this starter pack.
JSON
41 lines
OPERATIONS.md
Expo / Setup and docs
The human moments of running a mobile app.
Markdown
41 lines
package.json
Expo / Setup and docs
Configuration required by this starter pack.
JSON
48 lines
README.md
Expo / Setup and docs
This starter gives an Expo React Native app a complete release pipeline: EAS cloud builds for iOS and Android, store submission, over-the-air updates with a rollback runbook, push notifications, build-status webhooks, and plain-language release checks, wrapped in a runnable Expo Router app.
Markdown
70 lines
src/setup/configure-eas.ts
Expo / Setup and docs
Walks a builder through EAS setup and stays safe to run more than once.
TypeScript
175 lines
starter.json
Expo / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Expo / Setup and docs
Symptom first, fix first, cause second.
Markdown
73 lines
tsconfig.json
Expo / Setup and docs
Configuration required by this starter pack.
JSON
18 lines
src/updates/update-runtime.ts
Expo / Updates
Over-the-air update helpers (fulfillment module) around expo-updates.
TypeScript
74 lines
src/updates/UpdateBanner.tsx
Expo / Updates
Banner that offers a restart when an over-the-air update is downloaded.
TypeScript
78 lines
src/verify/check-release.ts
Expo / Verify your setup
Checks release settings locally and explains every item that still needs work.
TypeScript
213 lines
src/webhooks/handle-build-event.ts
Expo / Webhook handlers
Records EAS build and submission webhook events without processing retries twice.
TypeScript
104 lines
src/webhooks/verify-signature.ts
Expo / Webhook handlers
Verifies that an EAS webhook body matches its signed request header.
TypeScript
28 lines
src/config/purchases-config.ts
RevenueCat / Config
The single source of truth for this pack: app identity, the entitlement
TypeScript
200 lines
src/customer-center/present-customer-center.ts
RevenueCat / Customer Center
Opens RevenueCat Customer Center for subscription help customers can handle themselves.
TypeScript
12 lines
src/lib/app-adapter.ts
RevenueCat / Shared plumbing
Connects this pack's server code to your app's storage and messaging.
TypeScript
129 lines
src/lib/env.ts
RevenueCat / Shared plumbing
Validates server-side environment values per module, with errors that name
TypeScript
62 lines
src/lib/load-env.ts
RevenueCat / Shared plumbing
Loads .env values for this pack's Node scripts without adding a dependency.
TypeScript
47 lines
src/lib/types.ts
RevenueCat / Shared plumbing
Shared types for the pack.
TypeScript
99 lines
src/paywalls/present-paywall.ts
RevenueCat / Paywalls
Presents RevenueCat's server-driven paywall and translates SDK results into app outcomes.
TypeScript
63 lines
src/purchases/purchases-client.ts
RevenueCat / Purchases
The one place app code talks to the RevenueCat SDK.
TypeScript
262 lines
.env.example
RevenueCat / Setup and docs
Configuration required by this starter pack.
Config
39 lines
ADAPT.md
RevenueCat / Setup and docs
Give these instructions to the coding agent working in the buyer's project.
Markdown
72 lines
app/_layout.tsx
RevenueCat / Setup and docs
Configures purchases once and defines the app's dark root navigation.
TypeScript
35 lines
app/account.tsx
RevenueCat / Setup and docs
Demonstrates linking anonymous RevenueCat purchases to a stable app account.
TypeScript
223 lines
app/api/revenuecat-webhook+api.ts
RevenueCat / Setup and docs
Receives authenticated RevenueCat webhook events for server reconciliation.
TypeScript
96 lines
app/index.tsx
RevenueCat / Setup and docs
Demonstrates setup, entitlements, products, paywalls, restores, and self-service.
TypeScript
350 lines
app.config.ts
RevenueCat / Setup and docs
Expo app config.
TypeScript
45 lines
OPERATIONS.md
RevenueCat / Setup and docs
Runbooks for the person on call when billing does something unusual.
Markdown
74 lines
package.json
RevenueCat / Setup and docs
Configuration required by this starter pack.
JSON
37 lines
README.md
RevenueCat / Setup and docs
Mobile subscriptions and one-time purchases for Expo and React Native apps, built on RevenueCat so you never hand-write StoreKit or Google Play Billing code.
Markdown
139 lines
src/setup/configure-revenuecat.ts
RevenueCat / Setup and docs
Reviews local RevenueCat setup and prints the remaining dashboard steps without making network calls.
TypeScript
142 lines
starter.json
RevenueCat / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
RevenueCat / Setup and docs
Symptom-first.
Markdown
108 lines
tsconfig.json
RevenueCat / Setup and docs
Configuration required by this starter pack.
JSON
18 lines
src/verify/check-purchases.ts
RevenueCat / Verify your setup
Checks RevenueCat purchase configuration locally and blocks shipping when required setup is incomplete.
TypeScript
244 lines
src/webhooks/handle-webhook-event.ts
RevenueCat / Webhook handlers
Claims RevenueCat events, reconciles current state, and records the outcome.
TypeScript
127 lines
src/webhooks/reconcile-cli.ts
RevenueCat / Webhook handlers
Fetches and optionally records one customer's current RevenueCat state.
TypeScript
105 lines
src/webhooks/reconcile.ts
RevenueCat / Webhook handlers
Rebuilds a customer's billing state from RevenueCat's current server truth.
TypeScript
196 lines
src/webhooks/replay-local.ts
RevenueCat / Webhook handlers
Proves the webhook flow on your machine: no deployed URL, no dashboard,
TypeScript
140 lines
src/webhooks/verify-authorization.ts
RevenueCat / Webhook handlers
Verifies the static Authorization value attached to RevenueCat webhooks.
TypeScript
34 lines
src/agentic/agent-sales.ts
Whop / Agentic commerce
Guards approved agent-driven sales behind trusted membership and catalog checks.
TypeScript
33 lines
src/checkout/create-checkout.ts
Whop / Checkout
Creates an app order and a metadata-linked Whop checkout using server-owned plan data.
TypeScript
56 lines
src/emails/configured-provider.ts
Whop / Emails
Selects the app notification provider, with console as the zero-signup default.
TypeScript
15 lines
src/emails/console-provider.ts
Whop / Emails
Prints app notifications to the server terminal without an email account.
TypeScript
16 lines
src/emails/purchase-confirmation.ts
Whop / Emails
Sends the app's own purchase note after access is granted.
TypeScript
19 lines
src/emails/send-email.ts
Whop / Emails
Defines the provider-neutral contract for the app's own purchase notifications.
TypeScript
20 lines
src/fulfillment/grant-access.ts
Whop / Fulfillment
Grants the app's paid value through the app-owned commerce adapter.
TypeScript
25 lines
src/lib/app-adapter.ts
Whop / Shared plumbing
Connects Whop handlers to the application's orders, accounts, and access records.
TypeScript
123 lines
src/lib/env.ts
Whop / Shared plumbing
Reads Whop commerce settings and rejects missing or malformed values.
TypeScript
73 lines
src/lib/types.ts
Whop / Shared plumbing
Defines the app-owned records and adapter operations used by Whop commerce flows.
TypeScript
74 lines
src/lib/whop-client.ts
Whop / Shared plumbing
Creates the singleton Whop SDK client for sandbox or production requests.
TypeScript
23 lines
src/members/link-member.ts
Whop / Members
Links a webhook-confirmed Whop member to the app account stored on its order.
TypeScript
24 lines
src/memberships/validate-membership.ts
Whop / Memberships
Checks Whop membership from a trusted app account before serving paid features.
TypeScript
51 lines
src/plans/plan-catalog.ts
Whop / Plans
Defines the trusted slug-keyed catalog of Whop plans this starter sells.
TypeScript
103 lines
src/portal/member-links.ts
Whop / Customer portal
Builds safe member-facing Whop links without making an API call.
TypeScript
27 lines
src/refunds/dispute-webhooks.ts
Whop / Refunds and disputes
Records Whop disputes for operator review without automatically revoking access.
TypeScript
23 lines
src/refunds/refund-webhooks.ts
Whop / Refunds and disputes
Revokes only the grant tied to a succeeded Whop refund's stored order reference.
TypeScript
34 lines
.env.example
Whop / Setup and docs
Configuration required by this starter pack.
Config
33 lines
ADAPT.md
Whop / Setup and docs
Complete these steps in order.
Markdown
111 lines
app/api/whop/checkout/route.ts
Whop / Setup and docs
Creates a metadata-linked checkout from a server-selected catalog plan.
TypeScript
38 lines
app/api/whop/verify/route.ts
Whop / Setup and docs
Mounts the readable Whop verification handler for adaptation work.
TypeScript
8 lines
app/api/whop/webhook/route.ts
Whop / Setup and docs
Mounts the signed Whop webhook handler in a Next.js App Router application.
TypeScript
8 lines
app/buy/route.ts
Whop / Setup and docs
Serves a working embedded checkout page with a hosted-checkout fallback.
TypeScript
67 lines
app/checkout/success/route.ts
Whop / Setup and docs
Serves the browser return page without treating a redirect as payment proof.
TypeScript
18 lines
OPERATIONS.md
Whop / Setup and docs
1.
Markdown
51 lines
package.json
Whop / Setup and docs
Configuration required by this starter pack.
JSON
18 lines
README.md
Whop / Setup and docs
This starter gives a Next.js App Router application Whop checkout, signed webhook handling, exact-once access grants, member-to-account linking, and server-side membership validation.
Markdown
128 lines
src/setup/create-product.ts
Whop / Setup and docs
Creates or finds each catalog product and one-time plan in the selected Whop mode.
TypeScript
97 lines
src/setup/create-webhook.ts
Whop / Setup and docs
Creates or updates the starter's v1 Whop webhook endpoint without duplication.
TypeScript
70 lines
starter.json
Whop / Setup and docs
Configuration required by this starter pack.
JSON
6 lines
TROUBLESHOOTING.md
Whop / Setup and docs
Open `/api/whop/verify` first.
Markdown
53 lines
tsconfig.json
Whop / Setup and docs
Configuration required by this starter pack.
JSON
15 lines
src/verify/route.ts
Whop / Verify your setup
Reports Whop settings, account identity, catalog alignment, and adapter readiness.
TypeScript
115 lines
src/webhooks/handlers/membership-activated.ts
Whop / Webhook handlers
Links an activated membership to its app order without treating activation as payment.
TypeScript
18 lines
src/webhooks/handlers/membership-deactivated.ts
Whop / Webhook handlers
Ends membership access through the optional app adapter module.
TypeScript
15 lines
src/webhooks/handlers/payment-failed.ts
Whop / Webhook handlers
Records a readable payment failure signal without granting or removing access.
TypeScript
12 lines
src/webhooks/handlers/payment-succeeded.ts
Whop / Webhook handlers
Validates a successful payment before granting the exact app order once.
TypeScript
61 lines
src/webhooks/route.ts
Whop / Webhook handlers
Verifies raw Whop webhooks and dispatches each claimed event exactly once.
TypeScript
92 lines