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 @@ +--- +--- diff --git a/.typedoc/custom-theme.mjs b/.typedoc/custom-theme.mjs index ec2adcf8dd6..ec1c32fa2dd 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, /** @@ -153,10 +155,17 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { ); } + const prevInsideParams = this._insideFunctionSignature; + this._insideFunctionSignature = true; md.push(this.partials.signatureParameters(model.parameters || [])); + this._insideFunctionSignature = prevInsideParams; if (model.type) { - md.push(`: ${this.partials.someType(model.type)}`); + const prevInsideType = this._insideFunctionSignature; + this._insideFunctionSignature = true; + const typeOutput = this.partials.someType(model.type); + this._insideFunctionSignature = prevInsideType; + md.push(`: ${typeOutput}`); } const result = md.join(''); @@ -353,6 +362,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}`; }, /** @@ -371,6 +385,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}`; }, /** @@ -394,6 +413,11 @@ class ClerkMarkdownThemeContext extends MarkdownThemeContext { ) .join(delimiter); + // Only wrap in if NOT inside a function signature + if (this._insideFunctionSignature) { + return output; + } + return `${output}`; }, /** @@ -492,6 +516,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..dfc22cc4d66 100644 --- a/packages/backend/src/tokens/verify.ts +++ b/packages/backend/src/tokens/verify.ts @@ -40,22 +40,11 @@ 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 * - * @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.