Skip to content

AlgoKit Subscriber TypeScript

Subscribe to the Algorand blockchain with a simple, flexible TypeScript library
Terminal window
npm install @algorandfoundation/algokit-subscriber
import { AlgorandSubscriber } from '@algorandfoundation/algokit-subscriber'
import { TransactionType } from '@algorandfoundation/algokit-utils/transact'
const subscriber = new AlgorandSubscriber(
{
filters: [
{
name: 'filter1',
filter: {
type: TransactionType.pay,
sender: 'ABC...',
},
},
],
/* ... other options (use intellisense to explore) */
},
algod,
optionalIndexer,
)
// Set up subscription(s)
subscriber.on('filter1', async (transaction) => {
// ...
})
// Set up error handling
subscriber.onError((e) => {
// ...
})
// Either: Start the subscriber (if in long-running process)
subscriber.start()
// OR: Poll the subscriber (if in cron job / periodic lambda)
subscriber.pollOnce()

Real-time Subscriptions

Subscribe to transactions at the tip of the chain with low-latency processing.

Indexing & Catchup

Build indexes from the beginning of the chain with fast indexer catchup.

ARC-28 Events

Subscribe to and process ARC-28 events from smart contract calls.

Resilient Watermarking

Persist watermarks for reliable at-least-once delivery across outages.