Hey, how should I work with the two SDK
I'm using Nextjs so al the authentication process is made with the node-sdk but there are some queries to the database I need to do with the client SDK
Currently I'm doing:
TypeScript
const sessionClient = () => {
const session = getCookie(SESSION_COOKIE_TOKEN);
return new Client()
.setEndpoint(Server.endpoint || "")
.setProject(Server.project || "")
.setSession(session || "");
}
const client = sessionClient();
const databases = new Databases(client)
However when I do a request I got an error 401
When I see the the request headers I see the session token (see the image), what I'm doing wrong?
TL;DR
The developer is trying to work with both client and server SDKs in a Next.js project. They are using the `node-sdk` for authentication and the client SDK for database queries. They are experiencing a `401` error even though the session token is present in the request headers. There may be an issue with the way the session token is being set or passed.
**Solution:**
- Double-check the session token generation and ensure it is correctly passed to the client SDK.
- Make sure the server SDK and client SDK configurations are properly set up.
- Debug the authentication flow to identify any issues in the session establishment process.Recommended threads
- Github connection error - Self Hosted Ap...
I am trying to connect my github account to deploy a project to sites, but Connect to Gtihub button is disabled. I have configured all Env variables needed for...
- "Domain verification failed"
"Domain verification failed" I was install Appwrite in my VDS server. I using Coolify for install Appwrite. After install complete, i want add my domain, and i ...
- Server Down
Appwrite services are down. When will they start working again?