Web Developer
Hi, I tried to create a listBuckets() function using your documentation. Unfortunately I have some errors, like for example that .setkey is supposedly not a function. When I remove this I am told that .listBuckets() is not a function. Please find attached the code. I am using nextjs 14.
import { Account, Storage, Client } from "appwrite";
const client = new Client();
client .setEndpoint('https://cloud.appwrite.io/v1') .setProject('my project id') .setKey('my api key');
async function listfolders () { const storage = new Storage(client); const promise = storage.listBuckets();
promise.then(function (response) { console.log(response); }, function (error) { console.log(error); });}