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 9cd7e6a42bc..0526ccc2aa9 100644 --- a/packages/nextjs/src/utils/feature-flags.ts +++ b/packages/nextjs/src/utils/feature-flags.ts @@ -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 };