Browse docs

Explore by section, then jump directly into a page.

SDKs

Pick your platform and get up and running in minutes. Every SDK shares the same event model and core APIs.

Pick your platform

SDK-side allow and block rules

Dashboard rules are the recommended central control, but SDKs can also apply local code-side rules for environment-specific filtering. Use this for development builds, regulated app variants, or temporary safeguards that should live with the client code.

JavaScript / React NativeTypeScript
const analytics = new FlashAnalytics({
  appId: 'YOUR_APP_ID',

  // Local whitelist. If set, unlisted events are dropped by the SDK.
  allowEvents: [
    {
      name: 'checkout.completed',
      allowProperties: ['orderId', 'amount', 'currency'],
      blockProperties: ['couponDebugPayload'],
    },
    { name: 'account.*' },
  ],

  // Local blocklist. Supports trailing wildcard patterns.
  blockEvents: ['debug.*', 'internal_test'],

  // Removed from every event before send.
  blockProperties: ['password', 'authToken', 'ssn'],

  // Final code-side predicate for dynamic cases.
  shouldTrack(payload) {
    if (payload.type === 'track' && payload.payload.name.startsWith('dev.')) {
      return false;
    }

    return true;
  },
});

Order of control is: dashboard-managed collection settings, then local SDK allow/block lists, then shouldTrack, then shouldCaptureRequest immediately before the outbound request. Anything blocked locally is not queued or sent.

Quick start (Web)

Three lines to start tracking. Replace YOUR_APP_ID with the UUID from your Flash dashboard.

InstallTerminal
npm install @flash-analytics/web@2.2.4
InitializeTypeScript
import { FlashAnalytics } from '@flash-analytics/web';

const analytics = new FlashAnalytics({
  appId: 'YOUR_APP_ID',
  capturePageViews: true,
  captureErrors: true,
});

Current SDK capabilities

The latest releases align the browser, server, and mobile SDKs around the same session, collection-rule, batching, experiment, and remote-config behavior.

Session warm-up

Mobile SDKs can send sdk_initialized at startup so lifecycle, install, update, and screen events attach to a server-created session.

Dashboard-managed collection

Supported SDKs receive dashboard rules automatically, allow or block events locally, remove blocked properties, and keep sdk_initialized and sdk_heartbeat available.

Dashboard-controlled SDK behavior

Teams can manage batching defaults, session timeout, collection rules, remote config, and experiment behavior from the dashboard without shipping code.

Experiment cache

captureVariants keeps profile, session, and event-mode assignment caches in sync after session start and identify().

Native mobile capture

React Native, Kotlin, and Swift cover app lifecycle, deep links, screen views, native crashes, and notification lifecycle events.

Remote config helpers

SDKs expose typed getters for booleans, strings, numbers, and JSON values returned from Flash remote config.

TrackTypeScript
analytics.identify({ profileId: 'user_123', email: 'user@example.com' });
analytics.track('signup_completed', { plan: 'pro' });

Shared APIs across all SDKs

Every SDK — browser, mobile, and server — exposes the same core methods.

track()Send a named event with optional properties
identify()Attach a stable user ID and profile data
setGlobalProperties()Merge properties into every subsequent event
revenue()Record a purchase or subscription charge
increment() / decrement()Adjust a numeric user property
getSession()Read current session ID and estimated expiry
onSessionUpdatedCallback option for restored, created, or refreshed sessions
deliveryStrategyEnable batching with size, timeout, and fallback controls
fetchRemoteConfig()Pull feature flags and config values
assignExperiment()Get or create an A/B test assignment
collectionConfigSync dashboard-managed collection settings to the SDK
maxSessionTimeoutInMinOverride session timeout and heartbeat cadence per SDK

Current versions

PackageVersionPlatform
@flash-analytics/webv2.2.4Browser
@flash-analytics/nextjsv2.2.4React
@flash-analytics/astrov2.2.4Browser
@flash-analytics/sdkv2.2.4Server
@flash-analytics/expressv2.1.9Server
@flash-analytics/react-nativev2.1.20Mobile
app.flashanalytics:flashanalytics-kotlinv1.1.5Mobile
FlashAnalytics (SwiftPM)v1.1.5Mobile