Skip to content

Commit

Permalink
chore(types): Improve ClerkProvider JSDoc (#4190)
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Sep 19, 2024
1 parent 09622fa commit 2e5c550
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/cyan-mirrors-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@clerk/clerk-react": patch
"@clerk/types": patch
"@clerk/clerk-expo": patch
---

Improve JSDoc comments for some public API properties
4 changes: 4 additions & 0 deletions packages/expo/src/provider/ClerkProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import { isNative, isWeb } from '../utils/runtime';
import { getClerkInstance } from './singleton';

export type ClerkProviderProps = React.ComponentProps<typeof ClerkReactProvider> & {
/**
* The token cache is used to persist the active user's session token. Clerk stores this token in memory by default, however it is recommended to use a token cache for production applications.
* @see https://clerk.com/docs/quickstarts/expo#configure-the-token-cache-with-expo
*/
tokenCache?: TokenCache;
};

Expand Down
3 changes: 3 additions & 0 deletions packages/react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export type IsomorphicClerkOptions = Without<ClerkOptions, 'isSatellite'> & {

export type ClerkProviderProps = IsomorphicClerkOptions & {
children: React.ReactNode;
/**
* Provide an initial state of the Clerk client during server-side rendering (SSR)
*/
initialState?: InitialState;
};

Expand Down
10 changes: 9 additions & 1 deletion packages/types/src/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,13 +655,21 @@ export type ClerkOptions = ClerkOptionsNavigation &
*/
localization?: LocalizationResource;
polling?: boolean;
/**
* By default, the last active session is used during client initialization. This option allows you to override that behavior, e.g. by selecting a specific session.
*/
selectInitialSession?: (client: ClientResource) => ActiveSessionResource | null;
/** Controls if ClerkJS will load with the standard browser setup using Clerk cookies */
/**
* By default, ClerkJS is loaded with the assumption that cookies can be set (browser setup). On native platforms this value must be set to `false`.
*/
standardBrowser?: boolean;
/**
* Optional support email for display in authentication screens. Will only affect [Clerk Components](https://clerk.com/docs/components/overview) and not [Account Portal](https://clerk.com/docs/customization/account-portal/overview) pages.
*/
supportEmail?: string;
/**
* By default, the [FAPI `touch` endpoint](https://clerk.com/docs/reference/frontend-api/tag/Sessions#operation/touchSession) is called during page focus to keep the last active session alive. This option allows you to disable this behavior.
*/
touchSession?: boolean;
/**
* This URL will be used for any redirects that might happen and needs to point to your primary application on the client-side. This option is optional for production instances. It's required for development instances if you a use satellite application.
Expand Down

0 comments on commit 2e5c550

Please sign in to comment.