// with bundler...importcontentful_handlerfrom"@tomsd/contentful-handler";// getting tokencontentful_handler.getOAuthToken({client_id:"xxxxxxxxxx",redirect_uri:"https://xxxx.xxx.xxx/",scope:"content_management_manage"});// if got tokenconstch=contentful_handler.activate(token);// getting spacesch.getSpaces().then(function(spaces){console.log(spaces);});// getting environmentsch.getEnvironments(space_id).then(function(environments){console.log(environments);});// getting content typesch.getContentTypes(space_id,environment_id).then(function(contenttypes){console.log(contenttypes);});// getting entriesch.getEntries(space_id,environment_id).then(function(entries){console.log(entries);});ch.discoverEnvironments().then(function(envs){console.log(envs);});// data IO with each content typeconstdb=ch.getDb(space_id,environment_id,contenttype_id);db.getItems().then(function(items){console.log(items);});db.upsertItem({// for example content type has "name" and "age" fields.name:"alice",age:21}).then(function(upserted_item){console.log(upserted_item);});db.removeItem(entry_id).then(function(){console.log("removed");});