# exponent-server-sdk

> Server side library for working with Expo using Node.js

Latest version **2.3.1** (published 2017-03-18) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install exponent-server-sdk
pnpm add exponent-server-sdk
yarn add exponent-server-sdk
bun add exponent-server-sdk
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.3.1 |
| Published | 2017-03-18 |
| First published | 2016-09-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | support@expo.io |
| Maintainers | exponent, ide, skevy |
| Keywords | exponent, react-native, push-notifications |

## Links

- npm: https://www.npmjs.com/package/exponent-server-sdk
- Repository: https://github.com/exponent/exponent-server-sdk-node
- Homepage: https://github.com/exponent/exponent-server-sdk-node#readme
- Issues: https://github.com/exponent/exponent-server-sdk-node/issues
- npm.io page: https://npm.io/package/exponent-server-sdk

## Dependencies (3)

- [invariant](https://npm.io/package/invariant.md) ^2.2.2
- [node-fetch](https://npm.io/package/node-fetch.md) ^1.6.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.11.6

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 2.3.1 (latest) — 2017-03-18
- 2.3.0 — 2017-03-18
- 2.2.0 — 2017-02-14
- 2.1.0 — 2017-02-11
- 2.0.1 — 2017-02-04
- 2.0.0 — 2017-02-04
- 1.0.5 — 2016-10-12
- 1.0.3 — 2016-09-22
- 1.0.2 — 2016-09-22
- 1.0.1 — 2016-09-21
- 1.0.0 — 2016-09-21

## README

# exponent-server-sdk-node
Server side library for working with Exponent using Node.js

## Usage

```bash
yarn add exponent-server-sdk
```

```js
import Expo from 'exponent-server-sdk';

// To check if something is a push token
let isPushToken = Expo.isExponentPushToken(somePushToken);

// Create a new Expo SDK client
let expo = new Expo();

// To send push notifications -- note that there is a limit on the number of
// notifications you can send at once, use expo.chunkPushNotifications()
(async function() {
  try {
    let receipts = await expo.sendPushNotificationsAsync([{
      // The push token for the app user to whom you want to send the notification
      to: 'ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]',
      sound: 'default',
      body: 'This is a test notification',
      data: {withSome: 'data'},
    }]);
    console.log(receipts);
  } catch (error) {
    console.error(error);
  }
})();
```

## Developing

The source code is in the `src/` directory and babel is used to turn it into ES5 that goes in the `build/` directory.

To build, `npm run build`.

To build and watch for changes, `npm run watch`.

## TODO

  * Need to add tests

## See Also

  * https://github.com/exponent/exponent-server-sdk-ruby
  * https://github.com/exponent/exponent-server-sdk-python

---
_Source: https://npm.io/package/exponent-server-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
