open-index/open-npm huggingface dataset:
npm package: @subscribepro/sdk
Description: Interface for the SubscribePro API
Author: SubscribePro
Latest version: 1.0.0

# Subscribe Pro JavaScript Client

[![CircleCI](https://dl.circleci.com/status-badge/img/gh/subscribepro/subscribepro-js/tree/main.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/subscribepro/subscribepro-js/tree/main)

This is our JavaScript client library for accessing the Subscribe Pro REST API. Our API documentation is available at https://docs.subscribepro.com/technical/rest-api/.

To learn more about Subscribe Pro you can visit us at https://www.subscribepro.com/.

## Installation

This library is packaged as an [NPM package](https://www.npmjs.com/package/@subscribepro/sdk). You can install with NPM through the standard method:

```
npm install @subscribepro/sdk
```

If you are using YARN you add this library to your package.json with:

```
yarn add @subscribepro/sdk
```

## Usage

As this is packaged as a standard NPM typescript module the import should be familiar:

```javascript
import { SubscribePro } from '@subscribepro/sdk';

SubscribePro.configure({
  accessToken: 'ACCESS_TOKEN',
  environmentKey: 'ENVIRONMENT_KEY'
})
```

The API is split in to two versions that reflect the SubscribePro API versioning. The V2 and V3 APIs have overlapping functionality, but there are capabilities that can only be found in one or the other. The definitive documentation can be found on the SubscribePro docs:

- [V1 and V2 API Docs](https://api.subscribepro.com/docs/rest) (With the exception of the vault endpoints which are both V1 and V2, all endpoints are V2)
- [V3 API Docs](https://api.subscribepro.com/docs)

### Example (Retrieve and Update a Product V3 API)

```javascript
import { SubscribePro } from '@subscribepro/sdk';

SubscribePro.configure({
  accessToken: 'ACCESS_TOKEN',
  environmentKey: 'ENVIRONMENT_KEY'
})

let product = SubscribePro.V3.Products.findById({id: '12345'});
SubscribePro.V3.Products.update({id: product.id, data: {name: `${product.name} (2022)`}});
```

### Example (Retrieve and Update a Product V2 API)

```javascript
import { SubscribePro } from '@subscribepro/sdk';

SubscribePro.configure({
  accessToken: 'ACCESS_TOKEN',
  environmentKey: 'ENVIRONMENT_KEY'
})

let product = SubscribePro.V2.Products.getOne({id: '12345'});
SubscribePro.V2.Products.updateOne({id: product.id, data: {name: `${product.name} (2022)`}});
```

## License

[MIT](LICENSE)
npm package: @subscriptionflow-developer/subscriptionflow-node
Description: A library for integrating with SubscriptionFlow.
Author: SubscriptionFlow Developer
Latest version: 1.0.1

# SubscriptionFlow Node Client Library - API v1


This is the [node.js](http://nodejs.org/) Library for integrating with SubscriptionFlow. Sign up for a SubscriptionFlow account [here](https://www.subscriptionflow.com).

## License

MIT

## Getting started

### Getting authentication information
This library is intended to interact with the Subscription Flow api, so first of all we need an account [there](https://www.subscriptionflow.com). Once you are logged in your account you can get the <strong>base url</strong> of your instance in the address bar, it should look like "https://example.subscriptionflow.com". Then you should go to Administration Settings > USERS AND CONTROL > OAuth Clients, there you can create the OAuth Client and copy the <strong>client id</strong> and <strong>client secret</strong>.

### Starting to code
Inside a node project you can install the library running: 
<br>

```
npm i @subscriptionflow-developer/subscriptionflow-node
```

<br>
Once the library is installed import  and instantiate it passing the base url, client id and client secret that we mentioned before.<br>

```JavaScript
const SFlow = require('@subscriptionflow-developer/subscriptionflow-node');
var sFlow = new SFlow(base_url, client_id, client_secret);
```

<br>
After that we can call the methods in the format &#60;Subscriptionflow object&#62;.&#60;module&#62;.&#60;method()&#62;. See examples of common methods below.

```JavaScript
//Get all the products
products = await sFlow.products.get();
```
```JavaScript
//Get a product by id
product = await sFlow.products.getById(recordId);
```
```JavaScript
let createRecordData = {
    "name": "Test product",
    "description": "Test product created using api",
    "type": "Base Products",
    "status": "Active"
}

//Create Record
product = await sFlow.products.create(createRecordData);
```
```JavaScript
let updateRecordData = {
    "name": "Edited Test product"
}

//Update record
product = await sFlow.products.updateById(recordId, updateRecordData);
```
```JavaScript
//Delete record
product = await sFlow.products.deleteById(recordId);

```