# @parafin/parafin-node

> A node.js client for the Parafin API

Latest version **1.2.9** (published 2023-04-17) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install @parafin/parafin-node
pnpm add @parafin/parafin-node
yarn add @parafin/parafin-node
bun add @parafin/parafin-node
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.9 |
| Published | 2023-04-17 |
| First published | 2021-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 276.2 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | richard-parafin, jzhu-24, mackerson1234, tommymarshall, peter-parafin, henry-parafin, nrayamajhee, elmurati, reedhodder, druhinsgoel, ssatia-parafin |
| Keywords | parafin, parafin.js |

## Links

- npm: https://www.npmjs.com/package/@parafin/parafin-node
- Repository: https://github.com/buildparafin/parafin-node
- Homepage: https://github.com/buildparafin/parafin-node#readme
- Issues: https://github.com/buildparafin/parafin-node/issues
- npm.io page: https://npm.io/package/@parafin/parafin-node

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.21.2
- [axios-case-converter](https://npm.io/package/axios-case-converter.md) ^0.8.1

## Recent versions

- 1.2.9 (latest) — 2023-04-17
- 1.2.8 — 2023-03-16
- 1.2.7 — 2023-03-15
- 1.2.6 — 2022-06-09
- 1.2.5 — 2022-06-02
- 1.2.4 — 2022-06-02
- 1.2.3 — 2022-03-15
- 1.2.2 — 2022-01-18
- 1.2.1 — 2022-01-13
- 1.2.0 — 2021-12-08
- 1.1.3 — 2021-09-22
- 1.1.2 — 2021-09-22
- 1.1.1 — 2021-09-14
- 1.1.0 — 2021-09-14
- 1.0.22 — 2021-08-23
- … 17 more at https://npm.io/package/@parafin/parafin-node/versions

## README

# parafin-node [![Build](https://github.com/buildparafin/parafin-node/actions/workflows/build.yml/badge.svg)](https://github.com/buildparafin/parafin-node/actions/workflows/build.yml)

A node.js client library for the [Parafin API][2].

## Getting started

The module supports all Parafin API endpoints.  For complete information about the API, head
to the docs. All endpoints require a valid `client_id` and `secret` to access and are 
accessible from a valid instance of a Parafin client object:

```javascript
import * as parafin from './parafin'

const parafinClient = new parafin.Client({
  token: token,
  environment: parafin.environment.development,
})

// Example endpoint
parafinClient.partner().then((data: any) => console.log(data))
```

The `environment` parameter dictates which Parafin API environment you will access. Values are:
- `parafin.environment.production` - production use, makes requests on https://api.parafin.com
- `parafin.environment.development` - use for integration development and testing, makes requests on https://api.dev.parafin.com

## Methods

Once an instance of the client has been created you can use the following methods:
```javascript
// Receive a combined payload
parafinClient.data()

// Receive partner information
parafinClient.partner()

// Receive business information
parafinClient.businessCore()

// Receive offer collection information
parafinClient.offerCollection()

// Receive cash advance information
parafinClient.cashAdvance()

// Receive optIn information
parafinClient.optIn()

// OptInRequest object for posting an opt in
const accountManager: parafin.AccountManager {
  name: 'John Doe',
  email: 'jdoe@mygym.com'
}

const data: parafin.OptInRequest = {
  businessExternalId: 'externalId001',
  businessName: 'The Chiseled Jalapeño',
  ownerFirstName: 'John',
  ownerLastName: 'Doe',
  accountManagers: [
    accountManager
  ],
  routingNumber: '12345678',
  accountNumberLastFour: '0000',
  email: 'jdoe@mygym.com',
  postalCode: '12345'
}

// Post optIn information
parafinClient.postOptIn(data: OptInRequest)

// OptOutRequest object for posting an opt out
const data: parafin.OptOutRequest = {
  businessExternalId: string
}

// Post optOut information
parafinClient postOptOut(data: OptOutRequest)
```

## Install

```console
npm i parafin-node
```

## Build

```console
npm run build
```

## Lint

```console
npm run lint
```

## Local Run

```console
npx ts-node src/parafin.ts
```

## Support
Open an [issue][4]!

## License
[MIT][5]

[1]: https://parafin.com
[2]: https://docs.parafin.com
[3]: https://github.com/buildparafin/react-parafin-elements#readme
[4]: https://github.com/buildparafin/parafin-node/issues/new
[5]: https://github.com/buildparafin/parafin-node/blob/main/LICENSE

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