sleekshop-sdk
v1.0.3
Published
> This project is still in development and not ready for production use. > Please feel free to contribute to this project by opening issues or pull requests.
Downloads
8
Readme
Sleekshop JS SDK
This project is still in development and not ready for production use. Please feel free to contribute to this project by opening issues or pull requests.
This is the official Sleekshop JS SDK. It provides a simple way to integrate your Sleekshop store API with any JS based browser or app.
Installation
# Using npm
npm install sleekshop-sdk
# Using yarn
yarn add sleekshop-sdk
# Using pnpm
pnpm add sleekshop-sdk
Usage
- Initialize a client with your Sleekshop API credentials
ESM:
import SleekshopSDK from "sleekshop-sdk";
const client = new SleekshopSDK({
baseUrl: 'https://<shopname>.sleekshop.net/srv/service/',
licence_username: '<licence_username>',
licence_password: '<licence_password>',
licence_secret_key: '<licence_secret_key>' // optional
});
CommonJS:
const SleekshopSDK = require('sleekshop-sdk');
const client = new SleekshopSDK({
baseUrl: 'https://<shopname>.sleekshop.net/srv/service/',
licence_username: '<licence_username>',
licence_password: '<licence_password>',
licence_secret_key: '<licence_secret_key>' // optional
});
- Use the client to make API calls
example:
// Get a new session
client.sessions.getNewSession().then((p) => {
console.log(p)
})
// or with async/await
const session = await client.sessions.getNewSession();
console.log(session);
Todos
- [ ] make the args for all calls more consistent
- [ ] add type definitions for all requests and responses
- [ ] add documentation for all endpoints provided by the sdk
Documentation
For more information about the Sleekshop API, please refer to the official documentation.