diff --git a/.changeset/new-lemons-try.md b/.changeset/new-lemons-try.md new file mode 100644 index 00000000000..c409de1eeee --- /dev/null +++ b/.changeset/new-lemons-try.md @@ -0,0 +1,5 @@ +--- +'@clerk/nextjs': minor +--- + +Enable Keyless by default. To disable keyless use `NEXT_PUBLIC_CLERK_KEYLESS_DISABLED=1`. diff --git a/packages/nextjs/src/server/constants.ts b/packages/nextjs/src/server/constants.ts index 67c7295bbd5..cbddb6ea346 100644 --- a/packages/nextjs/src/server/constants.ts +++ b/packages/nextjs/src/server/constants.ts @@ -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; diff --git a/packages/nextjs/src/utils/feature-flags.ts b/packages/nextjs/src/utils/feature-flags.ts index 0d59bdd9a69..6287a630556 100644 --- a/packages/nextjs/src/utils/feature-flags.ts +++ b/packages/nextjs/src/utils/feature-flags.ts @@ -1,9 +1,9 @@ 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__server = !isNextWithUnstableServerActions && isDevelopmentEnvironment() && ENABLE_KEYLESS; -const canUseKeyless__client = !isNextWithUnstableServerActions && ENABLE_KEYLESS; +const canUseKeyless__server = !isNextWithUnstableServerActions && isDevelopmentEnvironment() && !KEYLESS_DISABLED; +const canUseKeyless__client = !isNextWithUnstableServerActions && !KEYLESS_DISABLED; export { canUseKeyless__client, canUseKeyless__server };