Actions NPM - Auth0 Docs
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
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
eventandapiobjects 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
eventandapiobjects 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
Write Your Action Using Your Code Editor \ \ Install the official @auth0/actions NPM package as a dev dependency to add TypeScript type definitions, IntelliSense, and error checking when writing and unit testing Auth0 Actions by trigger and version in external editors.