Before you start

You need:
This guide will help you construct a Signup ID screen with a custom prompt for gathering a user’s first and last name. To learn more, read the Getting Started guide and visit the SDK reference guide. For more information about custom signup and login prompts, read Customize Signup and Login Prompts.

Setup

In your , set up Universal Login, Identifier First Authentication, and a Database Connection that uses passwords. Run Auth0’s single-page ACUL boilerplate application by executing the code below, which provides additional context for Advanced Customizations interfaces.
git clone https://github.com/auth0/auth0-acul-react-boilerplate
After cloning the boilerplate app, change the directory to the auth0-acul-react-boilerplate folder and install the Advanced Customizations SDK.
#Clone the ACUL sample application into the root folder of your project

git clone https://github.com/auth0-samples/auth0-acul-samples.git

#Change directory to install the ACUL sample application 

cd auth0-acul-samples && npm i

Build the signup-id screen

Complete the Build Identifier First Signup with Password guide.

Add a custom prompt field

In your Signup ID index.tsx file, add the following code:
The signup-id POST payload now includes ulp-firstName.

Validate and save your captured data

Complete the validation section of Customize Signup and Login Prompts using the code below to capture and save the data.
exports.onExecutePreUserRegistration = async (event, api) => {
  const firstName = event.request.body['ulp-firstName'];
  if(!firstName) {
    api.validation.error("invalid_payload", "Missing First Name");
    return;
  }

  api.user.setUserMetadata("firstName", firstName);
};

Learn more