PelcroUserRegister

Fired when a new user registers

Overview

Fired when a new user account is successfully created. Use this event to track registrations and trigger welcome flows.


Triggered By

MethodDescription
Pelcro.user.register()Standard registration
Pelcro.user.convert()Converting a legacy account

Event Detail

The event.detail object contains the newly created user:

PropertyTypeDescription
idnumberUser's unique identifier
emailstringUser's email address
first_namestringUser's first name
last_namestringUser's last name
auth_tokenstringJWT authentication token
email_verifiedbooleanWhether email is verified
metadataobjectCustom metadata fields

Example

document.addEventListener('PelcroUserRegister', (event) => {
  const user = event.detail;

  console.log(`New user registered: ${user.email}`);

  // Track registration in analytics
  analytics.track('User Registered', {
    userId: user.id,
    email: user.email
  });

  // Trigger welcome flow
  showWelcomeMessage(user.first_name);
});

Related Events

This event is always fired alongside:


Related