Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swellstores/swell-node-http
HTTP client for Swell Backend API
https://github.com/swellstores/swell-node-http
ecommerce javascript nodejs swell typescript
Last synced: 3 months ago
JSON representation
HTTP client for Swell Backend API
- Host: GitHub
- URL: https://github.com/swellstores/swell-node-http
- Owner: swellstores
- License: mit
- Created: 2023-11-14T01:12:38.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-20T15:40:48.000Z (4 months ago)
- Last Synced: 2024-10-01T19:14:54.031Z (3 months ago)
- Topics: ecommerce, javascript, nodejs, swell, typescript
- Language: TypeScript
- Homepage: https://swell.is
- Size: 800 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
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-http --save
## Connect
```javascript
const { swell } = require('swell-node-http');swell.init('my-store', 'secret-key');
```To connect to multiple stores in the same process, use `swell.createClient()`:
```javascript
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
```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