SDKs
Pick your platform and get up and running in minutes. Every SDK shares the same event model and core APIs.
Pick your platform
@flash-analytics/webBrowser apps, SPAs, and script-tag installs.
@flash-analytics/nextjsApp Router and Pages Router with React hooks.
@flash-analytics/astroAstro layouts and islands with client-side helpers.
@flash-analytics/sdkServer-side jobs, workers, CLIs, and custom backends.
@flash-analytics/expressAutomatic request and error tracking middleware.
@flash-analytics/react-nativeiOS and Android apps with lifecycle, session warm-up, and push tracking.
app.flashanalytics:flashanalytics-kotlinNative Android with session warm-up, deep links, screens, and crash capture.
FlashAnalytics (SwiftPM)Native iOS with SwiftUI, UIKit, deep links, and push.
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.
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.
npm install @flash-analytics/web@2.2.4import { 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.
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 propertiesidentify()Attach a stable user ID and profile datasetGlobalProperties()Merge properties into every subsequent eventrevenue()Record a purchase or subscription chargeincrement() / decrement()Adjust a numeric user propertygetSession()Read current session ID and estimated expiryonSessionUpdatedCallback option for restored, created, or refreshed sessionsdeliveryStrategyEnable batching with size, timeout, and fallback controlsfetchRemoteConfig()Pull feature flags and config valuesassignExperiment()Get or create an A/B test assignmentcollectionConfigSync dashboard-managed collection settings to the SDKmaxSessionTimeoutInMinOverride session timeout and heartbeat cadence per SDKCurrent versions
| Package | Version | Platform |
|---|---|---|
@flash-analytics/web | v2.2.4 | Browser |
@flash-analytics/nextjs | v2.2.4 | React |
@flash-analytics/astro | v2.2.4 | Browser |
@flash-analytics/sdk | v2.2.4 | Server |
@flash-analytics/express | v2.1.9 | Server |
@flash-analytics/react-native | v2.1.20 | Mobile |
app.flashanalytics:flashanalytics-kotlin | v1.1.5 | Mobile |
FlashAnalytics (SwiftPM) | v1.1.5 | Mobile |