-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into aa/DOCS-10028
- Loading branch information
Showing
7 changed files
with
236 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
--- | ||
title: '`captcha` prop' | ||
description: Utilize Clerk's `captcha` prop in order to change the appearance of the CAPTCHA widget. | ||
--- | ||
|
||
{/* JS file: https://github.com/clerk/javascript/blob/main/packages/types/src/appearance.ts#L538 */} | ||
|
||
The `captcha` property can be used to change the appearance of the CAPTCHA widget. It is passed as a parameter to the [`appearance` prop](/docs/customization/overview). | ||
|
||
## Properties | ||
|
||
<Properties> | ||
- `theme` | ||
- `'auto' | 'light' | 'dark'` | ||
|
||
The CAPTCHA widget theme. Defaults to `auto`. | ||
|
||
--- | ||
|
||
- `size` | ||
- `'normal' | 'flexible' | 'compact'` | ||
|
||
The CAPTCHA widget size. Defaults to `normal`. | ||
|
||
--- | ||
|
||
- `language` | ||
- `string` | ||
|
||
The CAPTCHA widget language/locale. When setting the language for CAPTCHA, this is how localization is prioritized: | ||
|
||
- `appearance.captcha.language`: Set by this `language` property. | ||
- `localization.locale`: Set by the [`localization` prop on `<ClerkProvider>`](/docs/customization/localization). Some languages are [supported by Clerk](/docs/customization/localization) but not by Cloudflare Turnstile, which is used for the CAPTCHA widget. See [Cloudflare Turnstile's supported languages](https://developers.cloudflare.com/turnstile/reference/supported-languages). | ||
- `en-US`: Clerk's default language. | ||
</Properties> | ||
|
||
## Usage | ||
|
||
<Tabs items={["Next.js", "Astro", "React", "Remix", "Nuxt", "Vue"]}> | ||
<Tab> | ||
```tsx {{ prettier: false, filename: 'app.tsx' }} | ||
import { ClerkProvider } from '@clerk/nextjs'; | ||
|
||
<ClerkProvider | ||
appearance={{ | ||
captcha: { | ||
theme: 'dark', | ||
size: 'flexible', | ||
language: 'es-ES', | ||
} | ||
}} | ||
> | ||
{/* ... */} | ||
</ClerkProvider>; | ||
``` | ||
</Tab> | ||
|
||
<Tab> | ||
```js {{ filename: 'astro.config.mjs' }} | ||
import clerk from '@clerk/astro' | ||
|
||
export default defineConfig({ | ||
integrations: [ | ||
clerk({ | ||
appearance: { | ||
captcha: { | ||
theme: 'dark', | ||
size: 'flexible', | ||
language: 'es-ES', | ||
}, | ||
}, | ||
}), | ||
], | ||
}) | ||
``` | ||
</Tab> | ||
|
||
<Tab> | ||
```tsx {{ filename: 'app.tsx', mark: [[13, 18]] }} | ||
import React from 'react' | ||
import './App.css' | ||
import { ClerkProvider } from '@clerk/clerk-react' | ||
|
||
if (!process.env.REACT_APP_CLERK_PUBLISHABLE_KEY) { | ||
throw new Error('Missing Publishable Key') | ||
} | ||
const clerkPubKey = process.env.REACT_APP_CLERK_PUBLISHABLE_KEY | ||
|
||
function App() { | ||
return ( | ||
<ClerkProvider | ||
appearance={{ | ||
captcha: { | ||
theme: 'dark', | ||
size: 'flexible', | ||
language: 'es-ES', | ||
}, | ||
}} | ||
publishableKey={clerkPubKey} | ||
> | ||
{/* ... */} | ||
</ClerkProvider> | ||
) | ||
} | ||
|
||
export default App | ||
``` | ||
</Tab> | ||
|
||
<Tab> | ||
```tsx {{ filename: 'app/root.tsx', mark: [[35, 40]] }} | ||
// Import ClerkApp | ||
import { ClerkApp } from '@clerk/remix' | ||
import type { MetaFunction, LoaderFunction } from '@remix-run/node' | ||
|
||
import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from '@remix-run/react' | ||
|
||
import { rootAuthLoader } from '@clerk/remix/ssr.server' | ||
|
||
export const meta: MetaFunction = () => ({ | ||
charset: 'utf-8', | ||
title: 'New Remix App', | ||
viewport: 'width=device-width,initial-scale=1', | ||
}) | ||
|
||
export const loader: LoaderFunction = (args) => rootAuthLoader(args) | ||
|
||
function App() { | ||
return ( | ||
<html lang="en"> | ||
<head> | ||
<Meta /> | ||
<Links /> | ||
</head> | ||
<body> | ||
<Outlet /> | ||
<ScrollRestoration /> | ||
<Scripts /> | ||
<LiveReload /> | ||
</body> | ||
</html> | ||
) | ||
} | ||
|
||
export default ClerkApp(App, { | ||
appearance: { | ||
captcha: { | ||
theme: 'dark', | ||
size: 'flexible', | ||
language: 'es-ES', | ||
}, | ||
}, | ||
}) | ||
``` | ||
</Tab> | ||
|
||
<Tab> | ||
```ts {{ filename: 'nuxt.config.ts' }} | ||
export default defineNuxtConfig({ | ||
modules: ['@clerk/nuxt'], | ||
clerk: { | ||
appearance: { | ||
captcha: { | ||
theme: 'dark', | ||
size: 'flexible', | ||
language: 'es-ES', | ||
}, | ||
}, | ||
}, | ||
}) | ||
``` | ||
</Tab> | ||
|
||
<Tab> | ||
```ts {{ filename: 'src/main.ts' }} | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
import { clerkPlugin } from '@clerk/vue' | ||
|
||
const app = createApp(App) | ||
app.use(clerkPlugin, { | ||
appearance: { | ||
captcha: { | ||
theme: 'dark', | ||
size: 'flexible', | ||
language: 'es-ES', | ||
}, | ||
}, | ||
}) | ||
app.mount('#app') | ||
``` | ||
</Tab> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters