ksensetech-knack-collection
v1.0.2
Published
async knack collection
Downloads
2
Readme
Envirotment file (.env)
# Knack Application Config
KNACK_APPLICATION_ID = "<<YOUR-KNACK-APPLICATION_ID>>"
KNACK_API_KEY = "<<YOUR-KNAC-API_KEY>>"
Example : Object Collection
let _collection = require('ksensetech-knack-collection').collection;
let dataCollection = _collection.objectCollection({
url : "https://us-east-1-renderer-read.knack.com/v1/objects/{object_ID}/records"
}).retry({integer:retry}) // .retry(3)
.then((response) => {
// .. code
})
.catch(err){
// .. code
}
Example : Object Collection Async await
let dataCollection = _collection.objectCollection({
url : "https://us-east-1-renderer-read.knack.com/v1/objects/{object_ID}/records"
});
(async () => {
try{
let response = await dataCollection.retry(2);
console.log(response);
}catch(err){
console.log(err);
}
})();