Overview
User enters their email address
The registration form collects an email address. The form action also accepts a
name field, which is passed to Stripe when creating the customer record.Stripe customer is created
On form submission, the server calls
stripe.customers.create with the provided email and name. Stripe returns a customer object containing a unique customerId.app/services/customer.ts
Session cookie is set
The
customerId returned by Stripe is stored in a signed session cookie. This cookie is required by every subsequent step — plan selection and payment — to associate actions with the correct Stripe customer.app/routes/register.tsx
Form fields
| Field | Required | Notes |
|---|---|---|
email | Yes | Displayed in the UI; used as the Stripe customer email. |
name | No | Accepted by the form action and passed to Stripe, but not rendered as a visible input in the current UI. |
The
name field is included in the route action and forwarded to Stripe, but there is no corresponding input in the registration form UI. If you want to collect a display name from users, add a name input to the form.Session storage
The session is backed by a signed cookie. The cookie stores a single key:| Key | Value | Purpose |
|---|---|---|
customerId | Stripe customer ID (e.g. cus_...) | Identifies the customer in all downstream Stripe API calls |