How do I use Code Buckets from JavaScript or Node.js?
const CB = "https://api.codebuckets.clatterlabs.xyz";
const H = {
Authorization: `Bearer ${process.env.CLATTER_API_KEY}`,
"X-Clatter-Account": process.env.CLATTER_ACCOUNT_ID,
};
const { data } = await fetch(`${CB}/v1/projects`, { headers: H }).then((r) => r.json());
console.log(data.map((p) => p.name));
Run this on your server, not in a browser: never ship a clsk_ key in front-end code. The Uploads guide has a complete Node.js uploader.
Related articles
Still need help?
Tried the steps above and still stuck? Email us. We usually reply within the first hour, and always within 24 hours. A full support team is with you.
Infrastructure questions, or permanent deletion of your data
infrastructure@clatterlabs.xyzFor deleting your whole account or the data of one service.