Observed since 20 Oct, 18:05 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Official 11metrics tracking SDK for React Native apps. Zero native dependencies — pure-JS SHA-256 hashing, a pluggable storage adapter for persistent anonymous IDs, and an optional React Navigation integration for automatic screen-view tracking.
Official 11metrics tracking SDK for React Native apps. Talks to the same
POST /api/pixel endpoint the web pixel.js SDK uses — no backend changes
required to start receiving mobile events.
Zero native dependencies: hashing is pure-JS SHA-256 (no crypto.subtle,
no native crypto module to link), and identity persistence is a pluggable
storage adapter rather than a hard dependency on any specific storage
library. Works in Expo Go and bare React Native alike.
npm install 11metrics-pixel-react-native
// App.tsx
import AsyncStorage from '@react-native-async-storage/async-storage'; // recommended, not required
import { init, screenView, track, identify } from '11metrics-pixel-react-native';
init({
pixelId: 'YOUR_PIXEL_ID', // Settings → Pixel Setup in the 11metrics app
pixelUrl: 'https://app.11metrics.ai', // optional, this is the default
storage: AsyncStorage, // optional — omit to fall back to in-memory (resets each app restart)
});
// Manual screen tracking.
screenView('ProductDetail', { product_id: 'abc123' });
// Custom event.
track('button_press', { button: 'checkout' });
// After login. email/phone are hashed on-device before anything is sent.
identify({ email: 'user@example.com', first_name: 'Marco' });
import { NavigationContainer } from '@react-navigation/native';
import { trackNavigationStateChange } from '11metrics-pixel-react-native';
export default function App() {
return (
<NavigationContainer onStateChange={trackNavigationStateChange}>
{/* ... */}
</NavigationContainer>
);
}
Not using React Navigation? Call screenView(name) yourself wherever your
navigation library exposes a focus/route-change event.
crypto.subtle isn't reliably available across React
Native's JS engines (Hermes/JSC) and versions. Rather than require a
native crypto module (native linking, pod install, Expo config plugins —
friction most SDKs don't need to impose), this package ships its own
pure-JS SHA-256 implementation, verified against known FIPS test vectors
(see smoke-test.mjs).localStorage equivalent built into
React Native's JS runtime — every persistence option (AsyncStorage, MMKV,
SecureStore) is a native module. Rather than pick one and force it on
every consumer, init({ storage }) accepts anything with a
getItem/setItem shape. @react-native-async-storage/async-storage
is the recommended default (it's already in most React Native apps), but
MMKV or your own adapter both work identically.trackNavigationStateChange accepts state: unknown rather than importing @react-navigation/native's types, so
this package has zero dependency on it — apps using a different
navigation library (or none) simply don't call that function.init(config: { pixelId, pixelUrl?, storage?, gpc?, priorBlocking?, consent? })screenView(screenName, meta?) — sent as event: "pageview", same event
type web uses, so mobile screen views land in the same reports as web
pageviews with no extra setup.track(name, meta?) — custom event.identify(data) — { email?, phone?, first_name?, last_name? }.setConsent(granted: boolean) — record the visitor's consent decision from
your app's consent screen (flushes buffered events + starts persisting the
device id when granted; stops sending + drops the buffer when withdrawn).getAnonymousId() — the persisted per-device anonymous id.trackNavigationStateChange(state) — wire into React Navigation's
onStateChange for automatic screen tracking.RN has no cookies or navigator.globalPrivacyControl, so the equivalents are
config + storage:
init({ gpc: true }) when your app should honour a universal
opt-out (e.g. an OS/app "opt out of tracking" toggle). Analytics are
suppressed, the device id is never persisted, and one gpc_optout beacon is
sent so the server records the withdrawal in the consent ledger.init({ priorBlocking: 'geo' | 'strict' }). Events are
buffered until a consent decision resolves, then replayed exactly once
(the web q() defer/replay). geo asks /api/pixel/consent-context and
holds only for visitors who require prior consent; strict always holds
until setConsent(true). The persistent device id is written to storage
only once analytics is allowed.priorBlocking: 'off', no gpc) — unchanged: events send
immediately. Drive consent yourself with setConsent() /
init({ consent: boolean }).npm install
npm run build
npm test # runs the build, then sha256 + payload smoke tests
npm run build
npm test
npm login # once, with your npm account
npm publish # from this directory
Bump version in package.json first if this isn't the first release.
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:05 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e9296a7eccaa8bc4ed139b809944d47655572a61028a151ed7d173a28fc6a8b1