Documentation

React Native SDK

Identify users, register push tokens, and track events from React Native apps.

Install

bash
npm install @payghaam/react-native
cd ios && pod install

Quick start

tsx
import { Payghaam } from "@payghaam/react-native";

Payghaam.initialize({
  appId: "YOUR_PROJECT_ID",
  apiKey: "ek_client_...",
  baseUrl: "https://api.yourhost.com",
});

await Payghaam.login("user-123");
await Payghaam.requestPushPermission();
await Payghaam.trackEvent("app_open");

Architecture

  • Native module — push permission, FCM/APNs token, notification open/foreground events, and (delegating to the native iOS/Android SDK) login, tags, events, and subscriptions
  • JavaScript — a fetch-based fallback for /api/sdk/*, used only if no native module is present

iOS setup

Same capabilities as the Flutter iOS path — see iOS setup. Call shareConfig for NSE delivery receipts.

Android setup

Add google-services.json and register PayghaamReactNativePackage in your Application — see Android setup.

info

Note

Prefer Dart? The Flutter SDK uses the same backend endpoints with a single codebase for iOS and Android.