A javascript fetch wrapper for the Zesty.io APIs for frontend clients. For a backend node wrapper, use the Zesty.io Node SDK
Include the fetch wrapper into your project
<script
async
src="https://cdn.jsdelivr.net/gh/zesty-io/fetch-wrapper@latest/dist/index.js"
></script>
For this wrapper to run, you need an authenticated Zesty.io user APP_SID and a Instance ZUID
const instanceZUID = "8-xyzxyz-xyz"
const userAppSID = "xxxxxxxxxx"
const ZestyAPI = new Zesty.FetchWrapper(instanceZUID, userAppSID)
console.log(ZestyAPI.getModels())
- 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.
npm install && npm start
then add this in the head of Html
<script async src="http://localhost:8080/index.js"></script>
docker build -t fetchWrapper .
docker run -p 8080:8080 fetchWrapper
then add this in the head of Html
<script async src="http://localhost:8080/index.js"></script>
To access dev and stage api url for zesty development, pass options to the instantation like so:
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())
npm run commit
-
Automated
- On successful merge to main will publish new release
-
Manually
git checkout main && npm run build && npm run release