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

@triplewhale/react-native-triple-pixel

v0.1.4

Published

React Native bridge for Triple Whale pixel tracking SDK

Downloads

724

Readme

@triplewhale/react-native-triple-pixel

React Native bridge for the Triple Whale mobile tracking SDK. The package bundles the pre-built native binaries (Android + iOS) and exposes a single JavaScript API.


Installation

npm install @triplewhale/react-native-triple-pixel

iOS only:

cd ios && pod install

The package ships pre-built native binaries — no Gradle / Xcode edits required. Autolinking handles the wiring.

Requirements

| | | |---|---| | React Native | 0.71+ | | Android minSdk | 24 | | iOS deployment target | 14.0 | | Node | 18+ |


Quickstart

import { TriplePixel } from '@triplewhale/react-native-triple-pixel';

// Once at app startup.
// The first argument is your Triple Whale shop ID — the identifier shown for
// your store in Triple Whale — NOT your storefront domain or shop name.
TriplePixel.init('your-tw-shop-id', 'US', 'USD');

// Screen view
TriplePixel.pageView('/home');

// Product page
TriplePixel.pageViewWithProduct('/products/42', '42', 'T-Shirt', '29.99');

// Add to cart
TriplePixel.addToCart('42', /* variant */ '', /* price */ 29.99, /* qty */ 1);

// Contact capture
TriplePixel.contact('[email protected]');

// Checkout funnel
const order = {
  email: '[email protected]',
  lineItems: [{ id: '42', quantity: 1, variant: '', price: 29.99 }],
  orderId: '1001',
  token: 'abc123',
};

TriplePixel.checkoutStarted(order);
TriplePixel.paymentSubmitted(order);
TriplePixel.purchase(order);

API reference

Lifecycle

| Method | Description | |---|---| | init(shopId, msCountry, curr) | Required once at app startup. The first argument is your Triple Whale shop ID — the identifier shown for your store in Triple Whale. Do not pass your storefront domain or shop name; Triple Whale resolves the platform from the registered shop ID. |

Tracking

| Method | Description | |---|---| | pageView(url) | Screen view. | | pageViewWithProduct(url, productId, productName, productPrice) | Screen view with product context. | | addToCart(productId, variant, price, quantity) | Item added to cart. | | contact(email, phone?) | Capture user contact info. |

Checkout funnel

All accept the same CheckoutOptions object:

type CheckoutOptions = {
  email: string;            // required (email or phone)
  phone?: string;
  firstName?: string;
  lastName?: string;
  orderId?: string;         // required for purchase()
  token?: string;
  checkoutUrl?: string;
  lineItems: LineItem[];    // required, must not be empty
  discountTotal?: number;
  discountCodes?: string[];
};

type LineItem = {
  id: string;
  quantity: number;
  variant?: string;
  price?: number;           // per-unit
};

| Method | Funnel step | |---|---| | checkoutStarted(options) | User entered checkout | | paymentSubmitted(options) | Payment info submitted | | purchase(options) | Order confirmed (requires orderId) | | addressSubmitted(options) | Shipping address submitted | | contactSubmitted(options) | Contact info submitted | | shippingSubmitted(options) | Shipping method submitted |

Consent

Opt-out model: tracking is on by default; DENIED short-circuits everything.

| Method | Description | |---|---| | setConsentGranted() | Mark consent as granted. | | setConsentDenied() | Mark as denied. Clears persisted user ID + session state, cancels in-flight sends, blocks all subsequent track calls. Persists across app restarts. | | getConsentStatus(): Promise<'UNKNOWN' \| 'GRANTED' \| 'DENIED' \| undefined> | Read current state. Resolves to undefined if the native module isn't reachable; never rejects. |

Behavior under consent

| State | pageView / addToCart | contact / checkout* | |---|---|---| | UNKNOWN (default) | sent | sent | | GRANTED | sent | sent | | DENIED | blocked | blocked |

Apps targeting GDPR-style opt-in jurisdictions should call setConsentDenied() at startup and only setConsentGranted() after explicit user consent.


Error handling

Every bridge call is wrapped in try/catch on both the JS and native sides. Malformed payloads are silently dropped with a console.warn — they will never crash your app. Tracking is best-effort.


Reporting security issues

If you believe you have found a security vulnerability in this SDK, please report it privately — do not open a public issue or post it in any public forum.

Email [email protected] with:

  • A description of the vulnerability and its potential impact.
  • Steps to reproduce, ideally with a minimal proof-of-concept.
  • The SDK version (@triplewhale/react-native-triple-pixel@<version>), platform (Android / iOS / React Native), and runtime versions.
  • Whether the issue is currently being exploited in the wild, to the best of your knowledge.

We aim to acknowledge reports within two business days and to share a remediation plan within seven. Please give us a reasonable window to investigate and ship a fix before any public disclosure.


License

MIT — see the LICENSE file shipped with this package.