growise-sdk
v1.1.0
Published
Growise SDK for Web Tracking and Notifications
Maintainers
Readme
Growise SDK
Modern and premium tracking & push notifications SDK for the Web.
Installation
Install the package via npm:
npm install growise-sdkOr via yarn:
yarn add growise-sdkUsage
ES Modules (ESM) / TypeScript
import { growise } from 'growise-sdk';
// Initialize the SDK
await growise.init('YOUR_API_KEY', {
appVersion: '1.0.0', // Optional
});
// Track custom events
growise.track('purchase_completed', {
amount: 29.99,
currency: 'INR'
});
// Identify logged-in users
growise.onUserLogin({
Site: {
Name: 'John Doe',
Email: '[email protected]',
Identity: 'user_12345'
}
});CommonJS (CJS)
const { growise } = require('growise-sdk');
// Initialize and track
growise.init('YOUR_API_KEY').then(() => {
growise.track('page_viewed');
});Global Window Attachment (Compatibility Mode)
For legacy script integration support, the package automatically exposes window.growise when loaded in a browser environment.
// Access it globally anywhere in the browser
window.growise.track('button_clicked');Features
- Automated Device Fingerprinting: Deterministic distinct ID generation.
- Auto Event Tracking: Automatic installation tracking, session handling, and page closing/visibility state tracking.
- Server-Side Rendering (SSR) Safe: Gracefully handles Node environments (e.g. Next.js / Nuxt) by checking execution contexts before calling browser APIs.
- Firebase Push Integration: Dynamic dependency loading for push messaging.
