Getting Started
Connect to a Qubic node and receive live tick updates in under fifteen lines.
Create and connect a Bob client
Pass autoResubscribe: true so your subscriptions survive reconnects automatically.
import { createBobClient } from "@qubic.org/bob"
const bob = createBobClient({ autoResubscribe: true })
await bob.connect()Subscribe to live tick updates
import { createBobClient } from "@qubic.org/bob"
const bob = createBobClient({ autoResubscribe: true })
await bob.connect()
bob.subscribe("tickInfo", (tick, meta) => {
if (meta.isCatchUp) return // skip buffered ticks from reconnect gap
console.log(`Tick ${tick.tick} — epoch ${tick.epoch}`)
})
process.on("SIGINT", async () => {
await bob.disconnect()
process.exit(0)
})