Getting Started

Installation

Get started with jxpush by adding it to your Node.js project. We support npm, yarn, and pnpm out of the box.

Prerequisites

Before installing jxpush, ensure you have the following requirements met in your development environment:

  • Node.js version 14.x or higher
  • A valid Expo account or Firebase Project (for FCM)
  • TypeScript 4.5+ (if using TypeScript)

Install the package

Run one of the following commands in your terminal to add the library to your project dependencies:

bash
npm install jxpush

Or if you prefer Yarn or pnpm:

bash
yarn add jxpush
# or
pnpm add jxpush

Environment Setup

After installation, we recommend setting up your environment variables to store sensitive credentials like your Access Tokens or Service Account keys.

Create a .env file in your project root:

bash
# For Expo
EXPO_ACCESS_TOKEN=your_expo_access_token
# For FCM
GOOGLE_APPLICATION_CREDENTIALS=./path/to/service-account.json

Verify Installation

To ensure everything is working correctly, you can try initializing the client:

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

const client = new PushClient({
    provider: ProviderType.EXPO, // or ProviderType.FCM
    // ... config
});

console.log("jxpush client initialized");

infoTypeScript Support

jxpush is written in TypeScript and includes type definitions out of the box. You do not need to install a separate @types package.