nana800-analytics
v1.0.1
Published
Official JavaScript/TypeScript SDK for Nana800 Analytics - a powerful analytics and telemetry service similar to Amplitude.
Maintainers
Readme
Nana800 Analytics from NANA800.io 📊
Official JavaScript/TypeScript SDK for Nana800 Analytics - a powerful analytics and telemetry service similar to Amplitude.
Track events, identify users, and analyze behavior in your web applications with ease. Nana800 Analytics provides a simple, reliable, and cost-effective alternative to services like Amplitude, Mixpanel, and Google Analytics.
Detail Documentation
Why Nana800 Analytics?
- 🚀 Fast & Lightweight - Minimal bundle size, maximum performance
- 💰 Cost-Effective - Affordable pricing compared to alternatives
- 🔒 Privacy-Focused - Your data stays on your infrastructure
- 📊 Powerful Insights - Real-time analytics and user behavior tracking
- 🛠 Easy Integration - Simple API, works with any JavaScript framework
- 🌍 Self-Hosted Option - Full control over your analytics data
- 🔧 Cross-Platform - Works on Web, React Native, Node.js, Electron, and more
Supported Platforms
| Platform | Support | Storage | Notes | |----------|---------|---------|-------| | 🌐 Web (Browser) | ✅ Full | localStorage | Works out of the box | | ⚛️ React Native | ✅ Full | AsyncStorage | Requires AsyncStorage adapter | | 🖥 Electron | ✅ Full | localStorage | Auto-detected | | 🟢 Node.js | ✅ Full | Memory only | Server-side tracking | | ⚡️ Next.js | ✅ Full | localStorage | SSR compatible | | 📱 Expo | ✅ Full | AsyncStorage | Same as React Native | | 🎯 Vue.js | ✅ Full | localStorage | Works as standard web | | ⚙️ Angular | ✅ Full | localStorage | Works as standard web | | 🔷 TypeScript | ✅ Full | - | Full type definitions included |
Installation
npm install nana800-analyticsor
yarn add nana800-analyticsQuick Start
Web / Next.js / Browser
import { createNana800Analytics } from 'nana800-analytics';
const analytics = createNana800Analytics({
apiKey: 'your-api-key',
appProjectId: 'your-project-id',
flushIntervalMs: 20000,
debug: false,
});
analytics.track('page_view', { page: '/home' });
analytics.identify('user123', {
name: 'John Doe',
email: '[email protected]',
});React Native / Expo
import { createNana800Analytics } from 'nana800-analytics';
import AsyncStorage from '@react-native-async-storage/async-storage';
const analytics = createNana800Analytics({
apiKey: 'your-api-key',
appProjectId: 'your-project-id',
storageAdapter: AsyncStorage,
flushIntervalMs: 20000,
});
analytics.track('app_opened', { platform: 'ios' });Node.js (Server-side)
import { createNana800Analytics } from 'nana800-analytics';
const analytics = createNana800Analytics({
apiKey: 'your-api-key',
appProjectId: 'your-project-id',
disableStorage: true,
flushIntervalMs: 10000,
});
analytics.track('api_request', { endpoint: '/api/users' });Configuration
interface Nana800AnalyticsConfig {
apiKey: string;
appProjectId: string;
baseUrl?: string; // default: https://api.analytics.nana800.io
flushIntervalMs?: number; // default: 20000
maxBatchSize?: number; // default: 100
enableAutoFlush?: boolean; // default: true
storageAdapter?: StorageAdapter;
disableStorage?: boolean;
debug?: boolean; // default: false
}API Reference
createNana800Analytics(config)
Creates and initializes a new analytics instance.
track(eventName, properties?, userId?)
Tracks an analytics event.
identify(userId, properties?)
Sets the current user and updates user properties.
setUserProperties(userId, properties)
Updates user properties.
flush()
Manually sends all pending events.
destroy()
Stops automatic flushing and cleans up resources.
FAQ
Where is the API key?
Get your API key from https://cloud.nana800.io/settings
Where is the "app_project_id"?
Create an analytics project at https://cloud.nana800.io/analytics
Contacts
No-Code & Business & Analytics Cloud Platform NANA800.io
Platform Console CLOUD.NANA800.io
Platform Documentation NANA800 Documentation
Support Email: [email protected]
License
MIT
