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

@prosquad/react-native-sdk

v0.1.0

Published

Prosquad rider delivery SDK for React Native (Android only)

Readme

@prosquad/react-native-sdk

Android-only React Native SDK that embeds the Prosquad rider delivery flow into your app. The delivery UI runs in a full-screen native WebView with native integrations for location tracking, camera, QR scanning, and push notifications. Authentication is handled internally via OTP — no external auth token is needed.

Requirements

  • React Native >= 0.60.0
  • Android only (minSdk 24 / Android 7.0)

Installation

npm install @prosquad/react-native-sdk
# or
yarn add @prosquad/react-native-sdk

The library supports React Native autolinking — no manual native setup is required.

Android Permissions

The SDK declares the following permissions in its manifest (merged automatically):

  • INTERNET
  • ACCESS_FINE_LOCATION / ACCESS_COARSE_LOCATION / ACCESS_BACKGROUND_LOCATION
  • CAMERA
  • FOREGROUND_SERVICE (location)
  • POST_NOTIFICATIONS

Your app must request runtime permissions for location, camera, and notifications as appropriate.

Push Notifications (Firebase)

The SDK does not include Firebase itself. Your host app should integrate @react-native-firebase/messaging and forward notifications to the SDK (see usage below).

Usage

import * as ProsquadSDK from '@prosquad/react-native-sdk';

Launch the delivery flow

await ProsquadSDK.launch(
  {
    eid: 'your-enterprise-id',
    phoneNumber: '+919876543210',
    hostUserId: 'user-123',
    riderName: 'John Doe',       // displayed in the delivery UI
    city: 'Bangalore',
  },
  {
    onOrderComplete: (orderId, status) => {
      console.log(`Order ${orderId} completed with status: ${status}`);
    },
    onClose: () => {
      console.log('Delivery flow closed');
    },
    onNotificationReceived: (type, data) => {
      console.log('Notification received:', type, data);
    },
  },
);

Register FCM token

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

const token = await messaging().getToken();
await ProsquadSDK.registerDeviceToken(token);

Handle push notifications

// Background/quit handler
messaging().setBackgroundMessageHandler(async (remoteMessage) => {
  const handled = await ProsquadSDK.handleNotification(remoteMessage.data);
  if (handled) {
    await ProsquadSDK.showNotification({
      title: remoteMessage.notification?.title ?? 'New Order',
      body: remoteMessage.notification?.body ?? '',
      data: remoteMessage.data,
    });
  }
});

// Foreground handler
messaging().onMessage(async (remoteMessage) => {
  const handled = await ProsquadSDK.handleNotification(remoteMessage.data);
  if (handled) {
    await ProsquadSDK.showNotification({
      title: remoteMessage.notification?.title ?? 'New Order',
      body: remoteMessage.notification?.body ?? '',
      data: remoteMessage.data,
    });
  }
});

handleNotification returns true if the notification belongs to Prosquad (whitelisted types: order_assigned, batched_order_assigned, order_available, order_ready_pickup, auto_logout). If it returns false, your app should handle the notification itself.

Query active order status

const status = await ProsquadSDK.getActiveOrderStatus();
if (status) {
  console.log(`Active order: ${status.clientId}, state: ${status.orderState}`);
}

API Reference

| Function | Returns | Description | |----------|---------|-------------| | launch(config, listeners?) | Promise<void> | Opens the full-screen delivery WebView | | registerDeviceToken(token) | Promise<void> | Registers an FCM token with the Prosquad backend | | handleNotification(data) | Promise<boolean> | Forwards a push notification to the SDK; returns true if handled | | showNotification(options) | Promise<void> | Shows a local notification with the Prosquad order alert sound | | getActiveOrderStatus() | Promise<{clientId, orderState} \| null> | Returns current active order info, or null |

ProsquadLaunchConfig

| Field | Type | Required | Description | |-------|------|----------|-------------| | eid | string | Yes | Enterprise ID | | phoneNumber | string | Yes | Rider's phone number (used for OTP auth) | | hostUserId | string | Yes | User ID in the host app | | riderName | string | Yes | Rider's display name | | city | string | Yes | Rider's city |

ProsquadEventListeners

| Callback | Signature | Description | |----------|-----------|-------------| | onOrderComplete | (orderId: string, status: string) => void | Fired when a delivery is completed | | onClose | () => void | Fired when the rider closes the delivery UI | | onNotificationReceived | (type: string, data: Record<string, string>) => void | Fired when a Prosquad notification arrives while the UI is closed |

License

MIT