Back

[SOLVED] Can't add a user to a team using Node.js Server SDK

  • 0
  • Teams
  • Self Hosted
  • Web
andrei
9 Aug, 2023, 08:00
TL;DR
Solution: The user was experiencing an issue with adding a user to a team using the Node.js Server SDK. They were advised to downgrade to version 8.1.0 of the `node-appwrite` package, as version 9.0.0 was causing compatibility issues. After downgrading, the issue was resolved. The user also had concerns about the redirect URL, but it was clarified that from the server SDK, the URL doesn't matter because no redirect is expected. The user was provided with the correct documentation for adding a user to a team using the server SDK.
safwan
9 Aug, 2023, 08:00

Oops my bad

safwan
9 Aug, 2023, 08:00

I was on 1.3.x docs

andrei
9 Aug, 2023, 08:01

i was told the redirect url is optional when adding using the server sdk?

andrei
9 Aug, 2023, 08:01

but the error is not about that

safwan
9 Aug, 2023, 08:01

The URL doesn't really matter because from the server SDK, they don't get an email so no redirect.

safwan
9 Aug, 2023, 08:01

Once again, you're using v9.0.0 of the nodejs sdk?

andrei
9 Aug, 2023, 08:02

yes

andrei
9 Aug, 2023, 08:02

latest

andrei
9 Aug, 2023, 08:02
TypeScript
[10:54:40 am] [nuxt] [request error] [unhandled] [500] Param "email" is not optional.
  at Client.call (D:\projects\liceulmeu\node_modules\node-appwrite\lib\client.js:172:31)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)  
  at async Teams.createMembership (D:\projects\liceulmeu\node_modules\node-appwrite\lib\services\teams.js:271:16)
  at async /D:/projects/liceulmeu/.nuxt/dev/index.mjs:1079:10
  at async Object.handler (/D:/projects/liceulmeu/node_modules/h3/dist/index.mjs:1284:19)
  at async Server.toNodeHandle (/D:/projects/liceulmeu/node_modules/h3/dist/index.mjs:1359:7)
andrei
9 Aug, 2023, 08:02

full stacktrace

joeyouss
9 Aug, 2023, 08:02
safwan
9 Aug, 2023, 08:02

The issue is with the SDK version

safwan
9 Aug, 2023, 08:03

v9.0.0 is compatible with Appwrite v1.3.x

andrei
9 Aug, 2023, 08:03

do i need to downgrade?

safwan
9 Aug, 2023, 08:03

Use v8.1.0 of the node-appwrite package and it should work

andrei
9 Aug, 2023, 08:04

thanks

andrei
9 Aug, 2023, 08:04

<:appwritepeepo:902865250427215882>

safwan
9 Aug, 2023, 08:04

Let us know if there's any issues even after downgrading!

andrei
9 Aug, 2023, 08:05

my order of params is correct?

safwan
9 Aug, 2023, 08:05

For the v8.1.0 it should be correct

safwan
9 Aug, 2023, 08:05

as that's the corresponding sdk for cloud

andrei
9 Aug, 2023, 08:05

yup it worked i just had to put a random url in because it complained about that after dowgrading

safwan
9 Aug, 2023, 08:06

Alright then, I'll mark this issue as solved πŸ˜„

safwan
9 Aug, 2023, 08:06

[SOLVED] Can't add a user to a team using Node.js Server SDK

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more