npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@solomon-tech/events-react-native

v1.0.1

Published

Solomon Analytics SDK for React Native - Track e-commerce funnel events in mobile apps

Readme

@solomon-tech/events-react-native

Solomon Analytics SDK for React Native — track e-commerce funnel events in mobile apps with the same backend contract as the web SDK.

Installation

npm install @solomon-tech/events-react-native @react-native-async-storage/async-storage

Required Peer Dependencies

| Package | Purpose | |---------|---------| | @react-native-async-storage/async-storage | Persistent storage for session/user IDs and UTMs |

Optional Peer Dependencies

| Package | Purpose | Fallback | |---------|---------|----------| | react-native-device-info | Device ID (IDFV/ANDROID_ID), model, app version | "unknown" | | @react-native-community/netinfo | Connection type (wifi/4g/5g) | "unknown" | | react-native-install-referrer | Install campaign UTMs (Android only) | null |

# Optional — install for full device telemetry
npm install react-native-device-info @react-native-community/netinfo react-native-install-referrer

For Expo managed workflow, add the config plugins to app.json:

{
  "expo": {
    "plugins": [
      "react-native-device-info"
    ]
  }
}

Quick Start

import { SolomonSDK } from '@solomon-tech/events-react-native';

const sdk = new SolomonSDK({
  companyId: 'YOUR_COMPANY_ID',
  debug: true,
  useTouchpoint: true,
  appIdentifier: 'com.yourapp.bundle',
});

// Set screen name before tracking
sdk.setScreenName('HomeScreen');

// Track events
await sdk.track('VIEW_PAGE');

await sdk.track('CONTENT_VIEW', {
  id: 'product-123',
  title: 'Blue T-Shirt',
  price: 49.90,
  variant: 'M',
});

await sdk.track('ADD_TO_CART', {
  item_id: 'product-123',
  item_quantity: 2,
});

await sdk.track('CHECKOUT_COMPLETED', {
  items: [{ item_id: 'product-123', item_quantity: 2 }],
}, {
  email: '[email protected]',
  order_id: 'ORD-456',
});

API Reference

new SolomonSDK(config: SDKConfig)

| Config | Type | Required | Description | |--------|------|----------|-------------| | companyId | string | Yes | Your Solomon company ID | | debug | boolean | No | Log events to console | | useTouchpoint | boolean | No | Send touchpoint/attribution events | | appIdentifier | string | No | App bundle ID for current_domain field | | storage | StorageAdapter | No | Custom storage adapter (default: AsyncStorage) |

sdk.track(event, payload?, aliases?)

Tracks a funnel event. Sends to both endpoints when useTouchpoint is enabled.

Events:

| Event | Payload | |-------|---------| | VIEW_PAGE | null | | CONTENT_VIEW | { id, variant?, title?, price? } | | ADD_TO_CART | { item_id, item_quantity } | | INITIATE_CHECKOUT | { items: [{ item_id, item_quantity }] } | | ADD_SHIPPING_INFO | { items: [{ item_id, item_quantity }] } | | ADD_CUSTOMER_INFO | { items: [{ item_id, item_quantity }] } | | ADD_PAYMENT_INFO | { items: [{ item_id, item_quantity }] } | | CHECKOUT_COMPLETED | { items: [{ item_id, item_quantity }] } |

Custom Aliases (optional 3rd param):

{
  email?: string;
  phone?: string;
  user_id?: string;
  customer_id?: string;
  cart_token?: string;
  order_id?: string;
}

sdk.setScreenName(name: string)

Sets the current screen name, used as page_path in events.

sdk.handleDeepLink(url: string)

Extracts and stores UTM parameters from a deep link URL.

sdk.flush()

No-op in v1 (events are sent immediately). Reserved for future queue-based delivery.

sdk.destroy()

Removes app lifecycle listeners. Call when unmounting.

Deep Link Integration

Manual

import { Linking } from 'react-native';

// On app start
Linking.getInitialURL().then(url => {
  if (url) sdk.handleDeepLink(url);
});

// While app is running
Linking.addEventListener('url', event => {
  sdk.handleDeepLink(event.url);
});

Automatic (Hook)

import { useSolomonDeepLinks } from '@solomon-tech/events-react-native/hooks';

function App() {
  useSolomonDeepLinks(sdk);
  // ...
}

React Navigation Integration

Manual

const onStateChange = (state) => {
  const routeName = getActiveRouteName(state);
  sdk.setScreenName(routeName);
};

<NavigationContainer onStateChange={onStateChange}>

Automatic (Hook)

import { useSolomonScreenTracking } from '@solomon-tech/events-react-native/hooks';

function App() {
  const navigationRef = useNavigationContainerRef();
  const onStateChange = useSolomonScreenTracking(sdk, navigationRef);

  return (
    <NavigationContainer ref={navigationRef} onStateChange={onStateChange}>
      {/* screens */}
    </NavigationContainer>
  );
}

Custom Storage Adapter

Replace AsyncStorage with MMKV or any other storage:

import { MMKV } from 'react-native-mmkv';

const mmkv = new MMKV();

const sdk = new SolomonSDK({
  companyId: 'YOUR_ID',
  storage: {
    getItem: (key) => Promise.resolve(mmkv.getString(key) ?? null),
    setItem: (key, value) => { mmkv.set(key, value); return Promise.resolve(); },
    removeItem: (key) => { mmkv.delete(key); return Promise.resolve(); },
  },
});

Migration from Web SDK

| Web SDK | React Native SDK | Notes | |---------|-----------------|-------| | new SolomonSDK({ companyId }) | Same | Add appIdentifier for mobile | | sdk.track('VIEW_PAGE') | Same | Call setScreenName() first | | sdk.track('ADD_TO_CART', payload) | Same | Identical API | | Auto UTM from URL | sdk.handleDeepLink(url) | Manual or via hook | | Auto page path from window.location | sdk.setScreenName(name) | Manual or via hook |

License

MIT