The ultimate SDK for Customer Data.

A single, lightweight library to track anonymous behavior, resolve identities, manage consent, and register push tokens across every platform.

< 20KB Gzipped
Cross-device Identity
PDPA / GDPR Ready
// 1. Initialize the SDK
import { Hubxio } from ‘@hubxio/web’;

Hubxio.init({
  appKey: ‘sk_live_x8f9a2b…’,
  debug: true
});

// 2. Track an anonymous action
Hubxio.track(‘Product_Viewed’, {
  product_id: ‘P-1093’,
  price: 299.99
});

Collect everything. Neatly.

Three core API methods fulfill 100% of your behavioral data collection and identity resolution needs across any digital touchpoint.

ID

Identity Resolution (Anonymous to Known)

The SDK automatically generates and stores an Anonymous ID via First-party Cookies or Device IDs. Upon user login, the identify() method instantly merges the anonymous history into the actual User ID while updating personal attributes (Traits).

METHOD: Hubxio.identify() // Merge history & set traits
Hubxio.identify(‘USER_789’, {
  name: ‘Nguyen Van A’,
  loyalty_tier: ‘Gold’
});
🛡️

Consent & Privacy Management

Comply with GDPR and CCPA directly on the client-side. Record user consent states seamlessly. The SDK will automatically halt data transmission or encrypt PII if the customer opts out.

METHOD: Hubxio.setConsent() Hubxio.setConsent({
  ad_storage: ‘denied’,
  analytics_storage: ‘granted’
});
🔔

Push Token Registration

Seamlessly collect Device Tokens (FCM, APNs, Web Push VAPID). The SDK automatically attaches the token to the correct user profile, ready for downstream Activation and messaging campaigns.

METHOD: Hubxio.registerPushToken() Hubxio.registerPushToken({
  token: ‘fcm_token_xyz…’,
  platform: ‘android’
});

Behavioral Event Tracking

Capture every interaction (Click, View, Purchase). The flexible track() method allows you to attach unlimited properties to enrich the context of any event payload.

METHOD: Hubxio.track() Hubxio.track(‘Order Completed’, {
  order_id: ‘ORD-9921’,
  revenue: 1500.00
});
👁️

Auto-Capture (Codeless)

Enable Auto-Track and the SDK will automatically capture Pageviews, App Screens, Clicks, UTM parameters, and Referrers without wasting your engineering time on manual implementation.

📦

Offline Queuing & Resilience

Ensure zero data loss. When a device goes offline, the SDK automatically stores events locally (Local Storage/SQLite) and retries them using an Exponential Backoff mechanism once connectivity is restored.

Native SDKs for every stack

JavaScript / Web
iOS (Swift)
Android (Kotlin)
React Native

Web SDK (Browser)

Integrate directly via a script tag or install via NPM/Yarn for React, Vue, and Angular applications. Seamlessly handles Cookies, LocalStorage, and Cross-domain tracking.

  • Ultra-lightweight (~15KB gzipped)
  • Anonymous ID handling via First-party Cookies
  • Web Push VAPID keys support
// Install via npm
npm install @Hubxio/web

// Initialization & Identify
import Hubxio from ‘@Hubxio/web’;
Hubxio.identify(‘u_123’, { plan: ‘Pro’ });

iOS SDK (Swift)

Native framework optimized for Apple devices. Perfectly supports CocoaPods and Swift Package Manager. Automatically captures Lifecycle Events and Push Tokens via APNs.

  • Native Swift, memory optimized
  • Auto-track Application Opened/Backgrounded
  • Transparent IDFA syncing per App Tracking Transparency
// Install via Swift Package Manager
import Hubxio

// Initialization & Identify
Hubxio.init(appKey: “sk_live_x8f9…”)
Hubxio.identify(userId: “u_123”, traits: [“plan”: “Pro”])

Android SDK (Kotlin)

Ultra-lightweight Android library, managing background data streams with WorkManager for maximum battery efficiency. Seamlessly collects FCM Push Tokens.

  • 100% Kotlin with coroutines support
  • Automatic SQLite queue management while offline
  • Seamless Firebase Cloud Messaging (FCM) handling
// Install via Gradle
implementation ‘com.hubxio:android:1.0.0’

// Initialization & Identify
Hubxio.init(context, “sk_live_x8f9…”).build()
Hubxio.identify(“u_123”, Properties().putValue(“plan”, “Pro”))

React Native SDK

Unified experience for iOS and Android via the React Native bridge. Maintain native performance while coding in JavaScript or TypeScript.

  • Direct wrapper for Native SDK methods (Zero JS bottleneck)
  • Full TypeScript definitions
  • Automatic Expo plugins support
// Install via yarn
yarn add @hubxio/react-native

// Initialization & Identify
import { Hubxio } from ‘@hubxio/react-native’;

await Hubxio.init(‘sk_live_x8f9…’);
await Hubxio.identify(‘u_123’, { plan: ‘Pro’ });

Start collecting data the right way.

Read the extensive documentation, grab your API keys, and start tracking events in your staging environment in minutes.