@clerk/nextjs 7.3.1 → 7.3.2-canary.v20260505213612

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,7 +58,7 @@ const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || "";
58
58
  const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || "";
59
59
  const SDK_METADATA = {
60
60
  name: "@clerk/nextjs",
61
- version: "7.3.1",
61
+ version: "7.3.2-canary.v20260505213612",
62
62
  environment: process.env.NODE_ENV
63
63
  };
64
64
  const TELEMETRY_DISABLED = (0, import_underscore.isTruthy)(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED);
@@ -28,7 +28,7 @@ const clerkClientDefaultOptions = {
28
28
  publishableKey: import_constants.PUBLISHABLE_KEY,
29
29
  apiUrl: import_constants.API_URL,
30
30
  apiVersion: import_constants.API_VERSION,
31
- userAgent: `${"@clerk/nextjs"}@${"7.3.1"}`,
31
+ userAgent: `${"@clerk/nextjs"}@${"7.3.2-canary.v20260505213612"}`,
32
32
  proxyUrl: import_constants.PROXY_URL,
33
33
  domain: import_constants.DOMAIN,
34
34
  isSatellite: import_constants.IS_SATELLITE,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAkC;AAElC,uBAYO;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,OAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,iBACpE,kCAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAkC;AAElC,uBAYO;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,8BAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,iBACpE,kCAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
@@ -54,6 +54,8 @@ const authAuthHeaderMissing = (helperName = "auth", prefixSteps, fileReference =
54
54
  - Your ${fileReference} matcher is configured to match this route or page.
55
55
  - If you are using the src directory, make sure the ${fileReference} file is inside of it.
56
56
 
57
+ If you've verified your configuration and are still seeing this error, there may be a runtime issue or a problem communicating with Clerk.
58
+
57
59
  For more details, see https://clerk.com/err/auth-middleware
58
60
  `;
59
61
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/errors.ts"],"sourcesContent":["import { middlewareFileReference } from '../utils/sdk-versions';\n\nexport const missingDomainAndProxy = `\nMissing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl.\n\n1) With middleware\n e.g. export default clerkMiddleware({domain:'YOUR_DOMAIN',isSatellite:true});\n2) With environment variables e.g.\n NEXT_PUBLIC_CLERK_DOMAIN='YOUR_DOMAIN'\n NEXT_PUBLIC_CLERK_IS_SATELLITE='true'\n `;\n\nexport const missingSignInUrlInDev = `\nInvalid signInUrl. A satellite application requires a signInUrl for development instances.\nCheck if signInUrl is missing from your configuration or if it is not an absolute URL\n\n1) With middleware\n e.g. export default clerkMiddleware({signInUrl:'SOME_URL', isSatellite:true});\n2) With environment variables e.g.\n NEXT_PUBLIC_CLERK_SIGN_IN_URL='SOME_URL'\n NEXT_PUBLIC_CLERK_IS_SATELLITE='true'`;\n\nexport const getAuthAuthHeaderMissing = () => authAuthHeaderMissing('getAuth', undefined, middlewareFileReference);\n\nexport const authAuthHeaderMissing = (helperName = 'auth', prefixSteps?: string[], fileReference = 'middleware') => {\n return `Clerk: ${helperName}() was called but Clerk can't detect usage of clerkMiddleware(). Please ensure the following:\n- ${prefixSteps ? [...prefixSteps, ''].join('\\n- ') : ' '}clerkMiddleware() is used in your Next.js ${fileReference} file.\n- Your ${fileReference} matcher is configured to match this route or page.\n- If you are using the src directory, make sure the ${fileReference} file is inside of it.\n\nFor more details, see https://clerk.com/err/auth-middleware\n`;\n};\n\nexport const authSignatureInvalid = `Clerk: Unable to verify request, this usually means the Clerk middleware did not run. Ensure Clerk's middleware is properly integrated and matches the current route. For more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware. (code=auth_signature_invalid)`;\n\nexport const encryptionKeyInvalid = `Clerk: Unable to decrypt request data, this usually means the encryption key is invalid. Ensure the encryption key is properly set. For more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_invalid)`;\n\nexport const encryptionKeyInvalidDev = `Clerk: Unable to decrypt request data.\\n\\nRefresh the page if your .env file was just updated. If the issue persists, ensure the encryption key is valid and properly set.\\n\\nFor more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_invalid)`;\nexport const encryptionKeyMissing =\n 'Clerk: Missing `CLERK_ENCRYPTION_KEY`. Required for propagating `secretKey` middleware option. See docs: https://clerk.com/docs/references/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_missing)';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAwC;AAEjC,MAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU9B,MAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU9B,MAAM,2BAA2B,MAAM,sBAAsB,WAAW,QAAW,2CAAuB;AAE1G,MAAM,wBAAwB,CAAC,aAAa,QAAQ,aAAwB,gBAAgB,iBAAiB;AAClH,SAAO,UAAU,UAAU;AAAA,IACzB,cAAc,CAAC,GAAG,aAAa,EAAE,EAAE,KAAK,MAAM,IAAI,GAAG,6CAA6C,aAAa;AAAA,SAC1G,aAAa;AAAA,sDACgC,aAAa;AAAA;AAAA;AAAA;AAInE;AAEO,MAAM,uBAAuB;AAE7B,MAAM,uBAAuB;AAE7B,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAChC,MAAM,uBACX;","names":[]}
1
+ {"version":3,"sources":["../../../src/server/errors.ts"],"sourcesContent":["import { middlewareFileReference } from '../utils/sdk-versions';\n\nexport const missingDomainAndProxy = `\nMissing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl.\n\n1) With middleware\n e.g. export default clerkMiddleware({domain:'YOUR_DOMAIN',isSatellite:true});\n2) With environment variables e.g.\n NEXT_PUBLIC_CLERK_DOMAIN='YOUR_DOMAIN'\n NEXT_PUBLIC_CLERK_IS_SATELLITE='true'\n `;\n\nexport const missingSignInUrlInDev = `\nInvalid signInUrl. A satellite application requires a signInUrl for development instances.\nCheck if signInUrl is missing from your configuration or if it is not an absolute URL\n\n1) With middleware\n e.g. export default clerkMiddleware({signInUrl:'SOME_URL', isSatellite:true});\n2) With environment variables e.g.\n NEXT_PUBLIC_CLERK_SIGN_IN_URL='SOME_URL'\n NEXT_PUBLIC_CLERK_IS_SATELLITE='true'`;\n\nexport const getAuthAuthHeaderMissing = () => authAuthHeaderMissing('getAuth', undefined, middlewareFileReference);\n\nexport const authAuthHeaderMissing = (helperName = 'auth', prefixSteps?: string[], fileReference = 'middleware') => {\n return `Clerk: ${helperName}() was called but Clerk can't detect usage of clerkMiddleware(). Please ensure the following:\n- ${prefixSteps ? [...prefixSteps, ''].join('\\n- ') : ' '}clerkMiddleware() is used in your Next.js ${fileReference} file.\n- Your ${fileReference} matcher is configured to match this route or page.\n- If you are using the src directory, make sure the ${fileReference} file is inside of it.\n\nIf you've verified your configuration and are still seeing this error, there may be a runtime issue or a problem communicating with Clerk.\n\nFor more details, see https://clerk.com/err/auth-middleware\n`;\n};\n\nexport const authSignatureInvalid = `Clerk: Unable to verify request, this usually means the Clerk middleware did not run. Ensure Clerk's middleware is properly integrated and matches the current route. For more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware. (code=auth_signature_invalid)`;\n\nexport const encryptionKeyInvalid = `Clerk: Unable to decrypt request data, this usually means the encryption key is invalid. Ensure the encryption key is properly set. For more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_invalid)`;\n\nexport const encryptionKeyInvalidDev = `Clerk: Unable to decrypt request data.\\n\\nRefresh the page if your .env file was just updated. If the issue persists, ensure the encryption key is valid and properly set.\\n\\nFor more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_invalid)`;\nexport const encryptionKeyMissing =\n 'Clerk: Missing `CLERK_ENCRYPTION_KEY`. Required for propagating `secretKey` middleware option. See docs: https://clerk.com/docs/references/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_missing)';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAwC;AAEjC,MAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU9B,MAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU9B,MAAM,2BAA2B,MAAM,sBAAsB,WAAW,QAAW,2CAAuB;AAE1G,MAAM,wBAAwB,CAAC,aAAa,QAAQ,aAAwB,gBAAgB,iBAAiB;AAClH,SAAO,UAAU,UAAU;AAAA,IACzB,cAAc,CAAC,GAAG,aAAa,EAAE,EAAE,KAAK,MAAM,IAAI,GAAG,6CAA6C,aAAa;AAAA,SAC1G,aAAa;AAAA,sDACgC,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAMnE;AAEO,MAAM,uBAAuB;AAE7B,MAAM,uBAAuB;AAE7B,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAChC,MAAM,uBACX;","names":[]}
@@ -90,7 +90,7 @@ function debugLogHeader(name) {
90
90
  return `[clerk debug start: ${name}]`;
91
91
  }
