Hi All, I seem to be having issues with nodejs and the sdk.
I've setup an API key which has all scopes for the project, but I keep getting the "The current user is not authorized to perform the requested action." error.
If I change the collection permission settings so that 'all guests' can do all actions it works fine, but I thought the API keys didn't use the permission settings of the collection, so I'm a little confused. Any suggestions?
const dotenv = require("dotenv");
dotenv.config({ path: "./config.env" });
//const mapping from process.env here
const client = new sdk.Client()
.setEndpoint("https://my.fqdn.here/v1")
.setProject(APPWRITE_PROJECT)
.setSession(APPWRITE_API_KEY);
const databases = new sdk.Databases(client);
async function getDocuments() {
try {
const result = await databases.listDocuments(
APPWRITE_DB, // databaseId
APPWRITE_COLLECTION // collectionId
);
console.log(result);
} catch (error) {
console.log(error);
}
}
getDocuments();
Recommended threads
- Using `createVerification()` with SMTP d...
It's probably something obvious, but I've got SMTP disabled because I'm using the Resend package to send emails, but I still need to get the secret from `create...
- realtime not working
realtime docker is up and running but see 1000s lines of this in the logs: ``` [2024-05-20 10:51:47 *4899.152] NOTICE ThreadPool::create_thread(:322): cre...
- upgrade 1.5.4. to 1.5.5 migration
pls see screenshot.. pls help