honolytics

API Reference

Complete API documentation for React hooks and storage adapters.

Comprehensive documentation for all honolytics APIs, organized by functionality.

React Hooks API

React hooks for building analytics dashboards with caching, polling, and error handling.

Storage API

Storage adapters for persisting analytics data without external APIs.

  • Local Storage — Browser localStorage adapter ✅ Production Ready
  • IndexedDB — Browser IndexedDB adapter ✅ Production Ready
  • PostgreSQL — PostgreSQL database adapter ⚠️ Needs Testing
  • Turso — Turso SQLite adapter ⚠️ Needs Testing
  • SQLite — SQLite adapter ❌ Not Implemented
  • Storage Types & InterfaceTAdapter, TEvent, and type definitions

Quick Reference

Basic Usage

import { HonolyticsProvider, useAnalytics } from 'honolytics'

// HTTP Mode
<HonolyticsProvider apiKey="key" endpoint="/api/metrics">
  <App />
</HonolyticsProvider>

// Storage Mode
<HonolyticsProvider storageMode={true}>
  <App />
</HonolyticsProvider>

// In components
const { data, loading, error, refetch } = useAnalytics()

Storage Setup

import { initStorage, local, postgres } from 'honolytics/storage'

// Browser storage
await initStorage(local())

// Database storage
await initStorage(postgres({ url: 'postgresql://...' }))

Implementation Status

ComponentStatusNotes
React Hooks✅ CompleteFull implementation with caching, polling, error handling
Local Storage✅ CompleteProduction-ready browser storage
IndexedDB✅ CompleteProduction-ready browser database
PostgreSQL⚠️ PartialImplementation complete, needs testing
Turso⚠️ PartialImplementation complete, needs testing
SQLite❌ StubRequires better-sqlite3 dependency
Backend API❌ MissingNo /metrics endpoint implementation
Tracking SDK❌ MissingNo event tracking implementation