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.
getInvitations()
returns
Type | Description |
---|---|
Promise<ClerkPaginatedResponse<OrganizationInvitation>> | This method returns a Promise that resolves to a ClerkPaginatedResponse of OrganizationInvitation objects. |
getInvitations()
example
Retrieves a list of organization invitations that have not yet been accepted.
- Name
limit
- Type
number
- Description
Limit of the results returned.
- Name
offset
- Type
number
- Description
The offset of results to start the retrieval.
getPendingInvitations()
returns
Type | Description |
---|---|
Promise<OrganizationInvitation[]> | This method returns a Promise which resolves with a list of OrganizationInvitation objects. |
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.
inviteMember()
returns
Type | Description |
---|---|
Promise<OrganizationInvitation> | This method returns a Promise that resolves to the OrganizationInvitation for the created invitation. |
inviteMember()
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.
inviteMembers()
returns
Type | Description |
---|---|
Promise<OrganizationInvitation[]> | This method returns a Promise that resolves to an array of OrganizationInvitation objects for the created invitations. |
inviteMembers()
example
Feedback
Last updated on