createMembership
suspend fun Organization.createMembership(role: String, userId: String): ClerkResult<OrganizationMembership, ClerkErrorResponse>
Creates a new membership for this organization.
This method adds a user to the organization with the specified role. The user will gain access to the organization's resources based on their assigned role permissions.
Return
A ClerkResult containing the created OrganizationMembership on success, or a ClerkErrorResponse on failure.
Parameters
role
The role to assign to the new member. If null, the default role will be assigned.
userId
The unique identifier of the user to add to the organization. If null, the current user will be added.