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

signal-react-native-sdk

v1.0.4

Published

Official React Native SDK for Signal

Readme

Signal React Native SDK

Official React Native SDK for Signal — event tracking, user identity, and push notification management.

Installation

npm install signal-react-native-sdk

iOS — link native dependencies:

cd ios && pod install && cd ..

Quick Start

1. Initialize (App.tsx)

import SignalSDK from 'signal-react-native-sdk';

await SignalSDK.initSDK({
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
});

// Set identity right after init
await SignalSDK.setIdentity({ user_id: 'anon-' + generateUUID() });

2. Identify user after login

await SignalSDK.setIdentity({
  user_id: 'ply_776192',
  traits: {
    email: '[email protected]',
    first_name: 'Alex',
    country: 'MT',
    currency: 'EUR',
    kyc_status: 'pending',
  },
});

3. Track events

await SignalSDK.sendEvent('deposit_success', {
  amount: 100,
  currency: 'EUR',
  transaction_id: 'txn_abc123',
});

await SignalSDK.sendEvent('game_started', {
  game_id: 'slots_001',
  game_name: 'Lucky Spin',
});

4. Register FCM token

import messaging from '@react-native-firebase/messaging';

const fcmToken = await messaging().getToken();
await SignalSDK.setIdentity({ fcm_token: fcmToken });
// Token refresh is handled automatically by the SDK

5. Background push (index.js)

import messaging from '@react-native-firebase/messaging';
import SignalSDK from 'signal-react-native-sdk';

messaging().setBackgroundMessageHandler(SignalSDK.handleBackgroundMessage);

6. Logout

SignalSDK.clearIdentity();
await SignalSDK.setIdentity({ user_id: 'anon-' + generateUUID() });

API

| Method | Description | |--------|-------------| | initSDK(config) | Initialize the SDK. Call once at app startup. | | setIdentity(payload) | Set or update user identity and traits. | | clearIdentity() | Clear the current user identity on logout. | | sendEvent(name, properties?) | Track a player event. | | handleBackgroundMessage | Pass to Firebase setBackgroundMessageHandler for killed/background push. |

initSDK(config)

| Field | Type | Required | Description | |-------|------|----------|-------------| | clientId | string | Yes | Your Signal client ID. Prefix with QA_ to route to QA environment automatically. | | clientSecret | string | Yes | Your Signal client secret. | | onApiLog | function | No | Callback fired after every HTTP call — useful for debugging. |

setIdentity(payload)

| Field | Type | Description | |-------|------|-------------| | user_id | string | Player ID or anonymous UUID. | | fcm_token | string | FCM push token — stored and synced automatically. | | traits | object | Player attributes (email, country, kyc_status, vip_level, etc.). | | unset_traits | string[] | Trait keys to remove from the player profile. |

sendEvent(name, properties?)

properties is a free-form Record<string, unknown>. Reserved keys (user_id, session_id, etc.) are automatically stripped — pass them freely without side effects.


Environment Routing

Prefix your clientId with QA_ to automatically route all traffic to the QA backend:

await SignalSDK.initSDK({ clientId: 'QA_your-client-id', clientSecret: '...' });
// → routes to QA, strips the prefix before sending requests

No other configuration needed — production is the default.


Full Integration Guide

See INTEGRATION_GUIDE.md for the complete guide covering the full player lifecycle, push notification tracking, background push handling, and TypeScript types.


Publishing

./publish.sh

See PUBLISHING.md for the full publish workflow.