
Heyo,
The web-sdk is client based, I think. Is there an sdk that supports server components?

node-appwrite

If I try to use this, i get: ⨯ ./node_modules/node-appwrite/lib/client.js:1:11 Module not found: Can't resolve 'os'

It seems to be the only way is to use the Rest API? I don't find any info about using it in server components, and installing fs etc. won't work.

honestly, i would advise against using all the server-side related stuff, especially because you're going to run into problems with authentication and sessions.
You may be able to use the web SDK, but you would need to manually manage the session.
Module not found: Can't resolve 'os'
Ya....NextJS has multiple runtimes so the code may not actually be running in a node runtime š

Hey, I understand with authentication etc. But what about getting documents? Or would you rather use api routes for this?

I would try to avoid connecting to Appwrite server-side. I would only fetch the documents client-side.

I do have one more question, is there a proper example on how to use authentication and get a cookie instead of local storage?

Every time i login, I get it as local storage, however sometimes it seems to make a cookie, but rarely.

(using the example btw)

The cookie is should always be set (when the session is created client side). Maybe if you weren't using HTTPS or if there's some other SSL issue between the client and Appwrite.

Alright, thanks.

[SOLVED] Can I use appwrite sdk using nextjs server components?
Recommended threads
- Appwrite Fra Cloud Custom Domains Issue
Iām trying to configure my custom domain appwrite.qnarweb.com (CNAME pointing to fra.cloud.appwrite.io with Cloudflare proxy disabled) but encountering a TLS ce...
- Appwrite service :: getCurrentUser :: Us...
Getting this error while creating a react app can someone please help me solve the error
- Storage & Database is not allowing.
Storage & Database is not allowing to CRUD after i have logged in ? Using web SDK with next.js without any SSR or node-sdk.
