# @dosomething/gateway

> Standard JS API client for DoSomething.org services.

Latest version **3.1.1** (published 2021-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dosomething/gateway
pnpm add @dosomething/gateway
yarn add @dosomething/gateway
bun add @dosomething/gateway
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.1.1 |
| Published | 2021-03-23 |
| First published | 2017-02-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | 8.11.1 |
| Dependencies | 6 |
| Unpacked size | 62.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Diego Lorenzo |
| Maintainers | rafacode, dosomething-admin, dfurnes, weerd, aaronschachter, mendelb |

## Links

- npm: https://www.npmjs.com/package/@dosomething/gateway
- npm.io page: https://npm.io/package/@dosomething/gateway

## Dependencies (6)

- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [winston](https://npm.io/package/winston.md) ^2.4.4
- [date-fns](https://npm.io/package/date-fns.md) ^1.30.1
- [superagent](https://npm.io/package/superagent.md) ^3.8.3
- [simple-oauth2](https://npm.io/package/simple-oauth2.md) ^1.6.0
- [superagent-use](https://npm.io/package/superagent-use.md) ^0.1.0

## Recent versions

- 3.1.1 (latest) — 2021-03-23
- 3.1.0 — 2021-03-22
- 3.0.1 — 2021-03-22
- 3.0.0 — 2021-03-19
- 2.0.1 — 2019-06-19
- 2.0.0 — 2019-03-04
- 1.5.0 — 2018-12-11
- 1.4.0 — 2018-05-14
- 1.3.0 — 2018-04-18
- 1.2.2 — 2018-04-06
- 1.2.1 — 2018-04-06
- 1.2.0 — 2018-03-22
- 1.1.6 — 2018-02-16
- 1.1.5 — 2017-08-25
- 1.1.4 — 2017-08-25
- … 7 more at https://npm.io/package/@dosomething/gateway/versions

## README

# Gateway (JS)

This is a simple JavaScript API client for DoSomething.org service, modeled after the [Gateway](https://github.com/DoSomething/gateway) PHP API client.

### Installation
Install your own copy of Gateway JS using [npm](#):

```
npm install @dosomething/gateway --save
```

### Browser
Include the bundled `dist/gateway.js` in your page, or require it using a module bundler.

### Server
- Set valid ENV variables in your project. See: `.env.example`.
- Require the server module `@dosomething/gateway/server`.

### Usage

```javascript
/**
 * Browser
 * somefile.js
 */

import { RestApiClient, PhoenixAshes } from '@dosomething/gateway';

console.log(new RestApiClient());
console.log(new PhoenixAshes());


/**
 * Server
 * somefile.js
 */

 const { GatewayClient } = require('@dosomething/gateway/server');

 const gatewayClient = GatewayClient.getNewInstance();
```

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