Back

[SOLVED] Create team in fuction

  • 0
  • Functions
hy
29 Sep, 2023, 13:44

Can I check whether the user sending the request is premium in appwrite functions, create a team within the function, and assign the user sending the request as the team owner?

TL;DR
1. You can retrieve the user ID from the `x-appwrite-user-id` header in the header. 2. Use the `listMemberships` function to check the user's membership status. 3. Utilize the Team Server SDK to add the user to the team as the owner.
Binyamin
29 Sep, 2023, 14:03

Sure

  1. Inside the header x-appwrite-user-id you'll have the user ID.
  2. Then you can use the `listMemberships` to check the user membership status
  3. Then you can use the Team Server SDK to add the user to the team and give the user the owner role
hy
29 Sep, 2023, 14:15

Thank you πŸ™‚

Drake
29 Sep, 2023, 16:27

[SOLVED] Create team in fuction

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