92
92
  function debugLogFooter(name) {
93
- return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.3.1"},next=${import_package.default.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
93
+ return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.3.2-canary.v20260505213612"},next=${import_package.default.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
94
94
  }
95
95
  function truncate(str, maxLength) {
96
96
  const encoder = new TextEncoder();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replac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Aa;AAClB,iBAAO,OAAO;AACd,iBAAO;AAAA,QACT,CAAC,EACA,MAAM,CAAC,QAAa;AACnB,iBAAO,OAAO;AACd,gBAAM;AAAA,QACR,CAAC;AAAA,MACL;AAEA,aAAO,OAAO;AACd,aAAO;AAAA,IACT,SAAS,KAAU;AACjB,aAAO,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,uBAAuB,IAAI;AACpC;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,qBAAqB,IAAI,oBAAoB,OAAe,SAAS,eAAAA,QAAQ,OAAO,cAAc,KAAK,OAAM,oBAAI,KAAK,GAAE,QAAQ,IAAI,GAAK,CAAC;AACnJ;AAGA,SAAS,SAAS,KAAa,WAAmB;AAChD,QAAM,UAAU,IAAI,YAAY;AAChC,QAAM,UAAU,IAAI,YAAY,OAAO;AAEvC,QAAM,gBAAgB,QAAQ,OAAO,GAAG;AACxC,QAAM,kBAAkB,cAAc,MAAM,GAAG,SAAS;AAGxD,SAAO,QAAQ,OAAO,eAAe,EAAE,QAAQ,WAAW,EAAE;AAC9D;","names":["nextPkg"]}
1
+ {"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFF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CAAC,EACA,MAAM,CAAC,QAAa;AACnB,iBAAO,OAAO;AACd,gBAAM;AAAA,QACR,CAAC;AAAA,MACL;AAEA,aAAO,OAAO;AACd,aAAO;AAAA,IACT,SAAS,KAAU;AACjB,aAAO,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,uBAAuB,IAAI;AACpC;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,qBAAqB,IAAI,oBAAoB,8BAAe,SAAS,eAAAA,QAAQ,OAAO,cAAc,KAAK,OAAM,oBAAI,KAAK,GAAE,QAAQ,IAAI,GAAK,CAAC;AACnJ;AAGA,SAAS,SAAS,KAAa,WAAmB;AAChD,QAAM,UAAU,IAAI,YAAY;AAChC,QAAM,UAAU,IAAI,YAAY,OAAO;AAEvC,QAAM,gBAAgB,QAAQ,OAAO,GAAG;AACxC,QAAM,kBAAkB,cAAc,MAAM,GAAG,SAAS;AAGxD,SAAO,QAAQ,OAAO,eAAe,EAAE,QAAQ,WAAW,EAAE;AAC9D;","names":["nextPkg"]}
@@ -18,7 +18,7 @@ const SIGN_IN_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_IN_URL || "";
18
18
  const SIGN_UP_URL = process.env.NEXT_PUBLIC_CLERK_SIGN_UP_URL || "";
19
19
  const SDK_METADATA = {
20
20
  name: "@clerk/nextjs",
21
- version: "7.3.1",
21
+ version: "7.3.2-canary.v20260505213612",
22
22
  environment: process.env.NODE_ENV
23
23
  };
24
24
  const TELEMETRY_DISABLED = isTruthy(process.env.NEXT_PUBLIC_CLERK_TELEMETRY_DISABLED);
@@ -18,7 +18,7 @@ const clerkClientDefaultOptions = {
18
18
  publishableKey: PUBLISHABLE_KEY,
19
19
  apiUrl: API_URL,
20
20
  apiVersion: API_VERSION,
21
- userAgent: `${"@clerk/nextjs"}@${"7.3.1"}`,
21
+ userAgent: `${"@clerk/nextjs"}@${"7.3.2-canary.v20260505213612"}`,
22
22
  proxyUrl: PROXY_URL,
23
23
  domain: DOMAIN,
24
24
  isSatellite: IS_SATELLITE,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";AAAA,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,OAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,aACpE,kBAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/server/createClerkClient.ts"],"sourcesContent":["import { createClerkClient } from '@clerk/backend';\n\nimport {\n API_URL,\n API_VERSION,\n DOMAIN,\n IS_SATELLITE,\n MACHINE_SECRET_KEY,\n PROXY_URL,\n PUBLISHABLE_KEY,\n SDK_METADATA,\n SECRET_KEY,\n TELEMETRY_DEBUG,\n TELEMETRY_DISABLED,\n} from './constants';\n\nconst clerkClientDefaultOptions = {\n secretKey: SECRET_KEY,\n publishableKey: PUBLISHABLE_KEY,\n apiUrl: API_URL,\n apiVersion: API_VERSION,\n userAgent: `${PACKAGE_NAME}@${PACKAGE_VERSION}`,\n proxyUrl: PROXY_URL,\n domain: DOMAIN,\n isSatellite: IS_SATELLITE,\n machineSecretKey: MACHINE_SECRET_KEY,\n sdkMetadata: SDK_METADATA,\n telemetry: {\n disabled: TELEMETRY_DISABLED,\n debug: TELEMETRY_DEBUG,\n },\n};\n\nexport const createClerkClientWithOptions: typeof createClerkClient = options =>\n createClerkClient({ ...clerkClientDefaultOptions, ...options });\n"],"mappings":";AAAA,SAAS,yBAAyB;AAElC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,MAAM,4BAA4B;AAAA,EAChC,WAAW;AAAA,EACX,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,WAAW,GAAG,eAAY,IAAI,8BAAe;AAAA,EAC7C,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,WAAW;AAAA,IACT,UAAU;AAAA,IACV,OAAO;AAAA,EACT;AACF;AAEO,MAAM,+BAAyD,aACpE,kBAAkB,EAAE,GAAG,2BAA2B,GAAG,QAAQ,CAAC;","names":[]}
