Getting Started

Firebase Setup

Configure jxpush to work with Firebase Cloud Messaging (FCM).

Service Account

jxpush requires a Firebase Admin SDK service account to authenticate with FCM.

  1. Go to Firebase Console → Project Settings
  2. Select Service accounts tab
  3. Click Generate new private key
  4. Save the JSON file to your project root (e.g., service-account.json)

⚠️ Important: Never commit your service account file to version control. Add it to your .gitignore.

Initialization

typescript
import { PushClient, ProviderType } from 'jxpush';

const client = new PushClient({
  provider: ProviderType.FCM,
  fcm: {
    serviceAccount: require('./service-account.json')
  }
});