https://github.com/techulus/push-js-sdk
Push by Techulus - JavaScript SDK
https://github.com/techulus/push-js-sdk
android api ios javascript nodejs push-notifications
Last synced: 5 months ago
JSON representation
Push by Techulus - JavaScript SDK
- Host: GitHub
- URL: https://github.com/techulus/push-js-sdk
- Owner: techulus
- License: mit
- Created: 2020-02-27T10:47:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-04-15T11:52:55.000Z (about 3 years ago)
- Last Synced: 2025-12-31T08:41:01.007Z (6 months ago)
- Topics: android, api, ios, javascript, nodejs, push-notifications
- Language: JavaScript
- Homepage: https://push.techulus.com
- Size: 496 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Push JavaScript SDK
Get custom real-time notifications on your iOS & Android devices
**⚠️⚠️ `v2.x.x` has breaking changes, import has changed ⚠️⚠️**
## Pre-requisites
To run this SDK you'll need:
- An API key from Push (https://push.techulus.com/), to get the API key you've to install Push's iOS or Android app and create an account.
## Install
- Using NPM -> `npm i push-sdk`
- Using Yarn -> `yarn add push-sdk`
## Usage
Import and initialise the SDK using your API key
```javascript
const { Push } = require("push-sdk");
const pushClient = new Push("your_api_key");
```
or (TypeScript)
```typescript
import { Push } from "push-sdk";
const pushClient = new Push("your_api_key");
```
### Sending notification using `pushClient.notify` method
Notification with title and body
```javascript
const sendNotification = async () => {
try {
await pushClient.notify("Title", "Body");
} catch (e) {
// handle error
}
};
```
Notification with additional options (link or image)
```javascript
const sendNotification = async () => {
try {
await pushClient.notify("Title", "Body", {
link: "https://techulus.com",
image: "https://techulus.com/assets/img/logo.png",
});
} catch (e) {
// handle error
}
};
```
## Support
Feature Request, Bugs and Ideas can be added [here.](https://pushbytechulus.freshdesk.com/support/tickets/new)