announcements

Discover User Lifecycle Changes via Event Streams – Now in Early Access

Help enable your systems to respond to user lifecycle changes asynchronously, at scale, and across your entire tech stack.

Imagine knowing the exact moment when a user signs up, updates their profile, or deletes their account—and being able to instantly react to them. With Auth0's new Event Streams, now in Early Access, that level of near real-time identity awareness is finally possible!

As a new addition to the Auth0 Extensibility offering, Event Streams enables developers to subscribe to user lifecycle events—delivered as they happen—via Webhooks or Amazon EventBridge. Whether it’s syncing data to your CRM, triggering downstream processes, or keeping your user records accurate across platforms, Event Streams makes it easy to stay aligned with user identity changes.

The Challenge: Keeping Up with Identity Changes

Understanding user behaviors and ensuring your systems reflect user lifecycle changes is business critical. Each time a user-related event occurs—signing up, changing an email, or unsubscribing from a service—that change often needs to be replicated in your internal systems or used to trigger downstream updates in third-party platforms. Missing or delaying these signals can lead to issues such as out-of-date customer records in CRMs, missed billing updates, delayed onboarding or offboarding, and inaccurate analytics and personalization.

The challenge is that these changes don’t happen in just one way, making it difficult to capture user lifecycle events across every method Auth0 supports. Consider user creation alone, which can happen through a variety of ways, such as a signup page, the Management API, SCIM, JIT provisioning via Social, or Passwordless connections. As a result, developers often had to build workarounds and accept data latency or gaps in coverage.

Introducing User Life Cycle Events Delivered via Event Streams

Auth0 Event Streams was built specifically to solve these gaps. Event Streams makes it easier than ever to discover completed changes in Auth0 as they happen, in order to synchronize, correlate, and orchestrate these changes to your broader technology ecosystem.

Life Cycle Events

With Event Streams, customers can now subscribe to a set of clear structured events

user.created,
user.updated
, and
user.deleted
—that are triggered whenever a change to a user occurs in Auth0, regardless of how it was initiated. These Events can be routed to Webhooks or Amazon EventBridge, allowing you to build event-driven workflows around user identity. Whether you need to update your CRM, kick off a billing process, notify an internal system, or sync changes to a data warehouse, Event Streams provides a reliable and scalable foundation.

Here’s an example of how you can receive the

user.created
event and store it in a database.

const express = require('express');
const app = express();

// Authorization middleware
app.use((req, res, next) => {
  const token = req.headers["authorization"];
  if (token !== `Bearer ${API_TOKEN}`) {
    return res.status(401).json({ error: "Unauthorized" });
  }
  next();
});

// Webhook endpoint
app.post("/webhook", async (req, res) => {
  console.log("Webhook received:", JSON.stringify(req.body, null, 2));

  const eventData = req.body;
  const { id, type, time, data } = eventData;
  const user = data.object;

  try {
    switch (type) {
      case "user.created":
        await handleUserCreated(user, time);
        break;
      case "user.updated":
        await handleUserUpdated(user, time);
        break;
      case "user.deleted":
        await handleUserDeleted(user, time);
        break;
      default:
        await handleDefaultEvent(id, type, time, data);
    }

    console.log(`Webhook event of type '${type}' committed to the database.`);
    res.sendStatus(204);
  } catch (err) {
    console.error("Error processing webhook:", err);
    res.status(500).json({ error: "Internal server error" });
  }
});

// Specific function for handling the user created event
// In this example we're making sure users are also created in our own database
async function handleUserCreated(user, time) {
  const { user_id, email, name, nickname, created_at, updated_at } = user;

  const query = `
    INSERT INTO users (user_id, email, name, nickname, created_at, updated_at, raw_user, last_event_processed)
    VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
  `;
  const values = [
    user_id,
    email,
    name,
    nickname,
    created_at,
    updated_at,
    user,
    time,
  ];

  try {
    await getPool().query(query, values);
  } catch (err) {
    if (err.code === "23505") {
      console.error(`Duplicate user_id=${user_id}, skipping insert.`);
    } else {
      console.error(`Database error while creating user_id=${user_id}:`, err);
      throw err;
    }
  }
}

A key part of this is the event delivery behavior. Event Streams sends events in near real-time—typically within milliseconds or seconds of occurrence. Importantly, it also allows customers to visualize delivery failures and recover asynchronously. If an event can’t be delivered, Event Streams will retry automatically for a period of time without interrupting the delivery of new events that follow. Customers can monitor the status of these retries and initiate manual retries if needed, without the need to make synchronous API calls to recover.

Event Streams allows customers to:

  • Enhance identity data consistency and system resilience: Maintain a single source of truth by synchronizing identity updates across connected systems.
  • Improve end-user experience: Help ensure users have the right access, permissions, and up-to-date cross-channel experiences
  • Increase developer agility: Faster time-to-market and reduce operational burden

event-flow

To learn more, visit the Auth0 Docs.

Getting Started

Watch this demo to see how to use the Auth0 CLI to subscribe to user lifecycle events, deliver them via Webhook, and test the stream by creating a user via the Manage Dashboard or Management API.

The feature can be configured via API, CLI and front-end through the Auth0 Management Dashboard. In addition, we’re actively enriching Event Streams features to better support user needs, including:

  • Upcoming events: organization and session events
  • Upcoming event destinations: Auth0 Actions, Azure Grid, and integrations with other developer platforms
  • New features to streamline integration and monitoring of Event Streams, such as event delivery metrics, Terraform-based Event Stream provisioning, enhanced event testing tools, etc.