Skip to content

Installation & quickstart

beepr is not published to npm yet. Install it from GitHub:

Terminal window
pnpm add github:techmefr/beepr

Create an adapter and emit events through the returned handler:

Terminal window
import { createNotify } from 'beepr'
const notify = createNotify({
onRequest: ({ resource }) => console.log('Loading', resource),
onSuccess: data => console.log('Loaded', data),
onError: error => console.error(error.message),
})
notify('request', { resource: 'products' })
notify('success', [{ id: 1, name: 'Sample' }])
notify('error', { message: 'Could not load products' })

Only implement the callbacks you need. beepr routes each event name to its callback. Your application decides when to emit.

Next: events and adapters, redaction, handler composition or the debug channel.