Send Auth0 Logs Streams to Tinybird

Auth0 is a developer-focused user management platform to handle user authentication with many prebuilt UI components. By integrating Auth0 with Tinybird, you can analyze your user authentication data in real time and enrich it with other data sources.

Some common use cases for sending Auth0 logs to Tinybird include:

  1. Tracking net user and organization growth.
  2. Monitoring user churn.
  3. Identifying common auth errors.
  4. Creating custom dashboards for auth analysis.
  5. User authentication audit logs.

Read on to learn how to send data from Auth0 Logs Streams to Tinybird.

Before you start

Before you connect Auth0 Logs Streams to Tinybird, ensure:

  • You have an Auth0 account.
  • You have a Tinybird Workspace.

Connect Auth0 to Tinybird

  1. From the Auth0 dashboard, select Monitoring > Streams.

  2. Select Create Stream.

  3. In Tinybird, create a Data Source, called auth0. You can follow this schema:

SCHEMA >
    `event_time` DateTime64(3) `json:$.tinybirdIngestTime` DEFAULT now(),
    `event_type` String `json:$.data.type` DEFAULT 'unknown',
    `event` JSON `json:$` DEFAULT '{}'

ENGINE "MergeTree"
ENGINE_PARTITION_KEY "toYYYYMM(event_time)"
ENGINE_SORTING_KEY "event_time"

Using the JSON Data Type you can store the semi-structured data you receive from Auth0 Logs Streams in a single column. You can later retrieve various events and their metadata as needed in your Pipes.

  1. In Tinybird, copy a token with privileges to append to the Data Source you created. You can use the admin token or create one with the required scope.

  2. Back in Auth0, paste the Events API URL in your Webhook Endpoint URL. Use the query parameter name to match the name of the Data Source you created in Tinybird. For example:

https://api.tinybird.co/v0/events?name=auth0&token=<your user token>

Replace the Tinybird API hostname or region with the API region that matches your Workspace.

Content Type is application/json and Content Format is JSON Lines.

  1. Select the any event category to filter, like All, and a date in case you want to perform some backfilling. Then select Save.

  2. You're done. Any of the Auth0 Log Streams events you selected is automatically sent to Tinybird through the Events API.

You can check the status of the integration from the Health tab in the created webhook or from the Log tab in the Tinybird auth0 Data Source.

See also

Updated