New:Microsoft Teams Notifications Are Now Available in Socket.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

latest
Source
npmnpm
Version
1.1.46
Version published
Weekly downloads
0
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,
});

// Get shop products, filter by category
const { data, success, message } = await client.ecommerce.getProducts({
  category: '1',
});

// Get shop orders
const { data, success, message } = await client.ecommerce.getOrders();

// Get shop customers with pagination parameters
const { data, success, message } = await client.ecommerce.getCustomers({
  limit: 5,
  page: 1,
});

// Get user details
const { data, success, message } = await client.user.getDetails();

// Get connect to platform screen url
const connectUrl = client.auth.getConnectUrl();

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

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

Learn more about the different APIs in our official docs.

Keywords

Utils

FAQs

Package last updated on 23 Dec 2024

Related posts