@friendlycaptcha/sdk > FriendlyCaptchaSDK
FriendlyCaptchaSDK class
Main entry point for V2 of the Friendly Captcha SDK. This class keeps track of widgets and allows you to create widgets programmatically.
Generally there should only be one instance of this SDK in your website.
Signature:
export declare class FriendlyCaptchaSDK
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(opts) | Constructs a new instance of the FriendlyCaptchaSDK class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
attached | Promise<WidgetHandle[]> | A promise that resolves to all the widgets that are currently attached. |
Methods
Method | Modifiers | Description |
---|---|---|
attach(elements) | Attaches a widget to given element or elements if they are not attached to yet. You can pass one or more HTML elements to attach to, or undefined. If Returns handles to the newly-attached elements. | |
clear() | Completely remove all widgets and background agents related to the SDK on this page. | |
createWidget(opts) | Creates a Friendly Captcha widget with given options under given HTML element. | |
getAllWidgets() | Returns all current widgets known about (in an unspecified order). | |
getWidgetById(id) | Retrieves a widget by its widget ID. |