- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Register Customer in Storefront
To register a customer, you implement the following steps:
- Show the customer a form to enter their details.
- Send a
POST
request to the/auth/customer/emailpass/register
API route to obtain a JWT token. - Send a request to the Create Customer API route pass the JWT token in the header.
For example:
In the above example, you create a handleRegistration
function that:
- Obtains a JWT token from the
/auth/customer/emailpass
API route. - Send a request to the Create Customer API route, and pass the JWT token as a Bearer token in the authorization header.
- Once the customer is registered successfully, you can either redirect the customer to the login page or log them in automatically as explained in this guide.
Was this page helpful?