New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@commonninja/node-sdk

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commonninja/node-sdk

Common Ninja SDK for NodeJS

Source
npmnpm
Version
1.0.12
Version published
Weekly downloads
70
483.33%
Maintainers
2
Weekly downloads
 
Created
Source

@commonninja/node-sdk

Release

Installation

// NPM
npm i @commonninja/node-sdk

// Yarn
yarn add @commonninja/node-sdk

Usage

import { CommonNinja } from '@commonninja/node-sdk';

const client = new CommonNinja({
  appId: process.env.COMMONNINJA_APP_ID,
  appSecret: process.env.COMMONNINJA_APP_SECRET,
  accessToken: req.query.token,
  env: CommonNinja.envs.production,
});

// Make api request to get the shop products resource
const { data, success, message } = await client.request({
    path: 'products'
});

// Get Shopify authentication url
const redirectUrl = client.getAuthenticationUrl('shopify');

// Validate an incoming webhook message from Common Ninja
client.validateWebhook(req);

Learn more about the different APIs in our official docs.

Keywords

Utils

FAQs

Package last updated on 19 Apr 2022

Related posts