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
- User columns stuck on processing
Hi — on Appwrite Cloud (Free), Project ID 69d7dd8200098ed8560c, database mylestone-db. Attributes/columns are stuck in "processing" indefinitely across two coll...
- Error upgrading from 1.8.1 to 1.9.0
DO Self-hosted server failed to upgrade with this error "Error response from daemon: client version 1.52 is too new. Maximum supported API version is 1.42". U...
- MariaDB refuses to connect to appwrite
Earlier, I tried updating my Appwrite version from 18.1.x to the latest release because my Flutter package required it to function properly. I used the official...