https://github.com/zesty-io/fetch-wrapper
A client side JavaScript fetch wrapper for https://www.zesty.io APIs
https://github.com/zesty-io/fetch-wrapper
api api-wrapper javascript wrapper zesty-io
Last synced: 11 months ago
JSON representation
A client side JavaScript fetch wrapper for https://www.zesty.io APIs
- Host: GitHub
- URL: https://github.com/zesty-io/fetch-wrapper
- Owner: zesty-io
- Created: 2022-04-29T16:40:28.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-19T19:04:18.000Z (about 1 year ago)
- Last Synced: 2025-06-17T23:39:35.387Z (about 1 year ago)
- Topics: api, api-wrapper, javascript, wrapper, zesty-io
- Language: TypeScript
- Homepage:
- Size: 1.3 MB
- Stars: 4
- Watchers: 6
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Zesty.io API Fetch Wrapper





A javascript fetch wrapper for the Zesty.io APIs for frontend clients. For a backend node wrapper, use the [Zesty.io Node SDK](https://www.npmjs.com/package/@zesty-io/sdk)
## ⚡ Getting Started
Include the fetch wrapper into your project
```jsx
```
## 🚀 Example Usage
For this wrapper to run, you need an authenticated Zesty.io user APP_SID and a Instance ZUID
```jsx
const instanceZUID = "8-xyzxyz-xyz"
const userAppSID = "xxxxxxxxxx"
const ZestyAPI = new Zesty.FetchWrapper(instanceZUID, userAppSID)
console.log(ZestyAPI.getModels())
```
## 🎯 Features
### API Service the Wrapper can Access
- Instances API https://instances-api.zesty.org/
- Accounts API https://accounts-api.zesty.org/
- Auth API https://auth-api.zesty.org/
- Media API https://media-api.zesty.org/
Note all endpoints are ported. If you wish to port any missing endpoints, create a fork and pull request.
## 💡 Running locally
- ### 🙂 Using npm install
```jsx
npm install && npm start
```
then add this in the head of Html
```jsx
```
- ### 🐳 Using Docker
```jsx
docker build -t fetchWrapper .
```
```jsx
docker run -p 8080:8080 fetchWrapper
```
then add this in the head of Html
```jsx
```
## 💡 Use in Development Mode
To access dev and stage api url for zesty development, pass options to the instantation like so:
```jsx
const instanceZUID = "8-xyzxyz-xyz"
const userAppSID = "xxxxxxxxxx"
const ZestyAPI = new Zesty.FetchWrapper(instanceZUID, userAppSID, {
sitesServiceURL: "https://svc.dev.zesty.io/sites-service/",
instancesAPIURL: ".api.dev.zesty.io/v1",
authAPIURL: "https://auth.api.dev.zesty.io",
accountsAPIURL: "https://accounts.api.dev.zesty.io/v1",
mediaAPIURL: "https://svc.dev.zesty.io",
})
console.log(ZestyAPI.getModels())
```
## 💡 When commiting to github use
```jsx
npm run commit
```
## 💡 Bulding in Production
- Automated
- On successful merge to main will publish new release
- Manually
```jsx
git checkout main && npm run build && npm run release
```
## 🖥️ Code Contributors