Auth0 Hooks

If you are behind a firewall, for this feature to work properly, you may need to add the appropriate Auth0 IP addresses to the Allow List.

Hooks are secure, self-contained functions that allow you to customize the behavior of Auth0 when executed for selected extensibility points of the Auth0 platform. Auth0 invokes Hooks during runtime to execute your custom Node.js code. To learn more, read Extensibility Points.

Whether Hooks can be used with connections varies according to extensibility point. Hooks that can be used with connections only work with database and passwordless connections. To learn more, read Database Connections and Passwordless Connections.

Manage hooks

You can create, update, delete, enable/disable, and view Hooks from the Dashboard or Management API. To learn more, read:

You can also import and export hooks using the Deploy Command-Line Interface (CLI) tool. To learn more, read Deploy CLI Tool.

Handle Rate Limits when calling APIs from within Hooks

If you call Auth0 APIs from within a Hook's script, you will need to handle rate limits. To do so, check the X-RateLimit-Remaining header and act appropriately when the number returned nears 0.

Additionally, add logic to handle cases in which you exceed the provided rate limits and receive the 429 HTTP Status Code (Too Many Requests). In this case, if a re-try is needed, it is best to allow for a back-off to avoid going into an infinite retry loop.

Manage hook secrets

Hooks feature integrated secret management to securely store secrets while making them conveniently available in code. To learn more, read Hook Secrets.

Test hooks

The Hooks editor in the Dashboard has an integrated Runner, which allows you to test your code without leaving the editor.

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

View logs

You can view real-time logging information for specific configured Hooks using the Dashboard. To learn more, read View Logs for Hooks.

Learn more