<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@friendlycaptcha/sdk](./sdk.md) &gt; [CreateWidgetOptions](./sdk.createwidgetoptions.md)

## CreateWidgetOptions interface

Options when creating a widget programmatically.

**Signature:**

```typescript
export interface CreateWidgetOptions 
```

## Properties

<table><thead><tr><th>

Property


</th><th>

Modifiers


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

[apiEndpoint?](./sdk.createwidgetoptions.apiendpoint.md)


</td><td>


</td><td>

[APIEndpoint](./sdk.apiendpoint.md)


</td><td>

_(Optional)_ A custom endpoint from which the agent and widgets are loaded.


</td></tr>
<tr><td>

[element](./sdk.createwidgetoptions.element.md)


</td><td>


</td><td>

HTMLElement


</td><td>

The HTML element to mount to, usually this is an element with class `.frc-captcha`<!-- -->.


</td></tr>
<tr><td>

[formFieldName?](./sdk.createwidgetoptions.formfieldname.md)


</td><td>


</td><td>

string \| null


</td><td>

_(Optional)_ The name of the field in the form that is set, defaults to `frc-captcha-response`<!-- -->.


</td></tr>
<tr><td>

[language?](./sdk.createwidgetoptions.language.md)


</td><td>


</td><td>

string


</td><td>

_(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.


</td></tr>
<tr><td>

[sitekey?](./sdk.createwidgetoptions.sitekey.md)


</td><td>


</td><td>

string


</td><td>

_(Optional)_ Sitekey of your application, starts with `FC`<!-- -->.


</td></tr>
<tr><td>

[startMode?](./sdk.createwidgetoptions.startmode.md)


</td><td>


</td><td>

[StartMode](./sdk.startmode.md)


</td><td>

_(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.


</td></tr>
<tr><td>

[theme?](./sdk.createwidgetoptions.theme.md)


</td><td>


</td><td>

"light" \| "dark" \| "auto"


</td><td>

_(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.


</td></tr>
</tbody></table>

