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
- HUGE OUTRAGE IN APPWRITE, I CANNOT ACCES...
I have 2k users trying to access, sending me messages. What am I supposed to do? Please solve this asap.
- All my apps are not opening now
All my apps are not opening now 200+ apps are not opening plz fast
- Failed to generate functions SSL
```appwrite-worker-certificates | Cannot renew domain (functions.domain.com) on attempt no. 9 certificate: Failed to verify domain DNS records. appwrite-worker...