You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
588
588
589
+
## Auth0 Actions
590
+
591
+
The information below describes how you can create and enable an event stream using Auth0 Actions.
592
+
593
+
594
+
### Create an event stream (Actions)
595
+
596
+
<Tabs><Tabtitle="Management API">
597
+
598
+
Event streams allow you to capture real-time changes within your Auth0 tenant and send them to an external system for processing.
599
+
600
+
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.
If successful, this call returns the following JSON with your event stream `id`. New event streams are enabled by default.
612
+
613
+
```json lines
614
+
{
615
+
"configuration": {
616
+
"action_id": "act_xyz789...",
617
+
"status": "enabled"
618
+
}
619
+
}
620
+
```
621
+
622
+
623
+
</Tab><Tab title="Dashboard">
624
+
625
+
To create an event stream in the Auth0 Dashboard using Auth0 Actions:
626
+
1. Navigate to **Auth0 Dashboard**>**Event Streams (Early)**.
627
+
2. Select **+Create Event Stream**. .
628
+
3. From the list of stream types, select**+Auth0 Actions**. This opens the configuration form for your new Auth0 Actions stream.
629
+
4. **Configure Stream Details:** In the configuration form, you need to provide the following information:
630
+
631
+
***Stream Name:**
632
+
633
+
Enter a descriptive name for your event stream. This will help you identify it within the Auth0 Dashboard.
634
+
635
+
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 selectmultiple event types based on your requirements (e.g., `Created`, `Updated`, `Deleted`).
636
+
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.
637
+
```javascript
638
+
/**
639
+
* Handler that will be called during the execution of an Event Stream.
640
+
* @param {Event} event - Details about the Cloud Event.
641
+
* @param {EventStreamAPI} api - Interface whose methods can be used to handle the event.
// To trigger a retry, either throw an error or use api.message.fail()
654
+
if (!eventData) {
655
+
// api.message.fail('No data received');
656
+
throw new Error('No data received');
657
+
}
658
+
659
+
// SUCCESS:
660
+
// If the functionends without error, the event is marked delivered.
661
+
};
662
+
```
663
+
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.
664
+
665
+
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.
0 commit comments