Skip to main content
Version: v2

@friendlycaptcha/sdk > CreateWidgetOptions

CreateWidgetOptions interface

Options when creating a widget programmatically.

Signature:

export interface CreateWidgetOptions 

Properties

PropertyModifiersTypeDescription
apiEndpoint?string | "eu" | "global"(Optional) A custom endpoint from which the agent and widgets are loaded.
elementHTMLElementThe HTML element to mount to, usually this is an element with class .frc-captcha.
formFieldName?string | null(Optional) The name of the field in the form that is set, defaults to frc-captcha-response.
language?string

(Optional) Language code such as "en" for English or "de" for German. Defaults to automatic language detection.

Usually you should not set this yourself and instead let the widget detect the language automatically.

sitekey?string(Optional) Sitekey of your application, starts with FC.
startMode?StartMode

(Optional) The start mode determines the behavior around automatic activation of the widget. Activation here means the challenge gets requested and gets solved. Defaults to "focus".

* "auto": the widget gets activated as soon as it is created. * "focus": the widget gets activated as soon as the form above it is focused. * "none": The widget does not start automatically at all, the user needs to press the widget.

theme?"light" | "dark" | "auto"

(Optional) The theme for the widget.

* "light" (default): a light theme with a white background. * "dark": a dark theme with a dark background. * "auto": the theme is automatically chosen based on the user's system preferences.