Create New HooksBeta

You can create multiple Hooks for any given extensibility point. However, you may only have one Hook enabled per extensibility point at a time.

Create Hooks using the Dashboard

Hooks utilize the Webtask Editor. For additional information on how to work with the Webtask Editor, you can review its docs here.

Auth0 automatically enables the first Hook you create for an extensibility point. Any subsequent Hooks created for that point are in a disabled state. As such, you must explicitly enable subsequent Hooks.

To create new Hooks on the Dashboard:

  1. Navigate to the Hooks page of the Dashboard. Create new Hooks in one of two ways:

    • Clicking on the + Create New Hook button at the top right of the Hooks page.
    • Finding the extensibility hook you want to work with and then clicking the Create New Hook link below.
  2. On the New Hook pop-up window, provide the requested information:

Create Hook Dialog

  • Name: The name for the new Hook
  • Hook: The extensibility point associated with the Hook

Click Create to create the Hook.

At this point, you will see the newly-created Hook listed under its associated extensibility point.

List of Hooks

Create Hooks using the command-line interface

The Auth0 Command-Line Interface (CLI) allows you to create Hooks associated with specific extensibility points within the Auth0 platform. By default, the Auth0 CLI creates new Hooks in a disabled state.

Only tenants created prior to 17 July 2018 have access to and the Webtask CLI. If you are an enterprise customer with a newer tenant, please contact your account representative to request access. Other requests can be made through the Auth0 Contact Form and will be evaluated on a case-by-case basis.

Prerequisite: Set up the Webtask CLI

Before proceeding, you'll need to set up the Webtask CLI. You can find instructions for installing and configuring the Webtask CLI in the Dashboard > Webtask page.

The wt-cli package also includes the auth0 binary, allowing you to use the Auth0 CLI.

Install Webtasks Instructions

Please note that all of the examples on this page use auth0-profile as the name of the profile. This is the same profile name used when installing wt-cli and can be obtained from Step 2 of the instructions set located on Auth0 Management Dashboard's Webtask page.

Rather than beginning from scratch, scaffold the sample code for an Auth0 hook.

auth0 scaffold -t pre-user-registration > file.js

Create the hook:

auth0 create -t pre-user-registration --name my-extension-1 -p auth0-default file.js`

Provision secrets to new Hooks

Optionally, you can add secrets (such as Twilio Keys or database connection strings) to new Hooks by adding --secret KEY=VALUE to the Create command. The information you attach will be encrypted, and it can only be decrypted by the Webtask server.

At this point, you have created a new, disabled Hook using the pre-user-registration extensibility point. You can repeat this process and create Hooks for any of the other extensibility points.