@@ -25,6 +25,8 @@ const authAuthHeaderMissing = (helperName = "auth", prefixSteps, fileReference =
25
25
  - Your ${fileReference} matcher is configured to match this route or page.
26
26
  - If you are using the src directory, make sure the ${fileReference} file is inside of it.
27
27
 
28
+ If you've verified your configuration and are still seeing this error, there may be a runtime issue or a problem communicating with Clerk.
29
+
28
30
  For more details, see https://clerk.com/err/auth-middleware
29
31
  `;
30
32
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/server/errors.ts"],"sourcesContent":["import { middlewareFileReference } from '../utils/sdk-versions';\n\nexport const missingDomainAndProxy = `\nMissing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl.\n\n1) With middleware\n e.g. export default clerkMiddleware({domain:'YOUR_DOMAIN',isSatellite:true});\n2) With environment variables e.g.\n NEXT_PUBLIC_CLERK_DOMAIN='YOUR_DOMAIN'\n NEXT_PUBLIC_CLERK_IS_SATELLITE='true'\n `;\n\nexport const missingSignInUrlInDev = `\nInvalid signInUrl. A satellite application requires a signInUrl for development instances.\nCheck if signInUrl is missing from your configuration or if it is not an absolute URL\n\n1) With middleware\n e.g. export default clerkMiddleware({signInUrl:'SOME_URL', isSatellite:true});\n2) With environment variables e.g.\n NEXT_PUBLIC_CLERK_SIGN_IN_URL='SOME_URL'\n NEXT_PUBLIC_CLERK_IS_SATELLITE='true'`;\n\nexport const getAuthAuthHeaderMissing = () => authAuthHeaderMissing('getAuth', undefined, middlewareFileReference);\n\nexport const authAuthHeaderMissing = (helperName = 'auth', prefixSteps?: string[], fileReference = 'middleware') => {\n return `Clerk: ${helperName}() was called but Clerk can't detect usage of clerkMiddleware(). Please ensure the following:\n- ${prefixSteps ? [...prefixSteps, ''].join('\\n- ') : ' '}clerkMiddleware() is used in your Next.js ${fileReference} file.\n- Your ${fileReference} matcher is configured to match this route or page.\n- If you are using the src directory, make sure the ${fileReference} file is inside of it.\n\nFor more details, see https://clerk.com/err/auth-middleware\n`;\n};\n\nexport const authSignatureInvalid = `Clerk: Unable to verify request, this usually means the Clerk middleware did not run. Ensure Clerk's middleware is properly integrated and matches the current route. For more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware. (code=auth_signature_invalid)`;\n\nexport const encryptionKeyInvalid = `Clerk: Unable to decrypt request data, this usually means the encryption key is invalid. Ensure the encryption key is properly set. For more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_invalid)`;\n\nexport const encryptionKeyInvalidDev = `Clerk: Unable to decrypt request data.\\n\\nRefresh the page if your .env file was just updated. If the issue persists, ensure the encryption key is valid and properly set.\\n\\nFor more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_invalid)`;\nexport const encryptionKeyMissing =\n 'Clerk: Missing `CLERK_ENCRYPTION_KEY`. Required for propagating `secretKey` middleware option. See docs: https://clerk.com/docs/references/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_missing)';\n"],"mappings":";AAAA,SAAS,+BAA+B;AAEjC,MAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU9B,MAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU9B,MAAM,2BAA2B,MAAM,sBAAsB,WAAW,QAAW,uBAAuB;AAE1G,MAAM,wBAAwB,CAAC,aAAa,QAAQ,aAAwB,gBAAgB,iBAAiB;AAClH,SAAO,UAAU,UAAU;AAAA,IACzB,cAAc,CAAC,GAAG,aAAa,EAAE,EAAE,KAAK,MAAM,IAAI,GAAG,6CAA6C,aAAa;AAAA,SAC1G,aAAa;AAAA,sDACgC,aAAa;AAAA;AAAA;AAAA;AAInE;AAEO,MAAM,uBAAuB;AAE7B,MAAM,uBAAuB;AAE7B,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAChC,MAAM,uBACX;","names":[]}
1
+ {"version":3,"sources":["../../../src/server/errors.ts"],"sourcesContent":["import { middlewareFileReference } from '../utils/sdk-versions';\n\nexport const missingDomainAndProxy = `\nMissing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl.\n\n1) With middleware\n e.g. export default clerkMiddleware({domain:'YOUR_DOMAIN',isSatellite:true});\n2) With environment variables e.g.\n NEXT_PUBLIC_CLERK_DOMAIN='YOUR_DOMAIN'\n NEXT_PUBLIC_CLERK_IS_SATELLITE='true'\n `;\n\nexport const missingSignInUrlInDev = `\nInvalid signInUrl. A satellite application requires a signInUrl for development instances.\nCheck if signInUrl is missing from your configuration or if it is not an absolute URL\n\n1) With middleware\n e.g. export default clerkMiddleware({signInUrl:'SOME_URL', isSatellite:true});\n2) With environment variables e.g.\n NEXT_PUBLIC_CLERK_SIGN_IN_URL='SOME_URL'\n NEXT_PUBLIC_CLERK_IS_SATELLITE='true'`;\n\nexport const getAuthAuthHeaderMissing = () => authAuthHeaderMissing('getAuth', undefined, middlewareFileReference);\n\nexport const authAuthHeaderMissing = (helperName = 'auth', prefixSteps?: string[], fileReference = 'middleware') => {\n return `Clerk: ${helperName}() was called but Clerk can't detect usage of clerkMiddleware(). Please ensure the following:\n- ${prefixSteps ? [...prefixSteps, ''].join('\\n- ') : ' '}clerkMiddleware() is used in your Next.js ${fileReference} file.\n- Your ${fileReference} matcher is configured to match this route or page.\n- If you are using the src directory, make sure the ${fileReference} file is inside of it.\n\nIf you've verified your configuration and are still seeing this error, there may be a runtime issue or a problem communicating with Clerk.\n\nFor more details, see https://clerk.com/err/auth-middleware\n`;\n};\n\nexport const authSignatureInvalid = `Clerk: Unable to verify request, this usually means the Clerk middleware did not run. Ensure Clerk's middleware is properly integrated and matches the current route. For more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware. (code=auth_signature_invalid)`;\n\nexport const encryptionKeyInvalid = `Clerk: Unable to decrypt request data, this usually means the encryption key is invalid. Ensure the encryption key is properly set. For more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_invalid)`;\n\nexport const encryptionKeyInvalidDev = `Clerk: Unable to decrypt request data.\\n\\nRefresh the page if your .env file was just updated. If the issue persists, ensure the encryption key is valid and properly set.\\n\\nFor more information, see: https://clerk.com/docs/reference/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_invalid)`;\nexport const encryptionKeyMissing =\n 'Clerk: Missing `CLERK_ENCRYPTION_KEY`. Required for propagating `secretKey` middleware option. See docs: https://clerk.com/docs/references/nextjs/clerk-middleware#dynamic-keys. (code=encryption_key_missing)';\n"],"mappings":";AAAA,SAAS,+BAA+B;AAEjC,MAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU9B,MAAM,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAU9B,MAAM,2BAA2B,MAAM,sBAAsB,WAAW,QAAW,uBAAuB;AAE1G,MAAM,wBAAwB,CAAC,aAAa,QAAQ,aAAwB,gBAAgB,iBAAiB;AAClH,SAAO,UAAU,UAAU;AAAA,IACzB,cAAc,CAAC,GAAG,aAAa,EAAE,EAAE,KAAK,MAAM,IAAI,GAAG,6CAA6C,aAAa;AAAA,SAC1G,aAAa;AAAA,sDACgC,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAMnE;AAEO,MAAM,uBAAuB;AAE7B,MAAM,uBAAuB;AAE7B,MAAM,0BAA0B;AAAA;AAAA;AAAA;AAAA;AAChC,MAAM,uBACX;","names":[]}
@@ -57,7 +57,7 @@ function debugLogHeader(name) {
57
57
  return `[clerk debug start: ${name}]`;
58
58
  }
