Skip to main content

The @auth0/actions NPM package is the official TypeScript and JavaScript definitions library for Auth0 Actions. It gives you IDE support, type checking, and structure when writing Actions in your own code editor, outside of the Auth0 Dashboard.

Benefits

  • IDE/Code Editor Assistance: Get autocompletion, inline documentation, and type hints for the event and api objects in your Actions.
  • TypeScript Development: Write Actions in TypeScript with full type safety, catching errors before deployment.
  • Unit Testing Improvements: Use the included type definitions to build accurate mocks of the event and api objects for your tests.
  • AI Actions Generation: Provide better context to AI coding assistants, improving the quality of generated Action code.

How it works

Install @auth0/actions as a dev dependency in your project, then import its types to write Actions code outside the Auth0 Dashboard. The package ships type definitions for the event and api objects Auth0 passes into your Action at runtime, so your editor can validate the shape of that data as you write. Because the types match what the Dashboard runtime provides, an Action written and type-checked locally behaves the same way once deployed.
The @auth0/actions package is open source. You can find the source code, report issues, or contribute at auth0/auth0-actions.

Examples

To start using the package, see Write Your Action Using Your Code Editor.