<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@friendlycaptcha/sdk](./sdk.md) &gt; [FriendlyCaptchaSDK](./sdk.friendlycaptchasdk.md) &gt; [getWidgetById](./sdk.friendlycaptchasdk.getwidgetbyid.md)

## FriendlyCaptchaSDK.getWidgetById() method

Retrieves a widget by its widget ID.

**Signature:**

```typescript
getWidgetById(id: string): WidgetHandle | undefined;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

id


</td><td>

string


</td><td>


</td></tr>
</tbody></table>

**Returns:**

[WidgetHandle](./sdk.widgethandle.md) \| undefined

