From 9e0261a3384c69c6658c586c2c2fb2e02730a6b7 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Thu, 16 Oct 2025 14:49:16 -0400 Subject: [PATCH 1/4] chore(repo): Typedoc: Handle simplify types --- .typedoc/custom-theme.mjs | 48 ++++++++++++++++++++++++++- packages/backend/src/tokens/verify.ts | 11 ------ 2 files changed, 47 insertions(+), 12 deletions(-) diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index 1ce9c403d22..ca55a41a3e2 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -143,10 +143,15 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { ); } + this._insideFunctionSignature = true; md.push(this.partials.signatureParameters(model.parameters || [])); + this._insideFunctionSignature = false; if (model.type) { - md.push(`: ${this.partials.someType(model.type)}`); + this._insideFunctionSignature = true; + const typeOutput = this.partials.someType(model.type); + this._insideFunctionSignature = false; + md.push(`: ${typeOutput}`); } const result = md.join(''); @@ -343,6 +348,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { .replace(//g, '') .replace(/<\/code>/g, ''); + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + return `${output}`; }, /** @@ -361,6 +371,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { .replace(//g, '') .replace(/<\/code>/g, ''); + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + return `${output}`; }, /** @@ -384,6 +399,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { ) .join(delimiter); + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + return `${output}`; }, /** @@ -482,6 +502,32 @@ ${tabs} .replace(//g, '') .replace(/<\/code>/g, ''); + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + + return `${output}`; + }, + /** + * Ensures that reflection types (like Simplify wrapped types) are wrapped in a single codeblock + * @param {import('typedoc').ReflectionType} model + */ + reflectionType: model => { + const defaultOutput = superPartials.reflectionType(model); + + const output = defaultOutput + // Remove any backticks + .replace(/`/g, '') + // Remove any `` and `` tags + .replace(//g, '') + .replace(/<\/code>/g, ''); + + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + return `${output}`; }, /** diff --git a/packages/backend/src/tokens/verify.ts b/packages/backend/src/tokens/verify.ts index 019dcae1a38..60a48c6917e 100644 --- a/packages/backend/src/tokens/verify.ts +++ b/packages/backend/src/tokens/verify.ts @@ -45,17 +45,6 @@ export type VerifyTokenOptions = Simplify< * @displayFunctionSignature * @hideReturns * - * @paramExtension - * - * ### `VerifyTokenOptions` - * - * It is recommended to set these options as [environment variables](/docs/guides/development/clerk-environment-variables#api-and-sdk-configuration) where possible, and then pass them to the function. For example, you can set the `secretKey` option using the `CLERK_SECRET_KEY` environment variable, and then pass it to the function like this: `createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY })`. - * - * > [!WARNING] - * You must provide either `jwtKey` or `secretKey`. - * - * - * * @example * * The following example demonstrates how to use the [JavaScript Backend SDK](https://clerk.com/docs/reference/backend/overview) to verify the token signature. From 385adaab84fb3dda0bdddbc9a48c6e34407ab09b Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Thu, 23 Oct 2025 15:08:53 -0400 Subject: [PATCH 2/4] coderabbit suggestion --- .typedoc/custom-theme.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index ca55a41a3e2..6893b8027b8 100644 --- a/.typedoc/custom-theme.mjs +++ b/.typedoc/custom-theme.mjs @@ -44,6 +44,8 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { const superPartials = this.partials; + this._insideFunctionSignature = false; + this.partials = { ...superPartials, /** @@ -143,14 +145,16 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { ); } + const prevInsideParams = this._insideFunctionSignature; this._insideFunctionSignature = true; md.push(this.partials.signatureParameters(model.parameters || [])); - this._insideFunctionSignature = false; + this._insideFunctionSignature = prevInsideParams; if (model.type) { + const prevInsideType = this._insideFunctionSignature; this._insideFunctionSignature = true; const typeOutput = this.partials.someType(model.type); - this._insideFunctionSignature = false; + this._insideFunctionSignature = prevInsideType; md.push(`: ${typeOutput}`); } From bdd332e7c3b4cc04c527ad6d51694951219622e4 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Fri, 24 Oct 2025 14:49:02 -0400 Subject: [PATCH 3/4] add empty changeset --- .changeset/silly-jars-shave.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changeset/silly-jars-shave.md diff --git a/.changeset/silly-jars-shave.md b/.changeset/silly-jars-shave.md new file mode 100644 index 00000000000..a845151cc84 --- /dev/null +++ b/.changeset/silly-jars-shave.md @@ -0,0 +1,2 @@ +--- +--- From 73854cf698ad380552d8d70d4caebe71cc93daa6 Mon Sep 17 00:00:00 2001 From: Alexis Aguilar <98043211+alexisintech@users.noreply.github.com> Date: Thu, 30 Oct 2025 15:10:40 -0400 Subject: [PATCH 4/4] update options description --- packages/backend/src/tokens/verify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/tokens/verify.ts b/packages/backend/src/tokens/verify.ts index 60a48c6917e..dfc22cc4d66 100644 --- a/packages/backend/src/tokens/verify.ts +++ b/packages/backend/src/tokens/verify.ts @@ -40,7 +40,7 @@ export type VerifyTokenOptions = Simplify< * Verifies a Clerk-generated token signature. Networkless if the `jwtKey` is provided. Otherwise, performs a network call to retrieve the JWKS from the [Backend API](https://clerk.com/docs/reference/backend-api/tag/JWKS#operation/GetJWKS){{ target: '_blank' }}. * * @param token - The token to verify. - * @param options - Options for verifying the token. + * @param options - Options for verifying the token. It is recommended to set these options as [environment variables](/docs/guides/development/clerk-environment-variables#api-and-sdk-configuration) where possible, and then pass them to the function. For example, you can set the `secretKey` option using the `CLERK_SECRET_KEY` environment variable, and then pass it to the function like this: `verifyToken(token, { secretKey: process.env.CLERK_SECRET_KEY })`. * * @displayFunctionSignature * @hideReturns