Arke
Build

Events & Sync

How Arke's event system works for real-time sync and change tracking.

Overview

Arke emits events when entities are created, updated, or deleted. Events are stored in D1 and can be consumed for real-time sync, webhooks, and audit trails.

Event Types

EventTriggered When
entity.createdNew entity is created
entity.updatedEntity is updated (new version)
entity.deletedEntity is tombstoned
relationship.addedRelationship is added
relationship.removedRelationship is removed

Consuming Events

GET /events?since=2026-01-28T00:00:00Z
Authorization: Bearer <token>

Query Parameters

ParameterDescription
sinceISO 8601 timestamp -- return events after this time
collection_idFilter events by collection
typeFilter by event type
limitMaximum events to return

Event Sharding

Events are stored in monthly D1 databases (D1_API_EVENTS_MAIN_2026_01, etc.) for performance and cost management. The API transparently routes to the correct database based on the query timeframe.

On this page