@snagtag/adapter-local
v0.2.1
Published
IndexedDB/localStorage storage backend for SnagTag. Zero dependencies - works offline.
Readme
@snagtag/adapter-local
IndexedDB/localStorage storage backend for SnagTag. Zero dependencies - works offline.
Install
npm install @snagtag/adapter-local @snagtag/coreUsage
import { createLocalAdapter } from '@snagtag/adapter-local'
const adapter = createLocalAdapter({
dbName: 'snagtag', // IndexedDB database name (default: 'snagtag')
tenantId: 'optional', // tenant scoping
userId: 'optional', // session ownership
})Features
- Reports, groups, and sessions stored in IndexedDB
- Screenshots stored as Blobs in IndexedDB
- Auto-incrementing report numbers
- Change events via CustomEvent (React Query cache invalidation)
- Zero external dependencies
- Works offline
When to use
- Local development without a backend
- Prototyping and demos
- Offline-first applications
- Quick setup with no infrastructure
License
MIT
