createTarget
Create a data sink.write: Write functionasync ({ctx, read}) => void(required)fork: Fork handlerasync (previousBlocks: BlockCursor[]) => BlockCursor | null(optional)
clickhouseTarget
ClickHouse target with automatic cursor management.client: ClickHouse client instance (required)settings: Configuration options (optional)onStart: Initialization handlerasync ({store, logger}) => void(optional)onData: Data handlerasync ({store, data, ctx}) => void(required)onRollback: Rollback handlerasync ({store, safeCursor, type}) => void(optional)type:'offset_check'|'blockchain_fork'safeCursor: The safe block cursor to roll back tocursor: Deprecated, usesafeCursorinstead
drizzleTarget
Drizzle ORM target for PostgreSQL with automatic cursor management and rollback support.db: Drizzle database instance (required)tables: Array of tables used for snapshot tracking (required)onStart: Initialization handlerasync ({db}) => void(optional)onData: Data handlerasync ({tx, data, ctx}) => void(required)onBeforeRollback: Pre-rollback handlerasync ({tx, cursor}) => void(optional)onAfterRollback: Post-rollback handlerasync ({tx, cursor}) => void(optional)settings: Configuration object (optional)state: State options for cursor trackingtransaction.isolationLevel:'read uncommitted'|'read committed'|'repeatable read'|'serializable'
The Drizzle target automatically handles cursors and rollbacks. See the Postgres (Drizzle) Integration guide for complete examples.
Context & Utilities
Types and utilities available in target handlers.Context
The context object available in target write handlers.Logger
The logger interface is Pino-compatible, allowing integration with any Pino transport for sending logs to external services like GCP Cloud Logging, Sentry, or other monitoring platforms.You can use the logger as a drop-in replacement for standard Pino loggers. See the Custom Logging section for integration examples.

