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
- TablesDB `updateRows` returns `database_...
Hi Appwrite team! Iโm seeing a strange issue with TablesDB bulk row updates on a self-hosted Appwrite instance. **Environment** - Appwrite self-hosted `1.9.0` ...
- [SOLVED] Realtime Missing Channels
```js useEffect(() => { let subscription: RealtimeSubscription; async function loadChips() { try { const {rows: chi...
- Update row sheet not loading
After right clicking a row header and click update, the sidebar fails to load (never-ending skeleton)