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

@emito/react-native

v0.1.0

Published

React Native hooks for Emito in-app notifications, including push-token registration.

Readme

@emito/react-native

React Native bindings for Emito — notification hooks plus device push-token registration.

License Types

React TypeScript

What it is

@emito/react-native is the React Native entry point for the Emito client SDK. It re-exports the full notification hook surface from @emito/react-hooks — provider, client access, notification feed, unread count, preferences, and toasts — and adds one React Native specific hook, usePushToken, that registers a device's FCM or APNs push token with the Emito server.

The package is a thin, platform-specific layer: everything except usePushToken is the same hook API used on the web, so a single mental model carries across both React and React Native apps.

Install

Emito is developed as a pnpm workspace; the @emito/* packages are consumed from within the monorepo. Add the React Native bindings (and the client packages) to a workspace package as workspace dependencies:

// package.json
"dependencies": {
  "@emito/react-native": "workspace:*",
  "@emito/js": "workspace:*",
  "@emito/react-hooks": "workspace:*"
}

Standalone npm publishing of the @emito/* scope is planned but not yet available — install from the workspace for now.

It declares the following peer dependencies, which your app must provide:

| Peer | Range | |------|-------| | react | >=18 | | react-native | >=0.72 | | @emito/js | * | | @emito/react-hooks | * |

Usage

Wrap your app in EmitoProvider, then register the device push token. usePushToken auto-registers on mount and re-registers when the token changes.

import { EmitoProvider, usePushToken, useUnreadCount } from "@emito/react-native";
import messaging from "@react-native-firebase/messaging";
import { Text } from "react-native";

function PushRegistration() {
  // Resolve the token asynchronously, then register it with the Emito server.
  const { token, isRegistering, error } = usePushToken({
    platform: "fcm",
    getToken: () => messaging().getToken(),
  });

  if (error) return <Text>Push registration failed: {error.message}</Text>;
  if (isRegistering || !token) return <Text>Registering for push…</Text>;
  return <Text>Registered</Text>;
}

function Badge() {
  const { count } = useUnreadCount();
  return <Text>{count} unread</Text>;
}

export default function App() {
  return (
    <EmitoProvider endpoint="https://emito.example.com" subscriberId="user_123" token="<jwt>">
      <PushRegistration />
      <Badge />
    </EmitoProvider>
  );
}

For manual control, pass autoRegister: false and call the returned register() yourself:

const { register, isRegistering } = usePushToken({
  platform: "apns",
  token: deviceToken, // a static token string
  autoRegister: false,
});

// later, e.g. after the user grants permission
await register();

API surface

usePushToken(options)

Registers a device push token with the Emito server through the active EmitoClient.

| Option | Type | Description | |--------|------|-------------| | platform | "fcm" \| "apns" | Push platform. Required. | | token | string | Static push token string. | | getToken | () => Promise<string> | Async resolver called on mount when no static token is given. | | autoRegister | boolean | Register automatically on mount and when the token changes. Defaults to true. |

Returns:

| Field | Type | Description | |-------|------|-------------| | token | string \| null | The resolved push token, or null until resolved. | | isRegistering | boolean | Whether registration is in progress. | | error | Error \| null | Token-resolution or registration error. | | register | () => Promise<void> | Manual registration trigger. |

Re-exported from @emito/react-hooks

| Export | Kind | |--------|------| | EmitoProvider | Context provider that creates and manages the EmitoClient. | | useEmitoClient | Access the active EmitoClient instance. | | useNotifications | Notification feed for the current subscriber. | | useUnreadCount | Live unread-notification count. | | usePreferences | Read and update subscriber notification preferences. | | useToast | In-app toast queue. |

Accompanying types are also re-exported: PushPlatform, UsePushTokenOptions, UsePushTokenResult, EmitoProviderProps, UseNotificationsParams, UseNotificationsResult, UseUnreadCountResult, UsePreferencesOptions, UsePreferencesResult, ToastItem, UseToastOptions, and UseToastResult.

Part of Emito

@emito/react-native is one package in the Emito monorepo — self-hosted, provider-agnostic notification infrastructure for Node.js and TypeScript.

License

MIT — part of the Emito project.