Skip to main content

Embedded Flow

Getting started with onboarding your users to Branch can be achieved easily with the embedded flow.


Embedding the Flow

Branch can be integrated onto your page with the following code snippet. Remember to replace the organization ID with your organization's ID.

<script src=""></script>

Use this import if you are testing in a sandbox environment
<script src=""></script>

const client = new Branch.Onboarding({
organizationId: '100019',
onLoad: () =>,

// Optionally do something when the
// user successfully creates an account
onAccountCreated: (user) => {},

// Optionally do something when the
// user has completed and exited onboarding
onComplete: () => {},

// Optionally do something when the
// user has exited onboarding early
onExit: () => {},



The widget accepts the following parameters:

orgRequiredYour assigned Branch organization ID
prefillOptionalAn object used to prefill form fields in the onboarding flow
onLoadOptionalA callback fired when the onboarding flow has successfully loaded into your page
onExitOptionalA callback fired when the user has exited from the flow before completing
onCompleteOptionalA callback fired when the user completes and exits the onboarding flow
onAccountCreatedOptionalA callback fired when the user account is created

Prefill Options

Initialize the widget with optional values that will be prefilled into the appropriate onboarding flow fields. Individuals can still edit prefilled values.

new Branch.Onboarding({
prefill: {
firstName: "Jane",
lastName: "Doe",
phoneNumber: "1231234567",
emailAddress: ""
firstNameA-Z and spaces allowed
lastNameA-Z and spaces allowed
phoneNumberNumbers allowed (no separators)
emailAddressValid email address

Instance Methods

When you initialize a widget, you can store it in a variable and call a few methods on it later:

const client = new window.Branch.client(params);

// sometime later:;

// you can also programmatically close
// the widget if you need to: