Skip to content

Commit

Permalink
feat(nextjs): Enable Keyless by default (#4898)
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef authored and wobsoriano committed Feb 8, 2025
1 parent 9b23a3e commit aa8ceb3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-lemons-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/nextjs': minor
---

Enable Keyless by default. To disable keyless use `NEXT_PUBLIC_CLERK_KEYLESS_DISABLED=1`.
2 changes: 1 addition & 1 deletion packages/nextjs/src/server/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export const SDK_METADATA = {
export const TELEMETRY_DISABLED = isTruthy(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED);
export const TELEMETRY_DEBUG = isTruthy(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DEBUG);

export const ENABLE_KEYLESS = isTruthy(process.env.NEXT_PUBLIC_CLERK_ENABLE_KEYLESS);
export const KEYLESS_DISABLED = isTruthy(process.env.NEXT_PUBLIC_CLERK_KEYLESS_DISABLED) || false;
4 changes: 2 additions & 2 deletions packages/nextjs/src/utils/feature-flags.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { isDevelopmentEnvironment } from '@clerk/shared/utils';

import { ENABLE_KEYLESS } from '../server/constants';
import { KEYLESS_DISABLED } from '../server/constants';
import { isNextWithUnstableServerActions } from './sdk-versions';

const canUseKeyless =
!isNextWithUnstableServerActions &&
// Next.js will inline the value of 'development' or 'production' on the client bundle, so this is client-safe.
isDevelopmentEnvironment() &&
ENABLE_KEYLESS;
!KEYLESS_DISABLED;

export { canUseKeyless };

0 comments on commit aa8ceb3

Please sign in to comment.