addOrganizationMember()
Creates an organization membership for a user using role ids.
Usage
The following example shows a basic usage of the backend client from @wacht/nextjs/server.
import { wachtClient } from '@wacht/nextjs/server';export async function addOrganizationMember(organizationId: string, userId: string, roleId: string) { const client = await wachtClient(); return client.organizations.addOrganizationMember(organizationId, { user_id: userId, role_ids: [roleId], });}Signature
function addOrganizationMember( organizationId: string, request: AddOrganizationMemberRequest,): Promise<OrganizationMember>Parameters
›organizationId?: string | undefined;
organizationId?: string | undefined;Stable organization id.
›request.user_id?: string | undefined;
request.user_id?: string | undefined;User id to add.
›request.role_ids?: string[] | undefined;
request.role_ids?: string[] | undefined;Organization role ids assigned to the membership.
Behavior
- Wraps the corresponding backend endpoint for this capability.
- Use the returned payload as canonical backend state for follow-up operations.