From f825d07e0778b7450313a9d00518234f4d2f036f Mon Sep 17 00:00:00 2001 From: Nick Gagliardi <133918568+nick-gagliardi@users.noreply.github.com> Date: Fri, 5 Dec 2025 11:41:20 -0500 Subject: [PATCH 1/5] Update create-an-event-stream.mdx --- .../events/create-an-event-stream.mdx | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/main/docs/customize/events/create-an-event-stream.mdx b/main/docs/customize/events/create-an-event-stream.mdx index 6a6713887..ff077bb38 100644 --- a/main/docs/customize/events/create-an-event-stream.mdx +++ b/main/docs/customize/events/create-an-event-stream.mdx @@ -586,6 +586,97 @@ terraform apply -var="webhook_endpoint_url=https:///webhook" After the stream is active, you can test the event stream. For more information, review [**Event Testing, Observability, and Failure Recovery**](/docs/customize/events/event-testing-observability-and-failure-recovery). +## Auth0 Actions + +The information below describes how you can create and enable an event stream using Auth0 Actions. + + +### Create an event stream (Actions) + + + +Event streams allow you to capture real-time changes within your Auth0 tenant and send them to an external system for processing. + +Before setting up an event stream, you need to identify the [event types](/docs/customize/events/event-types) you want to monitor. This example uses the Auth0 CLI to create an event stream that subscribes to the `user.created` event, which triggers whenever a new user is registered in your tenant. + +```bash wrap lines +auth0 events create \ + --name "user-lifecycle-action" \ + --type "action" \ + --subscriptions "user.created" \ + --configuration '{"status":"enabled","code":"exports.onExecuteEventStream = async (event, api) => { console.log(event.message.type); };"}'``` +``` + + +If successful, this call returns the following JSON with your event stream `id`. New event streams are enabled by default. + +```json lines +{ + "id": "est_abc123...", + "name": "user-lifecycle-action", + "status": "enabled", + "subscriptions": [ + { "event_type": "user.created" } + ], + "destination": { + "type": "action", + "configuration": { + "action_binding_id": "act_xyz789...", + "status": "enabled" + } + } +} +``` + + + + +To create an event stream in the Auth0 Dashboard using Auth0 Actions: + +1. Navigate to **Auth0 Dashboard** > **Monitoring** > **Event Streams** . +2. From the list of stream types, select **+Auth0 Actions**. This will open the configuration form for your new Auth0 Actions stream. +4. **Configure Stream Details:** In the configuration form, you will need to provide the following information: + + * **Stream Name:** + + Enter a descriptive name for your event stream. This will help you identify it within the Auth0 Dashboard. + +5. **Select Event Types:** In the **Select Event Types** section, choose the specific Auth0 event types you want to include in this stream. You can select multiple event types based on your requirements (e.g., `Created`, `Updated`, `Deleted`). +6. In the **Action Editor**, write your handler code. The system requires the `onExecuteEventStream` function. You can use the `api` object to manage success or failure states. +```javascript +/** + * Handler that will be called during the execution of an Event Stream. + * @param {Event} event - Details about the Cloud Event. + * @param {EventStreamAPI} api - Interface whose methods can be used to handle the event. + */ +exports.onExecuteEventStream = async (event, api) => { + const eventType = event.message.type; + const eventData = event.message.data; + + console.log(`Received event: ${eventType}`); + + // Custom Logic: e.g., Send data to an external API + // await axios.post('https://my-crm.com/ingest', eventData); + + // FAILURE HANDLING: + // To trigger a retry, either throw an error or use api.message.fail() + if (!eventData) { + // api.message.fail('No data received'); + throw new Error('No data received'); + } + + // SUCCESS: + // If the function ends without error, the event is marked delivered. +}; +``` +7. **Save Changes:** Once you have configured the stream name and Action handler, the system will automatically create the Action, bind it to a stream, and enable it. + +Your new event stream is now created, and Auth0 can begin publishing the selected event types to the specified Auth0 Action. You can monitor the status and manage your event stream from the Event Streams (Early) page in the Auth0 Dashboard. + + + + + ## Learn more * [Event Types](/docs/customize/events/event-types) From b2e04985f4ea1a19dc90d49910396a7f3af50795 Mon Sep 17 00:00:00 2001 From: Nick Gagliardi <133918568+nick-gagliardi@users.noreply.github.com> Date: Fri, 5 Dec 2025 13:51:21 -0500 Subject: [PATCH 2/5] Update create-an-event-stream.mdx --- main/docs/customize/events/create-an-event-stream.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main/docs/customize/events/create-an-event-stream.mdx b/main/docs/customize/events/create-an-event-stream.mdx index ff077bb38..bb47c084c 100644 --- a/main/docs/customize/events/create-an-event-stream.mdx +++ b/main/docs/customize/events/create-an-event-stream.mdx @@ -632,9 +632,9 @@ If successful, this call returns the following JSON with your event stream `id`. To create an event stream in the Auth0 Dashboard using Auth0 Actions: - -1. Navigate to **Auth0 Dashboard** > **Monitoring** > **Event Streams** . -2. From the list of stream types, select **+Auth0 Actions**. This will open the configuration form for your new Auth0 Actions stream. +1. Navigate to **Auth0 Dashboard** > **Event Streams (Early)**. +2. Select **+Create Event Stream**. . +3. From the list of stream types, select **+Auth0 Actions**. This will open the configuration form for your new Auth0 Actions stream. 4. **Configure Stream Details:** In the configuration form, you will need to provide the following information: * **Stream Name:** From 305a3756e8eb08e537b7d4dba12902143e868e55 Mon Sep 17 00:00:00 2001 From: Nick Gagliardi <133918568+nick-gagliardi@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:37:47 -0500 Subject: [PATCH 3/5] Update create-an-event-stream.mdx --- main/docs/customize/events/create-an-event-stream.mdx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/main/docs/customize/events/create-an-event-stream.mdx b/main/docs/customize/events/create-an-event-stream.mdx index bb47c084c..965c948fa 100644 --- a/main/docs/customize/events/create-an-event-stream.mdx +++ b/main/docs/customize/events/create-an-event-stream.mdx @@ -612,18 +612,9 @@ If successful, this call returns the following JSON with your event stream `id`. ```json lines { - "id": "est_abc123...", - "name": "user-lifecycle-action", - "status": "enabled", - "subscriptions": [ - { "event_type": "user.created" } - ], - "destination": { - "type": "action", "configuration": { "action_binding_id": "act_xyz789...", "status": "enabled" - } } } ``` From 79ffa8991e638a7d6bfcee53835d9a9dff1ffa3e Mon Sep 17 00:00:00 2001 From: Nick Gagliardi <133918568+nick-gagliardi@users.noreply.github.com> Date: Mon, 8 Dec 2025 11:38:51 -0500 Subject: [PATCH 4/5] Update create-an-event-stream.mdx --- main/docs/customize/events/create-an-event-stream.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/docs/customize/events/create-an-event-stream.mdx b/main/docs/customize/events/create-an-event-stream.mdx index 965c948fa..a171e4e56 100644 --- a/main/docs/customize/events/create-an-event-stream.mdx +++ b/main/docs/customize/events/create-an-event-stream.mdx @@ -613,7 +613,7 @@ If successful, this call returns the following JSON with your event stream `id`. ```json lines { "configuration": { - "action_binding_id": "act_xyz789...", + "action_id": "act_xyz789...", "status": "enabled" } } From e1cadf554b41611899a28d2b35e234fbb57adc95 Mon Sep 17 00:00:00 2001 From: Nick Gagliardi <133918568+nick-gagliardi@users.noreply.github.com> Date: Tue, 9 Dec 2025 14:10:02 -0500 Subject: [PATCH 5/5] Update create-an-event-stream.mdx --- main/docs/customize/events/create-an-event-stream.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main/docs/customize/events/create-an-event-stream.mdx b/main/docs/customize/events/create-an-event-stream.mdx index a171e4e56..e9cb33ac0 100644 --- a/main/docs/customize/events/create-an-event-stream.mdx +++ b/main/docs/customize/events/create-an-event-stream.mdx @@ -597,7 +597,7 @@ The information below describes how you can create and enable an event stream us Event streams allow you to capture real-time changes within your Auth0 tenant and send them to an external system for processing. -Before setting up an event stream, you need to identify the [event types](/docs/customize/events/event-types) you want to monitor. This example uses the Auth0 CLI to create an event stream that subscribes to the `user.created` event, which triggers whenever a new user is registered in your tenant. +Before setting up an event stream, you need to identify the [event types](/docs/customize/events/event-types) you want to monitor. This example uses the Auth0 CLI to create an event stream that subscribes to the `user.created` event, which triggers whenever your tenant registers a new user. ```bash wrap lines auth0 events create \ @@ -625,8 +625,8 @@ If successful, this call returns the following JSON with your event stream `id`. To create an event stream in the Auth0 Dashboard using Auth0 Actions: 1. Navigate to **Auth0 Dashboard** > **Event Streams (Early)**. 2. Select **+Create Event Stream**. . -3. From the list of stream types, select **+Auth0 Actions**. This will open the configuration form for your new Auth0 Actions stream. -4. **Configure Stream Details:** In the configuration form, you will need to provide the following information: +3. From the list of stream types, select **+Auth0 Actions**. This opens the configuration form for your new Auth0 Actions stream. +4. **Configure Stream Details:** In the configuration form, you need to provide the following information: * **Stream Name:** @@ -660,7 +660,7 @@ exports.onExecuteEventStream = async (event, api) => { // If the function ends without error, the event is marked delivered. }; ``` -7. **Save Changes:** Once you have configured the stream name and Action handler, the system will automatically create the Action, bind it to a stream, and enable it. +7. **Save Changes:** Once you have configured the stream name and Action handler, the system automatically creates the Action, bind it to a stream, and enables it. Your new event stream is now created, and Auth0 can begin publishing the selected event types to the specified Auth0 Action. You can monitor the status and manage your event stream from the Event Streams (Early) page in the Auth0 Dashboard.