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
- "Restore project" button fails: "Invalid...
In the dashboard, it clicking "Restore project" fails. The request sent to `PATCH https://cloud.appwrite.io/v1/projects/:project_id` with payload `{status: "act...
- how to access the value of account statu...
- Redirect from clicking team invite link ...
Hi all! Pretty new to app development in general so this might be something more generic than appwrite, but I've found (after reading the docs for the Teams API...