npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

clyde-sdk

v0.1.8

Published

Software development kit for Clyde in Node.js

Downloads

5

Readme

Clyde API

A node.js client library for the Clyde API. Head to https://api.joinclyde.com/docs for full documentation.

Install

$ npm install clyde-sdk

Getting started

The module supports all Clyde API Endpoints. For complete information about the API, head to the docs.

All endpoints require a valid clientKey and clientSecret.

const Clyde = require('clyde-sdk');

const clyde = new Clyde({
  clientKey: 'ck_your_key',
  clientSecret: 'sk_your_secret',
  isLive: true
});

When testing, set isLive to false and use test keys instead of live keys. This will allow you to test without creating active customers or contracts. When you are done testing, set isLive to true and use your live keys. Note that at this point all contract orders are considered live and valid.

Methods

All methods will return a promise. Feel free to use promises or async / await for control flow. Callbacks are not supported at this time. For a full list of parameters and return types, please see our documentation.

Create Product

Create a product. Please see documentation for available properties.

clyde.createProduct(productProperties).then((results) => {
  // Do something with results
});

Update Product

Update your product. First parameter is the product SKU; second is a list of properties to update.

clyde.updateProduct(exampleSku, productProperties).then((results) => {
  // Do something with results
});

Get One Product

Get only one product. Product SKU is the first parameter; there is an optional second parameter of anIP address for geo-sensitive queries.

clyde.getProduct(exampleSku, optionalIp).then((results) => {
  // Do something with results
});

Get Many Products

Get all products associated with your store. Optionally, you may pass in an opts object with a page number or comma-seperated list of SKUs to retrieve a particular page or a subset of SKUs, as well as an IP address for geo-sensitive queries.

clyde.getProducts(optionalOpts, optionalIp).then((results) => {
  // Do something with results
});

Get Contracts for a Product

Get all available contracts for a product. Product SKU is the first parameter; there is an optional second parameter of anIP address for geo-sensitive queries.

clyde.getContractsForProduct(exampleSku, optionalIp).then((results) => {
  // Do something with results
});

Create Order

Create an order. Use this to create a contract sale or report line items of insurable products for later sales. First parameter is your internal ID for the order; second is a list of options. Please see our documentation for available options.

clyde.createOrder(yourId, orderOptions).then((results) => {
  // Do something with results
});

Get Order

Get an order that has already been placed. The order ID from your system is the first and only parameter.

clyde.getOrder(yourId).then((results) => {
  // Do something with results
});

Cancel Order

Cancel an order you have already placed. Use this to cancel all contract sales, or generally remove from our system all line items associated with an order. The order ID from your system is the first and only parameter.

clyde.cancelOrder(yourId).then((results) => {
  // Do something with results
});

Get Contract Sale

Get a previously sold contract sale. The ID returned from the original sale is the first and only parameter.

clyde.getContractSale(clydeId).then((results) => {
  // Do something with results
});

Cancel Contract Sale

Cancel a previously sold contract sale. The ID returned from the original sale is the first and only parameter.

clyde.cancelContractSale(clydeId).then((results) => {
  // Do something with results
});

Error Handling

When an error occurs clyde-sdk will throw that error. Use try / catch with async / await or .catch() syntax with promises.

try {
  const product = await clyde.createProduct(productOptions);
} catch(e) {
  // Handle error
}

OR

clyde.createProduct(productOptions).then((results) => {
  // Do something with the results
}).catch((error) => {
  // Handle error
});

License

MIT