Based on this documentation: https://appwrite.io/docs/references/cloud/server-nodejs/teams#createMembership
It indicates or labeled the url is an optional parameter. However in the sdk have this
createMembership(teamId: string, roles: string[], url: string, email?: string, userId?: string, phone?: string, name?: string): Promise<Models.Membership>;
As you can see the url
parameter is not optional. I am creating a membership through Server sdk. I think that no need to pass a url parameter? since it automatically add the member right?
await teams.createMembership($id, ["owner"], "", undefined, ownerRef);
as you can see I just left empty string in url passing values. But the error message said:
Error creating team: Invalid
url
param: URL host must be one of: localhost, cloud.appwrite.io
I believe the URL is optional in a mobile app - the SDK will automatically handle redirecting back to the app.
I think this is consider as a bug on server sdk?
No, why?
url parameter in server sdk is requiredπ©
the documentation said that the url parameter should be an optional
It's optional for mobile. If you're not on mobile, you'll need to set a redirect URL - how would Appwrite know where to send the user, otherwise?
As I said earlier, The documentation tells that in server sdk it automatically added the user in team
other one
as you can see the URL does not have required label so I think the Server sdk should also do the optional parameter
Url, become useless if the server side will auto added the member. Hence, there is no need to pass a url
Wait, I see what you're saying, sorry. I just checked the SDK, and as far as I can tell, url
is an optional parameter in the server SDKs - https://github.com/appwrite/sdk-for-node/blob/3e4e6ce7b1227be7ba7938b188a37df63cc24e4c/index.d.ts#L4120
why I am getting a required parameter
ohh I see I forgot to update the appwrite version, I thought was the bun template using the latest version of appwrite
thanks for the help
If your issue has been solved, you can close this post by adding β[SOLVED]β to the beginning of the title
[SOLVED] URL in Create team membership in Server (Bun) sdk
Recommended threads
- Upgrade Issue
Am having issue upgrading my appwrite account to pro as my card number is 19 and the required input is 16 digit
- Is there way to copy project (backup/res...
I think there is betterr way of fast back up / restore specified project
- Database setup
Hi everybody, I'm new to AppWrite and I need some help designing a database. I'm trying to set up a database where: 1. There are USERS 2. A USER can create an ...