59
59
  function debugLogFooter(name) {
60
- return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.3.1"},next=${nextPkg.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
60
+ return `[clerk debug end: ${name}] (@clerk/nextjs=${"7.3.2-canary.v20260505213612"},next=${nextPkg.version},timestamp=${Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3)})`;
61
61
  }
62
62
  function truncate(str, maxLength) {
63
63
  const encoder = new TextEncoder();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";AAEA,OAAO,aAAa;AAEpB,SAAS,oBAAoB;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ,IAAI;AAAA,UAChC;AAEA,kBAAQ,IAAI,MAAM;AAAA,QACpB;AAEA,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AACF;AAOO,MAAM,aAAyB,CAAC,qBAAqB,gBAAgB;AAC1E,UAAQ,IAAI,SAAc;AACxB,UAAM,UACJ,OAAO,wBAAwB,WAC3B,kBAAkB,qBAAqB,YAAY,IACnD;AAEN,UAAM,SAAS,QAAQ;AACvB,UAAM,UAAU,YAAY,MAAa;AAEzC,QAAI;AACF,YAAM,MAAM,QAAQ,GAAG,IAAI;AAC3B,UAAI,OAAO,QAAQ,YAAY,UAAU,OAAO,OAAO,IAAI,SAAS,YAAY;AAC9E,eAAO,IACJ,KAAK,CAAC,QAAa;AAClB,iBAAO,OAAO;AACd,iBAAO;AAAA,QACT,CAAC,EACA,MAAM,CAAC,QAAa;AACnB,iBAAO,OAAO;AACd,gBAAM;AAAA,QACR,CAAC;AAAA,MACL;AAEA,aAAO,OAAO;AACd,aAAO;AAAA,IACT,SAAS,KAAU;AACjB,aAAO,OAAO;AACd,YAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,uBAAuB,IAAI;AACpC;AAEA,SAAS,eAAe,MAAc;AACpC,SAAO,qBAAqB,IAAI,oBAAoB,OAAe,SAAS,QAAQ,OAAO,cAAc,KAAK,OAAM,oBAAI,KAAK,GAAE,QAAQ,IAAI,GAAK,CAAC;AACnJ;AAGA,SAAS,SAAS,KAAa,WAAmB;AAChD,QAAM,UAAU,IAAI,YAAY;AAChC,QAAM,UAAU,IAAI,YAAY,OAAO;AAEvC,QAAM,gBAAgB,QAAQ,OAAO,GAAG;AACxC,QAAM,kBAAkB,cAAc,MAAM,GAAG,SAAS;AAGxD,SAAO,QAAQ,OAAO,eAAe,EAAE,QAAQ,WAAW,EAAE;AAC9D;","names":[]}
