diff --git a/docs/components/clerk-provider.mdx b/docs/components/clerk-provider.mdx index 7d6060f0db..caef4d0951 100644 --- a/docs/components/clerk-provider.mdx +++ b/docs/components/clerk-provider.mdx @@ -15,7 +15,7 @@ The `` component must be added to your React entrypoint. The `` component needs to access headers to authenticate correctly. This means anything wrapped by the provider will be opted into dynamic rendering at request time. If you have static-optimized or ISR pages that you would prefer not to be opted into dynamic rendering, make sure they are not wrapped by ``. - This is easiest to accomplish by ensuring that `` is added further down the tree to wrap route groups that explicitly need authentication instead of having the provider wrap your application root as recommended above. For example, if your project includes a set of landing/marketing pages as well as a dashboard that requires sign in, you would create separate (marketing) and (dashboard) route groups. Adding `` to the `(dashboard)/layout.jsx` layout file will ensure that only those routes are opted into dynamic rendering, allowing the marketing routes to be statically optimized. + This is easiest to accomplish by ensuring that `` is added further down the tree to wrap route groups that explicitly need authentication instead of having the provider wrap your application root as recommended above. For example, if your project includes a set of landing/marketing pages as well as a dashboard that requires login, you would create separate (marketing) and (dashboard) route groups. Adding `` to the `(dashboard)/layout.jsx` layout file will ensure that only those routes are opted into dynamic rendering, allowing the marketing routes to be statically optimized. @@ -99,8 +99,8 @@ The `` component must be added to your React entrypoint. | `appearance?` | [Appearance](/docs/components/customization/overview) \| undefined | Optional object to style your components. Will only affect [Clerk Components][components-ref] and not [Account Portal][ap-ref] pages. | | `localization` | [Localization](/docs/components/customization/localization) \| undefined | Optional object to localize your components. Will only affect [Clerk Components][components-ref] and not [Account Portal][ap-ref] pages. | | `allowedRedirectOrigins?` | `Array` | Optional array of domains used to validate against the query param of an auth redirect. If no match is made, the redirect is considered unsafe and the default redirect will be used with a warning passed to the console. | -| `afterSignInUrl?` | `string` | The default URL to use after the user signs in. Defaults to `/`. | -| `afterSignUpUrl?` | `string` | The default URL to use after the user signs up. Defaults to `/`. | +| `afterSignInUrl?` | `string` | The default URL to use after the user signs in. | +| `afterSignUpUrl?` | `string` | The default URL to use after the user signs up. | | `isSatellite?` | `boolean \| ((url: URL) => boolean)` | This option defines that the application is a satellite application. | | `domain?` | `string \| ((url: URL) => boolean)` | This option sets the domain of the satellite application. If your application is a satellite application, this option is required. | | `signInUrl` | `string` | This url will be used for any redirects that might happen and needs to point to your primary application. This option is optional for production instances and required for development instances. | diff --git a/docs/references/backend/organization/get-organization-invitation-list.mdx b/docs/references/backend/organization/get-organization-invitation-list.mdx index eb86f33603..4e6b9d649f 100644 --- a/docs/references/backend/organization/get-organization-invitation-list.mdx +++ b/docs/references/backend/organization/get-organization-invitation-list.mdx @@ -1,6 +1,6 @@ --- title: getOrganizationInvitationList() -description: Use Clerk's Backend SDK to retrieve a list of organization invitations that have not yet been accepted. +description: Retrieves a list of organization invitations that have not yet been accepted. --- # `getOrganizationInvitationList()` @@ -8,7 +8,9 @@ description: Use Clerk's Backend SDK to retrieve a list of organization invitati Retrieves a list of organization invitations that have not yet been accepted. ```tsx -function getOrganizationInvitationList: (params: GetOrganizationInvitationListParams) => Promise>; +const organizationId = 'my-organization-id'; + +const invitations = await clerkClient.organizations.getOrganizationInvitationList({ organizationId }); ``` ## `GetOrganizationInvitationListParams` @@ -20,91 +22,46 @@ function getOrganizationInvitationList: (params: GetOrganizationInvitationListPa | `limit?` | `number` | The number of results to return. Must be an integer greater than zero and less than 500. | | `offset?` | `number` | The number of results to skip. | -## `getOrganizationInvitationList()` examples - -### `getOrganizationInvitationList({ organizationId})` - -In this example, you can see that the returned [`PaginatedResourceResponse`](/docs/references/backend/types/paginated-resource-response) includes `data`, which is an array of [`OrganizationInvitation`](/docs/references/javascript/organization-invitation) objects, and `totalCount`, which indicates the total number of organization invitations in the system for the specified organization. - -```tsx -const organizationId = 'org_2ZUtbk2yvnFGItdeze1ivCh3uqh'; - -const response = await clerkClient.organizations.getOrganizationInvitationList({ organizationId }); - -console.log(response); -/* -{ - data: [ - _OrganizationInvitation { - id: 'orginv_2b6b8BKxYmCdSNYtEBdk2aQSlyY', - emailAddress: 'testclerk123@gmail.com', - role: 'org:member', - organizationId: 'org_2ZUtbk2yvnFGItdeze1ivCh3uqh', - createdAt: 1705538313485, - updatedAt: 1705538313485, - status: 'pending', - publicMetadata: {}, - privateMetadata: {} - }, - _OrganizationInvitation { - id: 'orginv_2b6SO8VwBMDn2IMYn0xqiaSxVpN', - emailAddress: 'testclerk123@clerk.dev', - role: 'org:member', - organizationId: 'org_2ZUtbk2yvnFGItdeze1ivCh3uqh', - createdAt: 1705534000014, - updatedAt: 1705534817946, - status: 'revoked', - publicMetadata: {}, - privateMetadata: {} - } - ], - totalCount: 2 -} -*/ -``` +## Examples -### `getOrganizationInvitationList({ organizationId, status })` +### `getOrganizationInvitationList({ status })` Retrieves organization invitation list that is filtered by the status of the invitation. ```tsx -const organizationId = 'org_123'; +const organizationId = 'my-organization-id'; -const { data, totalCount } = await clerkClient.organizations.getOrganizationInvitationList({ +const invitations = await clerkClient.organizations.getOrganizationInvitationList({ organizationId, // returns a list of invitations that have not yet been accepted status: [ 'pending' ], }); ``` -### `getOrganizationInvitationList({ organizationId, limit })` +### `getOrganizationInvitationList({ limit })` Retrieves organization invitation list that is filtered by the number of results. ```tsx -const organizationId = 'org_123'; +const organizationId = 'my-organization-id'; -const { data, totalCount } = await clerkClient.organizations.getOrganizationInvitationList({ +const invitations = await clerkClient.organizations.getOrganizationInvitationList({ organizationId, // returns the first 10 results limit: 10, }); ``` -### `getOrganizationInvitationList({ organizationId, offset })` +### `getOrganizationInvitationList({ offset })` Retrieves organization invitation list that is filtered by the number of results to skip. ```tsx const organizationId = 'my-organization-id'; -const { data, totalCount } = await clerkClient.organizations.getOrganizationInvitationList({ +const invitations = await clerkClient.organizations.getOrganizationInvitationList({ organizationId, // skips the first 10 results offset: 10, }); -``` - -## Backend API (BAPI) endpoint - -This method in the SDK is a wrapper around the BAPI endpoint `GET/organizations/{organization_id}/invitations`. See the [BAPI reference](https://clerk.com/docs/reference/backend-api/tag/Organization-Invitations#operation/ListOrganizationInvitations) for more details. \ No newline at end of file +``` \ No newline at end of file diff --git a/docs/references/javascript/overview.mdx b/docs/references/javascript/overview.mdx index 043c539aae..ef1ff4b552 100644 --- a/docs/references/javascript/overview.mdx +++ b/docs/references/javascript/overview.mdx @@ -66,7 +66,7 @@ Add the following script to your site's `` element: