JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 80
  • Score
    100M100P100Q65435F
  • License MIT

Swell API client for NodeJS

Package Exports

  • swell-node-http
  • swell-node-http/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (swell-node-http) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Swell API library for NodeJS

Swell is a customizable, API-first platform for powering modern B2C/B2B shopping experiences and marketplaces. Build and connect anything using your favorite technologies, and provide admins with an easy to use dashboard.

Install

npm install swell-node-http --save

Connect

const { swell } = require('swell-node-http');

swell.init('my-store', 'secret-key');

To connect to multiple stores in the same process, use swell.createClient():

const { swell } = require('swell-node-http');

const client1 = swell.create('my-store-1', 'secret-key-1');
const client2 = swell.create('my-store-2', 'secret-key-2');

Usage

try {
  const { data } = await swell.get('/products', {
    active: true
  });
  console.log(data);
} catch (err) {
  console.error(err.message);
}

Documentation

This library is intended for use with the Swell Backend API: https://developers.swell.is/backend-api

Contributing

Pull requests are welcome

License

MIT