Skip to content

chore(clerk-expo): Make publishableKey prop type optional #5399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plenty-poems-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/clerk-expo": patch
---

The `publishableKey` prop type in the `<ClerkProvider>` component is now marked as optional to match its runtime behavior. Please use the `EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY` environment variable to set your publishable key.
8 changes: 7 additions & 1 deletion packages/expo/src/provider/ClerkProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import '../polyfills';

import { ClerkProvider as ClerkReactProvider } from '@clerk/clerk-react';
import type { Without } from '@clerk/types';
import * as WebBrowser from 'expo-web-browser';

import type { TokenCache } from '../cache/types';
import { isNative, isWeb } from '../utils/runtime';
import { getClerkInstance } from './singleton';
import type { BuildClerkOptions } from './singleton/types';

export type ClerkProviderProps = React.ComponentProps<typeof ClerkReactProvider> & {
export type ClerkProviderProps = Without<React.ComponentProps<typeof ClerkReactProvider>, 'publishableKey'> & {
/**
* Used to override the default EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY env variable if needed.
* This is optional for Expo as the ClerkProvider will automatically use the EXPO_PUBLIC_CLERK_PUBLISHABLE_KEY env variable if it exists.
*/
publishableKey?: string;
/**
* 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
Expand Down