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

@moltin/sdk

Package Overview
Dependencies
Maintainers
1
Versions
448
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@moltin/sdk

SDK for the Moltin eCommerce API

  • 2.10.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
417
decreased by-41.92%
Maintainers
1
Weekly downloads
Ā 
Created
Source

Moltin JavaScript SDK

npm version

A simple to use API interface to help get you off the ground quickly and efficiently with your Moltin JavaScript apps.

šŸ“š Wiki ā€” šŸ“š API docs ā€” šŸ“š moltin.com

Installation

Install the package from npm and import in your project.

npm install --save @moltin/sdk

Usage

To get started, instantiate a new Moltin client with your store credentials.

Note: This requires a Moltin account.

// JavaScript
import { gateway as MoltinGateway } from '@moltin/sdk';

const Moltin = MoltinGateway({
  client_id: 'XXX'
});

// Node.js
const MoltinGateway = require('@moltin/sdk').gateway;

const Moltin = MoltinGateway({
  client_id: 'XXX',
  client_secret: 'XXX',
});

Alternatively you can include the UMD bundle via UNPKG like so:

<script src="https://unpkg.com/@moltin/sdk">

<script>
  const Moltin = moltin.gateway({
    client_id: 'XXX'
  });
</script>

Note: If you're using webpack, you'll need to add the following to your projects configuration file.

node: {
  fs: 'empty'
}

You can now authenticate with the Moltin service šŸŽ‰

Moltin.Authenticate().then((response) => {
  console.log('authenticated', response);
});

Check out the wiki to learn more about authenticating and the available endpoints.

Custom Host

If you're an enterprise customer with your own infrastructure, you'll need to specify your API URL when instantiating:

const Moltin = MoltinGateway({
  client_id: 'XXX',
  host: 'api.yourdomain.com'
});

Contributing

We love community contributions. Here's a quick guide if you want to submit a pull request:

  1. Fork the repository
  2. Add a test for your change (it should fail)
  3. Make the tests pass
  4. Commit your changes (see note below)
  5. Submit your PR with a brief description explaining your changes

Note: Commits should adhere to the Angular commit conventions.

Development

The SDK is built with ES6 modules that are bundled using Rollup.

If you want to roll your own bundle, or make changes to any of the modules in src, then you'll need to install the package dependencies and build the dist files.

npm install
npm run build

You can learn more about the Rollup API and configuration here.

FAQs

Package last updated on 14 Nov 2017

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