Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
default (BuzzCastingStorageManager)
✓ import BuzzCastingStorageManager from 'buzzcasting-storage'
✗ const BuzzCastingStorageManager = require('buzzcasting-storage')
ESM-only package; default export is named class.
IStorageManager
✓ import { IStorageManager } from 'buzzcasting-storage'
✗ import { StorageManager } from 'buzzcasting-storage'
TypeScript interface exported as named export.
IMessages
✓ import { IMessages } from 'buzzcasting-storage'
TypeScript interface for message data.
IQuery
✓ import { IQuery } from 'buzzcasting-storage'
TypeScript interface for query parameters.
Initializes the storage manager with options, fetches messages for a widget, and listens for updates via BroadcastChannel.
import BuzzCastingStorageManager, { IStorageManager, IQuery, IMessages } from 'buzzcasting-storage';
const options: IStorageManager = {
app: 'my-subdomain',
version: 'v4',
token: process.env.BUZZCAST_TOKEN ?? '',
bearer: process.env.BUZZCAST_BEARER ?? '',
storage: 'dexie',
moderation: 'none',
beforeTime: null,
delay: 0,
period: 0,
};
const manager = new BuzzCastingStorageManager(options);
const query: IQuery = {
type: 'messages',
dashboard: 'dashboard_id',
widget: 'widget_id',
};
const data: IMessages = manager.getMessages(query);
console.log('Messages:', data);
const channel = new BroadcastChannel('my-subdomain');
channel.onmessage = (event: MessageEvent) => {
if (event.data.event === 'widget-update') {
console.log('Widget updated:', event.data.data);
}
};
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'getMessages')
Storage manager not instantiated correctly (missing new or wrong import).
fixUse: import BuzzCastingStorageManager from 'buzzcasting-storage'; const manager = new BuzzCastingStorageManager(options);
Module not found: Can't resolve 'buzzcasting-storage'
Package not installed or bundler misconfiguration.
fixRun: npm install buzzcasting-storage
Audit
Dependencies
idb-keyvaloptionaloptional IndexedDB storage backend
dexieoptionaloptional IndexedDB storage backend