1
+ {"version":3,"sources":["../../../src/utils/debugLogger.ts"],"sourcesContent":["// TODO: Replace with a more sophisticated logging solution\n\nimport nextPkg from 'next/package.json';\n\nimport { logFormatter } from './logFormatter';\n\nexport type Log = string | Record<string, unknown>;\nexport type LogEntry = Log | Log[];\nexport type Logger<L = Log> = {\n commit: () => void;\n debug: (...args: Array<L | (() => L)>) => void;\n enable: () => void;\n};\nexport type LoggerNoCommit<L = Logger> = Omit<L, 'commit'>;\n\nexport const createDebugLogger = (name: string, formatter: (val: LogEntry) => string) => (): Logger => {\n const entries: LogEntry[] = [];\n let isEnabled = false;\n\n return {\n enable: () => {\n isEnabled = true;\n },\n debug: (...args) => {\n if (isEnabled) {\n entries.push(args.map(arg => (typeof arg === 'function' ? arg() : arg)));\n }\n },\n commit: () => {\n if (isEnabled) {\n console.log(debugLogHeader(name));\n\n /**\n * We buffer each collected log entry so we can format them and log them all at once.\n * Individual console.log calls are used to ensure we don't hit platform-specific log limits (Vercel and Netlify are 4kb).\n */\n for (const log of entries) {\n let output = formatter(log);\n\n output = output\n .split('\\n')\n .map(l => ` ${l}`)\n .join('\\n');\n\n // Vercel errors if the output is > 4kb, so we truncate it\n if (process.env.VERCEL) {\n output = truncate(output, 4096);\n }\n\n console.log(output);\n }\n\n console.log(debugLogFooter(name));\n }\n },\n };\n};\n\ntype WithLogger = <L extends Logger, H extends (...args: any[]) => any>(\n loggerFactoryOrName: string | (() => L),\n handlerCtor: (logger: LoggerNoCommit<L>) => H,\n) => H;\n\nexport const withLogger: WithLogger = (loggerFactoryOrName, handlerCtor) => {\n return ((...args: any) => {\n const factory =\n typeof loggerFactoryOrName === 'string'\n ? createDebugLogger(loggerFactoryOrName, logFormatter)\n : loggerFactoryOrName;\n\n const logger = factory();\n const handler = handlerCtor(logger as any);\n\n try {\n const res = handler(...args);\n if (typeof res === 'object' && 'then' in res && typeof res.then === 'function') {\n return res\n .then((val: any) => {\n logger.commit();\n return val;\n })\n .catch((err: any) => {\n logger.commit();\n throw err;\n });\n }\n // handle sync methods\n logger.commit();\n return res;\n } catch (err: any) {\n logger.commit();\n throw err;\n }\n }) as ReturnType<typeof handlerCtor>;\n};\n\nfunction debugLogHeader(name: string) {\n return `[clerk debug start: ${name}]`;\n}\n\nfunction debugLogFooter(name: string) {\n return `[clerk debug end: ${name}] (@clerk/nextjs=${PACKAGE_VERSION},next=${nextPkg.version},timestamp=${Math.round(new Date().getTime() / 1_000)})`;\n}\n\n// ref: https://stackoverflow.com/questions/57769465/javascript-truncate-text-by-bytes-length\nfunction truncate(str: string, maxLength: number) {\n const encoder = new TextEncoder();\n const decoder = new TextDecoder('utf-8');\n\n const encodedString = encoder.encode(str);\n const truncatedString = encodedString.slice(0, maxLength);\n\n // return the truncated string, removing any replacement characters that result from partially truncated characters\n return decoder.decode(truncatedString).replace(/\\uFFFD/g, '');\n}\n"],"mappings":";AAEA,OAAO,aAAa;AAEpB,SAAS,oBAAoB;AAWtB,MAAM,oBAAoB,CAAC,MAAc,cAAyC,MAAc;AACrG,QAAM,UAAsB,CAAC;AAC7B,MAAI,YAAY;AAEhB,SAAO;AAAA,IACL,QAAQ,MAAM;AACZ,kBAAY;AAAA,IACd;AAAA,IACA,OAAO,IAAI,SAAS;AAClB,UAAI,WAAW;AACb,gBAAQ,KAAK,KAAK,IAAI,SAAQ,OAAO,QAAQ,aAAa,IAAI,IAAI,GAAI,CAAC;AAAA,MACzE;AAAA,IACF;AAAA,IACA,QAAQ,MAAM;AACZ,UAAI,WAAW;AACb,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAMhC,mBAAW,OAAO,SAAS;AACzB,cAAI,SAAS,UAAU,GAAG;AAE1B,mBAAS,OACN,MAAM,IAAI,EACV,IAAI,OAAK,KAAK,CAAC,EAAE,EACjB,KAAK,IAAI;AAGZ,cAAI,QAAQ,IAAI,QAAQ;AACtB,qBAAS,SAAS,QAAQ,IAAI;AAAA,UAChC;AAEA,kBAAQ,IAAI,MAAM;AAAA,QACpB;AAEA,gBAAQ,IAAI,eAAe,IAAI,CAAC;AAAA,MAClC;AAAA,IACF;AAAA,EACF;AACF;AAOO,MAAM,aAAyB,CAAC,qBAAqB,gBAA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AAO,MAAM,qBAAqB,GAAI,mBAAmB,EAAE,cAAc,MAAM,EAAE,EAAE,sBAA4B,WAQ9G,CAAC;AAEF,eAAO,MAAM,oBAAoB,6RAA6R,CAAC;AAE/T,eAAO,MAAM,oBAAoB,wQAAwQ,CAAC;AAE1S,eAAO,MAAM,uBAAuB,kTAAkT,CAAC;AACvV,eAAO,MAAM,oBAAoB,mNACiL,CAAC"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/server/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,0UAQ9B,CAAC;AAEL,eAAO,MAAM,qBAAqB,4ZAQO,CAAC;AAE1C,eAAO,MAAM,wBAAwB,cAA6E,CAAC;AAEnH,eAAO,MAAM,qBAAqB,GAAI,mBAAmB,EAAE,cAAc,MAAM,EAAE,EAAE,sBAA4B,WAU9G,CAAC;AAEF,eAAO,MAAM,oBAAoB,6RAA6R,CAAC;AAE/T,eAAO,MAAM,oBAAoB,wQAAwQ,CAAC;AAE1S,eAAO,MAAM,uBAAuB,kTAAkT,CAAC;AACvV,eAAO,MAAM,oBAAoB,mNACiL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clerk/nextjs",
3
- "version": "7.3.1",
3
+ "version": "7.3.2-canary.v20260505213612",
4
4
  "description": "Clerk SDK for NextJS",
5
5
  "keywords": [
6
6
  "clerk",
@@ -72,9 +72,9 @@
72
72
  "dependencies": {
73
73
  "server-only": "0.0.1",
74
74
  "tslib": "2.8.1",
75
- "@clerk/backend": "^3.4.5",
76
- "@clerk/react": "^6.6.0",
77
- "@clerk/shared": "^4.10.0"
75
+ "@clerk/backend": "3.4.6-canary.v20260505213612",
76
+ "@clerk/react": "6.6.1-canary.v20260505213612",
77
+ "@clerk/shared": "4.10.1-canary.v20260505213612"
78
78
  },
79
79
  "devDependencies": {
80
80
  "crypto-es": "^2.1.0",