Skip to content

Commit 2e5c550

Browse files
authoredSep 19, 2024··
chore(types): Improve ClerkProvider JSDoc (#4190)
1 parent 09622fa commit 2e5c550

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed
 

‎.changeset/cyan-mirrors-notice.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@clerk/clerk-react": patch
3+
"@clerk/types": patch
4+
"@clerk/clerk-expo": patch
5+
---
6+
7+
Improve JSDoc comments for some public API properties

‎packages/expo/src/provider/ClerkProvider.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import { isNative, isWeb } from '../utils/runtime';
88
import { getClerkInstance } from './singleton';
99

1010
export type ClerkProviderProps = React.ComponentProps<typeof ClerkReactProvider> & {
11+
/**
12+
* 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.
13+
* @see https://clerk.com/docs/quickstarts/expo#configure-the-token-cache-with-expo
14+
*/
1115
tokenCache?: TokenCache;
1216
};
1317

‎packages/react/src/types.ts

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ export type IsomorphicClerkOptions = Without<ClerkOptions, 'isSatellite'> & {
5151

5252
export type ClerkProviderProps = IsomorphicClerkOptions & {
5353
children: React.ReactNode;
54+
/**
55+
* Provide an initial state of the Clerk client during server-side rendering (SSR)
56+
*/
5457
initialState?: InitialState;
5558
};
5659

‎packages/types/src/clerk.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -655,13 +655,21 @@ export type ClerkOptions = ClerkOptionsNavigation &
655655
*/
656656
localization?: LocalizationResource;
657657
polling?: boolean;
658+
/**
659+
* 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.
660+
*/
658661
selectInitialSession?: (client: ClientResource) => ActiveSessionResource | null;
659-
/** Controls if ClerkJS will load with the standard browser setup using Clerk cookies */
662+
/**
663+
* 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`.
664+
*/
660665
standardBrowser?: boolean;
661666
/**
662667
* 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.
663668
*/
664669
supportEmail?: string;
670+
/**
671+
* 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.
672+
*/
665673
touchSession?: boolean;
666674
/**
667675
* 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.

0 commit comments

Comments
 (0)
Please sign in to comment.