Send Orb events to Tinybird¶
Orb is a developer-focused platform to manage your subscription billing and revenue operations. By integrating Orb with Tinybird, you can analyze your subscription billing data in real time and enrich it with other data sources.
Some common use cases for sending Orb events to Tinybird include:
- Tracking and monitoring subscriptions.
- Monitoring user churn.
- Creating custom dashboards for subscription analysis.
- Subscriptions logs.
Read on to learn how to send events from Orb to Tinybird.
Before you start¶
Before you connect Orb to Tinybird, ensure:
- You have an Orb account.
- You have a Tinybird Workspace.
Connect Orb to Tinybird¶
From the Orb dashboard, select Developers > Webhooks.
Select Add Endpoint.
In Tinybird, create a Data Source, called
orb
in this example, with the following schema:
SCHEMA > `id` String `json:$.id`, `type` LowCardinality(String) `json:$.type` DEFAULT 'unknown', `date` DateTime64(3) `json:$.created_at` DEFAULT now(), `resource_name` LowCardinality(String) `json:$.resource_name` DEFAULT 'unknown', `details` JSON `json:$.properties` DEFAULT '{}' ENGINE "MergeTree" ENGINE_PARTITION_KEY "toYYYYMM(date)" ENGINE_SORTING_KEY "type, resource_name, date"
Using the JSON Data Type you can store the semi-structured data you receive from Orb in a single column. You can later retrieve various events and their metadata as needed in your Pipes.
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.
Back in Orb, 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=orb&token=<your user token>
Replace the Tinybird API hostname or region with the API region that matches your Workspace.
Select Send test request to test the connection and check the data gets to the
orb
Data Source in Tinybird.You're done. Any of the Orb events is automatically sent to Tinybird through the Events API.
You can check the status of the integration by clicking on the Webhook endpoint in Orb or from the Log tab in the Tinybird orb
Data Source.