Skip to content

Rivora documentation

Everything you need to collect, shape, route and rewind events, from your first emit() call to running Rivora in production.

Introduction

Rivora is event infrastructure for product teams. It collects events from your apps and services, shapes them with plain TypeScript in your repo, routes them to every tool your team uses, and keeps a full history you can rewind.

Quickstart

You need a Rivora workspace and an ingest key. Create a workspace from the free plan, then copy the key from Settings → Keys.

  1. Install the SDK

    Rivora ships one SDK for browsers and Node. Other platforms are listed on the SDKs page.

    $npm install @rivora/sdk
  2. Initialise and track an event

    Keep the client in one module and import it wherever you track.

    app/analytics.ts
    import { Rivora } from "@rivora/sdk";
    
    export const rivora = new Rivora({
      ingestKey:
        process.env.RIVORA_INGEST_KEY,
      environment: "production",
    });
    
    rivora.emit("signup.completed", {
      userId: "usr_2481",
      plan: "growth",
    });
  3. Watch it arrive

    Open Pipelines → Live events in the console. Events show up within a second, along with every destination they were delivered to.

Tip: use environment: "preview" in pull request deploys. Preview events are kept separate and never reach production destinations.

Core concepts

Everything in Rivora is one of five things. Each lives as code in a rivora/ folder in your repository and is deployed with rivora deploy.

ConceptWhat it does
SourceWhere events come from: an SDK, a webhook or a database.
SchemaThe versioned shape of one event name.
TransformA TypeScript function that enriches, redacts or drops events.
RouteWhich destinations receive which events, and under what conditions.
DestinationA tool, database or endpoint that receives events.

Sources

Sources are typed by your schemas. A misspelled event name or a missing property is a compile error in your editor, not a silent gap in a dashboard. Server sources can set timestamp explicitly; client sources use the time the event was created on the device.

  • SDKs batch events and retry with back-off when the network drops.
  • Inbound webhooks are verified with your provider's signing secret.
  • Database sources stream row changes from the write-ahead log, in commit order.

Transforms

Transforms are plain functions. They get one event and return a new one, an array of events, or null to drop it. They are tested like the rest of your code and deployed with it.

rivora/transforms/enrich.ts
import { transform }
  from "@rivora/sdk";

// Runs on every checkout event,
// before it is routed
export default transform(
  "checkout.completed",
  (event) => ({
    ...event,
    amountUsd: event.amount / 100,
    // never leaves Rivora
    email: undefined,
  })
);
Keep transforms pure. Network calls from a transform slow every event down. Use a lookup table or a destination function instead.

Destinations

Pick from 120+ managed destinations or write a custom function. Every destination gets ordered delivery per user, retries for up to 72 hours, and a dead-letter view for events that could not be delivered.

Schemas

Schemas describe each event and are versioned with your code. Breaking changes are flagged in pull requests by the Rivora GitHub check.

rivora/schemas/checkout.ts
import { schema, t }
  from "@rivora/sdk";

export default schema(
  "checkout.completed",
  {
    orderId: t.string(),
    amount: t.number().int(),
    currency: t.enum([
      "USD", "EUR",
    ]),
    plan: t
      .enum([
        "hobby",
        "growth",
        "enterprise",
      ])
      .optional(),
  }
);

Monitoring

Each pipeline shows throughput, delivery latency and error rate per destination. Set alerts on any of them and route the alert to chat, email or your pager. Delivery logs are kept for the history period your plan includes.

Environments

Workspaces have production, staging and preview environments by default. Each one has its own keys, destinations and history, and you can promote a pipeline from one to the next.

CLI

The CLI links a repository to a workspace, runs transforms locally against recorded events and deploys your rivora/ folder.

terminal
# log in and link this repo
$ rivora login
$ rivora link acme/production

# test transforms on real events
$ rivora dev --record 500

# ship pipelines and schemas
$ rivora deploy --env production