I'm trying to get a realtime connection set up in Next.js, in a client side component for "chats." I have tested my code with a collection that has "any" read permissions, and everything works well then, but when there is "users" read permissions on it doesnt. This leads me to believe that the session is not being "sent" when establishing the realtime connection. Does anyone know how to properly do this? (Session in console log is true and the correct session value)
const createClientSessionClient = async (session: any) => {
console.log(`Setting session in createClientSessionClient: ${session ? 'true' : 'false'}`);
const client = new Client()
.setEndpoint(endpoint)
.setProject(project)
.setSession(session);
return {
get account() {
return new Account(client);
},
get databases() {
return new Databases(client);
},
get storage() {
return new Storage(client);
},
get client() {
return new Client().setEndpoint(endpoint).setProject(project).setSession(session);
}
};
};
export { createClientSessionClient, simpleClient };
Also the "get client()" used to only have:
return client
This didnt work either.
Recommended threads
- Cannot use custom SMTP for messaging (SM...
Hey there! I'm on Appwrite Self-hosted 1.9.0. I've never used the messaging feature before, always sent emails through functions or a custom backend, but I'v...
- CORS errors in Obsidian custom plugin
Hi, anyone here familiar with obsidian community plugins? In short: it's a local first note app which supports writing your own add-ons / plugin But I keep get...
- > AppwriteException: The requested servi...
When trying to read or write from my database I get the following error: > AppwriteException: The requested service is disabled. You can enable the service from...