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

@suprsend/expo-sdk

v0.0.1

Published

The expo library for using SuprSend features like inbox, preferences etc

Readme

@suprsend/expo-sdk

SuprSend SDK for Expo and React Native — combines the headless inbox feed from @suprsend/react-core with native push notifications (FCM + APNs) via expo-notifications.

Install

npx expo install @suprsend/expo-sdk \
  expo-notifications expo-secure-store expo-application

SuprSendExpoProvider

SuprSendExpoProvider identifies the current user and is required by both the feed and push notification providers. Wrap your app (or the authenticated portion of it) with it once:

import { SuprSendExpoProvider } from "@suprsend/expo-sdk";

export default function App() {
  return (
    <SuprSendExpoProvider
      publicApiKey={process.env.SUPRSEND_PUBLIC_KEY!}
      distinctId={currentUser.id}
      userToken={currentUser.suprsendToken}
    >
      <RootNavigator />
    </SuprSendExpoProvider>
  );
}
interface SuprSendExpoProviderProps {
  publicApiKey: string;
  distinctId?: unknown;
  userToken?: string; // jwt token needed when enhanced security mode is enabled
  host?: string; // custom host url
  refreshUserToken?: (
    oldUserToken: string,
    tokenPayload: Dictionary,
  ) => Promise<string>; // called after current user token expiry, call your BE api and return new user token
}

See client authentication for how to generate userToken on your backend.

Passing null (or undefined) for distinctId after a user was previously identified resets the client and clears the authenticated user — use this on logout.

Inside this provider you can mount SuprSendFeedProvider (for the inbox feed) and/or SuprSendPushProvider (for push notifications) — each is independent, so use whichever your app needs.

useSuprSendClient

This hook contains SuprSend client instance and has all the methods like, preferences, user methods etc. Read more here: https://github.com/suprsend/suprsend-react-core?tab=readme-ov-file#usesuprsendclient

Push notifications

Native FCM + APNs push delivery via expo-notifications.

For platform-specific setup (APNs credentials and entitlement on iOS, google-services.json and FCM credentials on Android), see PUSH_SETUP.md.

import { SuprSendExpoProvider, SuprSendPushProvider } from "@suprsend/expo-sdk";

export default function App() {
  return (
    <SuprSendExpoProvider {...authProps}>
      <SuprSendPushProvider>
        <RootNavigator />
      </SuprSendPushProvider>
    </SuprSendExpoProvider>
  );
}

SuprSendPushProvider waits for the user to be identified, then requests permission, obtains the native FCM/APNs token, and registers it with SuprSend.

Handling taps and foreground notifications

useSuprSendPushNotifications returns onPushNotificationReceived / onPushNotificationTapped subscribers. Each takes a handler and returns an unsubscribe function — drop them straight into useEffect.

import { useEffect } from "react";
import { useSuprSendPushNotifications } from "@suprsend/expo-sdk";

function PushListeners() {
  const { onPushNotificationReceived, onPushNotificationTapped } =
    useSuprSendPushNotifications();

  useEffect(
    () =>
      onPushNotificationReceived((notification) => {
        console.log("notification delivered", notification);
      }),
    [onPushNotificationReceived],
  );

  useEffect(
    () =>
      onPushNotificationTapped((response) => {
        console.log("notification tapped", response);
      }),
    [onPushNotificationTapped],
  );

  return null;
}

Unregister push

Call unregisterPushNotification() to remove the push token from the user in SuprSend. Usually called just before logout.

Manual registration

Disable auto-registration and call registerPushNotification() yourself — e.g. after an onboarding screen:

<SuprSendPushProvider autoRegister={false}>...</SuprSendPushProvider>
import { useSuprSendPushNotifications } from "@suprsend/expo-sdk";

function EnableNotificationsButton() {
  const { registerPushNotification } = useSuprSendPushNotifications();
  return (
    <Button
      title="Enable notifications"
      onPress={() => registerPushNotification()}
    />
  );
}

Push API reference

interface SuprSendPushProviderProps {
  children: ReactNode;
  autoRegister?: boolean;                         // default: true
  customNotificationHandler?: (notification: Notification) =>
    | NotificationBehavior
    | Promise<NotificationBehavior>;
  setupAndroidNotificationChannel?: () => Promise<void>;
}

useSuprSendPushNotifications(): {
  registerPushNotification: () => Promise<string | null>;
  unregisterPushNotification: () => Promise<void>;
  onPushNotificationReceived: (handler: (notification: Notification) => void) => () => void;
  onPushNotificationTapped:   (handler: (response: NotificationResponse) => void) => () => void;
};

Inbox feed

Headless in-app notification feed, re-exported from @suprsend/react-core. Render with React Native primitives.

Mount SuprSendFeedProvider inside SuprSendExpoProvider:

import { SuprSendExpoProvider, SuprSendFeedProvider } from "@suprsend/expo-sdk";

export default function App() {
  return (
    <SuprSendExpoProvider {...authProps}>
      <SuprSendFeedProvider>
        <RootNavigator />
      </SuprSendFeedProvider>
    </SuprSendExpoProvider>
  );
}
import { useFeedData, useFeedClient } from "@suprsend/expo-sdk";
import { FlatList, Text, Pressable } from "react-native";

function Inbox() {
  const feedData = useFeedData();
  const feedClient = useFeedClient();
  const { refresh } = useFeed(); // used to refresh inbox instance like pull to refresh etc

  return (
    <FlatList
      data={feedData?.notifications ?? []}
      keyExtractor={(n) => n.n_id}
      renderItem={({ item }) => (
        <Pressable onPress={() => feedClient?.markAsInteracted(item.n_id)}>
          <Text>{item.message.header}</Text>
        </Pressable>
      )}
    />
  );
}

Read more about available context and hooks:

See a full example: InboxScreen.tsx.

Preferences

Headless hooks for reading and updating a user's notification preferences, re-exported from @suprsend/react-core. The API is identical — follow the React preferences guide to wire it up in Expo.

See a full example: PreferenceScreen.tsx.