Hello Appwriter, i can't get list of users from Appwrite
TypeScript
// This is your Appwrite function
// It's executed each time we get a request
export default async ({ req, res, log, error }) => {
const client = new Client();
const functions = new Functions(client);
const database = new Databases(client);
const storage = new Storage(client);
const users = new Users(client);
const ENDPOINT = process.env.MY_APPWRITE_ENDPOINT;
const PROJECT_ID = process.env.APPWRITE_FUNCTION_PROJECT_ID;
const API_KEY = process.env.APPWRITE_API_KEY;
const DATABASE_ID = process.env.DATABASE_ID;
const USERS_ID = process.env.USERS_ID;
client.setEndpoint(ENDPOINT).setProject(PROJECT_ID).setKey(API_KEY);
try{
//GET ALL USERS IN ACCOUNT
const result = await users.list();
log(`result ${result.documents}`);
log(`result ${result.documents.length}`);
}catch(error){
log({
"error": error,
"depth": 'Users Account',
})
}
return res.send({"data": "end like this"});
};```
TL;DR
Appwrite developer having trouble getting a list of users. The issue may be due to a problem with the Appwrite setup or the API key. Double-check the configuration and ensure the correct permissions are set.Recommended threads
- Bulk feature status
Hi there, I am using version 1.7.4 self hosted and wanted to use the bulk operations in a dart function. I saw that in the dart_appwrite sdk version 16.1.0 it ...
- CORS preflight returns 500 on Dart funct...
Hey everyone 👋 I’m running a Dart cloud function, Every time I respond to a preflight (OPTIONS) request, I get a 500 internal error, and the logs show: ```NoSu...
- execution failed
When executing an appwrite function, I'm getting a 500 error, but I don't see it in executions. This issue appeared today. Here's the appwrite function ID: 68b4...