Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@bagdock/analytics

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bagdock/analytics

Bagdock Analytics SDK — lightweight client-side event tracking with batching and dedup

Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
13
8.33%
Maintainers
1
Weekly downloads
 
Created
Source
  ----++                                ----++                    ---+++     
  ---+++                                ---++                     ---++      
 ----+---     -----     ---------  --------++ ------     -----   ----++----- 
 ---------+ --------++----------++--------+++--------+ --------++---++---++++
 ---+++---++ ++++---++---+++---++---+++---++---+++---++---++---++------++++  
----++ ---++--------++---++----++---++ ---++---++ ---+---++     -------++    
----+----+---+++---++---++----++---++----++---++---+++--++ --------+---++   
---------++--------+++--------+++--------++ -------+++ -------++---++----++  
 +++++++++   +++++++++- +++---++   ++++++++    ++++++    ++++++  ++++  ++++  
                     --------+++                                             
                       +++++++                                               

@bagdock/analytics

The official Bagdock Analytics SDK — lightweight client-side event tracking with automatic batching and deduplication.

npm version License: MIT

Install

npm install @bagdock/analytics
yarn add @bagdock/analytics
pnpm add @bagdock/analytics
bun add @bagdock/analytics

Quick start

import { BagdockAnalytics } from '@bagdock/analytics'

const analytics = new BagdockAnalytics({
  writeKey: 'ak_live_...',
})

// Track a custom event
analytics.track('unit_viewed', {
  unitId: 'unit_abc123',
  unitSize: '10x10',
})

// Track a page view
analytics.page('/facilities/downtown')

// Flush immediately (e.g., before page unload)
await analytics.flush()

Configuration

OptionTypeDefaultDescription
writeKeystringRequired. Your Bagdock analytics write key
baseUrlstringhttps://api.bagdock.comAPI base URL
flushIntervalnumber5000Flush interval in milliseconds
maxBatchSizenumber25Max events per batch

API

MethodDescription
track(event, properties?)Track a custom event
page(path?, properties?)Track a page view
identify(userId, traits?)Identify a user
flush()Flush the event queue immediately
reset()Clear user identity and queue

Zero dependencies

This SDK has no external runtime dependencies. It uses the native fetch API and is designed to be as lightweight as possible for client-side use.

License

MIT

Keywords

bagdock

FAQs

Package last updated on 05 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts