https://github.com/swellstores/swell-node
Swell NodeJS library for building storefronts and checkouts with Swell ecommerce.
https://github.com/swellstores/swell-node
ecommerce javascript nodejs storefront swell
Last synced: about 1 year ago
JSON representation
Swell NodeJS library for building storefronts and checkouts with Swell ecommerce.
- Host: GitHub
- URL: https://github.com/swellstores/swell-node
- Owner: swellstores
- License: mit
- Created: 2019-03-11T05:52:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-18T22:44:05.000Z (over 1 year ago)
- Last Synced: 2025-04-11T18:56:52.433Z (about 1 year ago)
- Topics: ecommerce, javascript, nodejs, storefront, swell
- Language: TypeScript
- Homepage: https://swell.is
- Size: 438 KB
- Stars: 19
- Watchers: 8
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Swell API library for NodeJS
[Swell](https://www.swell.is) 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 --save
## Connect
```javascript
const { swell } = require('swell-node');
swell.init('my-store', 'secret-key');
```
To connect to multiple stores in the same process, use `swell.createClient()`:
```javascript
const { swell } = require('swell-node');
const client1 = swell.createClient('my-store-1', 'secret-key-1');
const client2 = swell.createClient('my-store-2', 'secret-key-2');
```
## Usage
```javascript
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