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
- Email OTP
Hello! I'm trying to have email verification OTP in my sign-up but i get this error OTP Verification Failed: Account creation failed: AppwriteException: User (r...
- User (role: guests) missing scope (accou...
1) Navigate to https://cloud.appwrite.io/console/login and login 2) Navigate to your account (https://cloud.appwrite.io/console/account) 3) Click the "Logout" ...
- getting {"name":"AppwriteException","cod...
Hey, so im running a express node server and im trying to delete/upload files over it, ```typescript await storage.deleteFile( process.env.APPWRITE_BU...