How to read or filter notify message
Hi with current sample it alway read from start when start, is there anyway to filter the min/max time or just ignore the previous recevied notify, tks
import TikAPI from 'tikapi';
const api = TikAPI("myAPIKey");
const User = new api.user({
accountKey: "DemoAccountKeyTokenSeHYGXDfd4SFD320Sc39Asd0Sc39A"
});
(async function(){
try{
let response = await User.notifications();
console.log(response?.json);
while(response){
let min_time = response?.json?.min_time;
console.log("Getting next items ", min_time);
response = await Promise.resolve(
response?.nextItems()
);
}
}
catch(err){
console.log(err?.statusCode, err?.message, err?.json)
}
})();