Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sirena-api-integration-node-js

Package Overview
Dependencies
Maintainers
3
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sirena-api-integration-node-js

Node JS implementation for a custom integration with Sirena API

  • 1.10.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
3
Weekly downloads
 
Created
Source

Sirena Api Integration for Node JS

This NPM module allows a simple integration with the Sirena API.

You need a Sirena API Key to use this module.

Getting started

Install the module in your app:

npm install sirena-api-integration-node-js --save

Require the module in your app

var Sirena = require('sirena-api-integration-node-js');

Create a new instance of the Sirena class, passing an object with options:

var api = new Sirena(options);

The options are:

NameTypeDescription
apiKeystringRequired. The API Key provided by Sirena
isQuerybooleanIf true, sends the token as query param, otherwise, send as header param
apiUrlbooleanSpecifies the URL of the API. Default: http://api.getsirena.com/v1. You can change this when developing, to see if the integration you are setting is ok
Example
var options = {
    apiKey: 'YOUR_SIRENA_API_KEY'
}
var api = new Sirena(options);

Use

Once you have initialized the module with the correct options, you can access all the methods in the API through the object where you called the new instance of this module.

Each method makes the request to the API for you, and returns a "Q" Promise, that you can handle to access the request response.

Example
// Get all the Active Subscriptions in Sirena
api.getActiveSubscriptions()
        .then(function(response) {
            console.log('API response:', response);
        }, function(errorReason) {
            console.log('Error reason:', errorReason.body);
        })
        .catch(function(error) {
            // Handle any error
            console.log('Error :(', error);
        })
        .done();

To check all the methods with the API and all the parameters you need for each of them, just enter here

FAQs

Package last updated on 17 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc