Implement Custom Actions Using Post-User Registration Extensibility Points

Implement Custom Actions Using Post-User Registration Extensibility PointsBeta

For Database Connections and Passwordless Connections, the post-user-registration extensibility point allows you to implement custom actions that execute after a new user registers and is added to the database.

Hooks associated with the post-user-registration extensibility point execute asynchronously from the actions that are a part of the Auth0 authentication process.

Implement a Hook using this extensibility point with either the Dashboard or the Command Line Interface.

Starter code and parameters

After you've created a new Hook that uses the Post-User Registration extensibility point, open up the Hook and edit it using the Webtask Editor embedded in the Dashboard.

The parameters listed in the comment at the top of the code indicate the Auth0 objects (and the parameters within the objects) that can be passed into and used by the Hook's function.

@param {object} user - The user being created
@param {string} - user id (user GUID without "auth0|" database prefix)
@param {string} user.tenant - Auth0 tenant name
@param {string} user.username - user name
@param {string} - email
@param {boolean} user.emailVerified - is email verified?
@param {string} user.phoneNumber - phone number
@param {boolean} user.phoneNumberVerified - is phone number verified?
@param {object} user.user_metadata - user metadata
@param {object} user.app_metadata - application metadata
@param {object} context - Auth0 connection and other context info
@param {string} context.requestLanguage - language of the application agent
@param {object} context.connection - information about the Auth0 connection
@param {object} - connection id
@param {object} - connection name
@param {object} context.connection.tenant - connection tenant
@param {object} context.webtask - webtask context
@param {function} cb - function (error, response)
module.exports = function (user, context, cb) {
  // Perform any asynchronous actions, such as send notification to Slack.

The callback function cb at the end of the sample code is used to signal completion and must not be omitted (even though the extensibility point ignores response objects).


The Post-User Registration extensibility point ignores any response object.

Testing Hooks

Executing the code using the Runner requires a save, which means that the original code will be overwritten.

Once you've modified the sample code with the specific scopes of additional claims you'd like added to your Access Tokens, test Hooks using the Runner. The runner simulates a call to the Hook with the appropriate user information body/payload. The following is the sample body that populates the Runner by default (these are the same objects/parameters detailed in the comment at the top of the sample Hook code):

  "user": {
    "tenant": "my-tenant",
    "username": "user1",
    "email": "",
    "emailVerified": true,
    "phoneNumber": "1-000-000-0000",
    "phoneNumberVerified": true,
    "user_metadata": {
      "hobby": "surfing"
    "app_metadata": {
      "plan": "full"
  "context": {
    "requestLanguage": "en-us",
    "connection": {
      "id": "con_xxxxxxxxxxxxxxxx",
      "name": "Username-Password-Authentication",
      "tenant": "my-tenant"

Example: integrate with Slack

module.exports = function (user, context, cb) {

  // Read more about incoming webhooks at

  // Post the new user's name and email address to the selected channel
  var slack = require('slack-notify')(SLACK_HOOK);
  var message = 'New User: ' + ( || + ' (' + + ')';
  var channel = '#some_channel';

   text: message,
   channel: channel

  // Return immediately; the request to the Slack API will continue on the sandbox