Install the package from npm and import in your project.
npm install --save @moltin/sdk
To get started, instantiate a new Moltin client with your store credentials.
Note: This requires a Moltin account.
Alternatively you can include the
UMD bundle via UNPKG like so:
<script src=""></script><script>const Moltin = moltin;</script>
Note: If you're using webpack, you'll need to add the following to your projects configuration file.
You can now authenticate with the Moltin service 🎉
Check out the API reference to learn more about authenticating and the available endpoints.
If you're an enterprise customer with your own infrastructure, you'll need to specify your API URL when instantiating:
const Moltin =
By default the Moltin SDK persists data to
window.localStorage in the browser and
node-localstorage in Node. If this doesn't suit your needs you can override the default storage with a
const Moltin =;
Or alternatively, create your own storage factory by passing in an object which implements the following interface:
interface StorageFactory: void;: string | null;deletekey: string: void;
We love community contributions. Here's a quick guide if you want to submit a pull request:
- Fork the repository
- Add a test for your change (it should fail)
- Make the tests pass
- Commit your changes (see note below)
- Submit your PR with a brief description explaining your changes
Note: Commits should adhere to the Angular commit conventions.
Make sure you have Prettier installed for your editor with ESLint integration enabled.
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 run rollup while watching for changes.
npm install npm start
You can learn more about the Rollup API and configuration here.