
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
- how many Teams can be created?
I am creating an app where I will let users create groups. This could mean there will be many groups created by user, to isolate those groups properly I am thin...
- Cannot create a user
Hi, I am using a lowcoder frontend and trying to create a user in Appwrite (python function). Unfortunately, all I got is an error: "Raw body: Error". It means...
- React native app login via Safari
Hi! I deployed for debug my React Native app in web, chrome everythink works well but in safari on mac and ios I cant login. I found this one error in safari co...
