Organization invitation methods
These methods on the Organization
object allow you to manage the invitations to an organization.
The following examples assume:
- you have followed the quickstart in order to add Clerk to your JavaScript application
- you have enabled the Organizations feature in your Clerk Dashboard
getInvitations()
Retrieves the list of invitations for the currently active organization.
- Name
initialPage?
- Type
number
- Description
A number that can be used to skip the first n-1 pages. For example, if
initialPage
is set to 10, it is will skip the first 9 pages and will fetch the 10th page.
- Name
pageSize?
- Type
number
- Description
A number that indicates the maximum number of results that should be returned for a specific page.
- Name
status?
- Type
'pending' | 'accepted' | 'revoked'
- Description
The status an invitation can have.
Returns
Type | Description |
---|---|
Promise<ClerkPaginatedResponse<OrganizationInvitation>> | This method returns a Promise that resolves to a ClerkPaginatedResponse of OrganizationInvitation objects. |
Example
inviteMember()
Creates and sends an invitation to the target email address for becoming a member with the role passed on the function parameters.
- Name
emailAddress
- Type
string
- Description
The email address to invite.
- Name
role
- Type
string
- Description
The role of the new member.
Returns
Type | Description |
---|---|
Promise<OrganizationInvitation> | This method returns a Promise that resolves to the OrganizationInvitation for the created invitation. |
Example
inviteMembers()
Creates and sends an invitation to the target email addresses for becoming a member with the role passed in the parameters.
- Name
emailAddresses
- Type
string[]
- Description
The email addresses to invite.
- Name
role
- Type
string
- Description
The role of the new members.
Returns
Type | Description |
---|---|
Promise<OrganizationInvitation[]> | This method returns a Promise that resolves to an array of OrganizationInvitation objects for the created invitations. |
Example
Feedback
Last updated on