Skip to main content

Embedded Sign-Up Flow (V2)

executeEmbeddedSignUpFlowV2 drives a step-by-step user registration flow using the V2 protocol.

executeEmbeddedSignUpFlowV2(config)

Initiate or advance a V2 embedded registration flow.

import { executeEmbeddedSignUpFlowV2, EmbeddedSignUpFlowStatusV2 } from '@thunderid/javascript'

// Step 1 — Initiate
const step1 = await executeEmbeddedSignUpFlowV2({
baseUrl: 'https://localhost:8090',
payload: {
applicationId: '<your-app-id>',
flowType: 'REGISTRATION',
},
})

// Step 2 — Provide registration details
const step2 = await executeEmbeddedSignUpFlowV2({
baseUrl: 'https://localhost:8090',
payload: {
executionId: step1.executionId,
inputs: {
username: 'newuser@example.com',
password: 'SecurePass123!',
'http://wso2.org/claims/givenname': 'New',
'http://wso2.org/claims/lastname': 'User',
},
},
})

if (step2.flowStatus === EmbeddedSignUpFlowStatusV2.Complete) {
// Registration complete — redirect or sign in
}

Parameters

ParameterTypeRequiredDescription
config.urlstringFull endpoint URL. Mutually exclusive with baseUrl
config.baseUrlstringThunderID base URL
config.payloadEmbeddedSignUpFlowRequestV2Flow request body
config.payload.applicationIdstringApplication ID. Required for the first step
config.payload.flowTypestringFlow type. Required for the first step (e.g., 'REGISTRATION')
config.payload.executionIdstringExecution ID from a prior response
config.payload.actionstringAction to perform at the current step
config.payload.inputsRecord<string, string>Registration field values
config.payload.challengeTokenstringChallenge token for verification steps
config.authIdstringOptional authentication context ID

Response: EmbeddedSignUpFlowResponseV2

PropertyTypeDescription
executionIdstringID to pass in subsequent requests
flowStatusEmbeddedSignUpFlowStatusV2Current flow status
typeEmbeddedSignUpFlowTypeV2View or Redirection
dataEmbeddedFlowResponseDataV2Component tree or redirect data
challengeTokenstringPresent when a verification step is required
redirectUrlstringPresent when type is Redirection
failureReasonstringPresent when flowStatus is Error

Enums

EmbeddedSignUpFlowStatusV2

ValueDescription
IncompleteMore steps required
CompleteRegistration completed successfully
ErrorRegistration failed — check failureReason

EmbeddedSignUpFlowTypeV2

ValueDescription
ViewRender the component tree in data
RedirectionRedirect to redirectUrl
ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© WSO2 LLC. All rights reserved.Privacy PolicyCookie Policy