Pre User Registration adding of 'user_metadata'

Hi @killianoneachtain,

According to the docs, the pre-user registration action trigger only runs for Database and Passwordless users, not for social connection users such as Spotify.

You can instead use a Post Login Action and check if it is the first login:

exports.onExecutePostLogin = async (event, api) => {
  if (event.stats.logins_count === 1) {
    api.user.setAppMetadata('vip', true);
  }
};
1 Like