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

@codematic/opencdp-react-native

v2.0.2

Published

Codematic OpenCDP React Native SDK — native wrapper over Android/iOS OpenCDP SDKs

Readme

OpenCDP React Native SDK

Mobile client SDK for OpenCDP on React Native. v2.0 wraps the native Android and iOS OpenCDP SDKs for full capability parity with Flutter.

Documentation

Published guides on docs.opencdp.io:

Requirements

  • React Native >= 0.72 (or Expo SDK 50+ with development build — Expo Go is not supported)
  • iOS 13+ / Android API 24+

Install

npm install @codematic/opencdp-react-native
# Optional: only needed if you use CDPClient in Node smoke tests
npm install @react-native-async-storage/async-storage

Expo

Add the config plugin to app.json:

{
  "expo": {
    "plugins": ["@codematic/opencdp-react-native/app.plugin.js"]
  }
}

Then create a dev build:

npx expo prebuild
npx expo run:ios   # or run:android

Bare React Native

cd ios && pod install && cd ..

Autolinking picks up android/ and ios/ from this package.

Native dependencies:

  • Android: io.opencdp:opencdp-android:1.0.0-alpha02
  • iOS: OpenCDP pod ~> 0.1.1

Quick start

import { OpenCDPSDK } from '@codematic/opencdp-react-native';

await OpenCDPSDK.initialize({
  config: {
    cdpApiKey: 'apikey_...',
    debug: true,
    autoTrackDeviceAttributes: true,
    enableInAppMessages: true,
  },
});

await OpenCDPSDK.instance.identify({
  identifier: 'user_123',
  properties: { plan: 'pro' },
});

await OpenCDPSDK.instance.track({
  eventName: 'purchase',
  properties: { amount: 99.9 },
});

await OpenCDPSDK.instance.trackScreenView({
  title: 'Home',
});

await OpenCDPSDK.instance.registerDeviceToken({ fcmToken: '...' });

OpenCDPSDK.instance.addInAppListener((message) => {
  console.log('In-app message', message.deliveryId);
});

await OpenCDPSDK.setupPushNotifications();
await OpenCDPSDK.handleForegroundPushDelivery({ delivery_message_id: '...' });

API surface

| Capability | React Native | |------------|--------------| | Initialize | OpenCDPSDK.initialize({ config }) | | Identify / track / clear | OpenCDPSDK.instance.* | | Screen / lifecycle | trackScreenView, trackLifecycleEvent | | Device token | registerDeviceToken({ fcmToken?, apnToken? }) | | Push metrics | OpenCDPSDK.handleForegroundPushDelivery, handleBackgroundPushDelivery, handlePushNotificationOpen, handlePushActionClick | | Android notification UI | OpenCDPSDK.showActionableNotification(data) | | Pending launch (Android) | OpenCDPSDK.handlePendingNotificationLaunch() | | In-app | syncInAppMessages, addInAppListener, trackInAppImpression/Click/Dismiss | | Debug (native) | debugTestHostFailover, debugTestQueueRetry, debugDrainQueue |

See SDK_CONTRACT.md for cross-SDK mapping.

Node / test console

CDPClient remains a pure HTTP client for the opencdp-test-console smoke runner in Node. On device, always use OpenCDPSDK (native-backed).

Example app

cd example
npm install
npx expo prebuild
npx expo run:ios

Push setup

  • Android: Wire FCM in your FirebaseMessagingService using helpers from native OpenCDPPushSetup (see Android SDK README).
  • iOS: Call OpenCDPSDK.setupPushNotifications() after init; forward APNs token via registerDeviceToken({ apnToken }). Add Notification Service Extension for big-picture push (see iOS SDK README).

Configuration

| Option | Default | Description | |--------|---------|-------------| | cdpApiKey | required | OpenCDP API key | | cdpEndpoint | production gateway | Primary gateway URL | | cdpFallbackEndpoints | .com, .xyz | Fallback hosts | | throwErrorsBack | false | Throw on validation/network errors | | autoTrackScreens | false | Auto-track navigation (native) | | trackApplicationLifecycleEvents | true | App lifecycle events | | autoTrackDeviceAttributes | true | Register device on init when token stored | | sendToCustomerIo | false | Dual-write to Customer.io (requires CIO SDK linked in native) | | enableInAppMessages | false | Enable in-app sync / listeners | | iOSAppGroup | — | App group for NSE / background push |