Methods
ftools('open', surveyId, options?)
Manually opens a popup survey. Requires Manual Tracking to be enabled for the survey in the dashboard.
ftools('open', 'SURVEY_ID');
ftools('open', 'SURVEY_ID', { force: true, metadata: { userId: '123' } });| Parameter | Type | Description |
|---|---|---|
surveyId | string | Survey ID. |
options.force | boolean | Show even if the user already answered or closed the survey. |
options.metadata | object | Custom data attached to the response. See Custom variables. |
Not supported for embed surveys — embed surveys render immediately on init().
ftools('close', surveyId, options?)
Programmatically closes an open popup survey.
ftools('close', 'SURVEY_ID');
ftools('close', 'SURVEY_ID', { silent: true });| Parameter | Type | Description |
|---|---|---|
surveyId | string | Survey ID. |
options.silent | boolean | If true, no survey_closed event is sent to the API. |
Not supported for embed surveys.
ftools('destroy', surveyId)
Destroys a survey completely — unmounts from the DOM, cancels triggers, and frees the ID. Works for both popup and embed surveys. After this, init() with the same ID starts fresh.
ftools('destroy', 'SURVEY_ID');Use this in component cleanup functions (e.g. useEffect cleanup, onUnmounted) to properly clean up embed surveys.
ftools('destroyAll')
Destroys the entire SDK instance — unmounts all surveys, cancels all triggers, removes the feedback button, and restores the patched History API. window.ftools should not be used after calling this.
ftools('destroyAll');Use this for complete teardown when you need to fully remove the SDK from the page.