Files
insights-js/packages/browser/references/insights-js-references-1.286.0.json

4302 lines
164 KiB
JSON

{
"id": "@hanzo/insights",
"hogRef": "0.3",
"info": {
"version": "1.286.0",
"id": "@hanzo/insights",
"title": "Insights JavaScript Web SDK",
"description": "Insights-js allows you to automatically capture usage and send events to Insights.",
"slugPrefix": "@hanzo/insights",
"specUrl": "https://github.com/hanzoai/@hanzo/insights"
},
"classes": [
{
"description": "This is the SDK reference for the Insights JavaScript Web SDK. You can learn more about example usage in the [JavaScript Web SDK documentation](/docs/libraries/js). You can also follow [framework specific guides](/docs/frameworks) to integrate Insights into your project.\nThis SDK is designed for browser environments. Use the Insights [Node.js SDK](/docs/libraries/node) for server-side usage.",
"id": "Insights",
"title": "Insights",
"functions": [
{
"category": "",
"description": "Constructs a new instance of the `Insights` class",
"details": null,
"id": "Insights",
"showDocs": true,
"title": "Insights",
"examples": [
{
"id": "insights",
"name": "Generated example for Insights",
"code": "// Generated example for Insights\ninsights.Insights();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "any",
"name": "any"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)",
"details": "Insights will use this to link two distinct_ids going forward (not retroactively). Call this when a user signs up to connect their anonymous session with their account.",
"id": "alias",
"showDocs": true,
"title": "alias",
"examples": [
{
"id": "link_anonymous_user_to_account_on_signup",
"name": "link anonymous user to account on signup",
"code": "\n\n// link anonymous user to account on signup\ninsights.alias('user_12345')\n\n\n"
},
{
"id": "explicit_alias_with_original_id",
"name": "explicit alias with original ID",
"code": "\n\n// explicit alias with original ID\ninsights.alias('user_12345', 'anonymous_abc123')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "A unique identifier that you want to use for this user in the future.",
"isOptional": false,
"type": "string",
"name": "alias"
},
{
"description": "The current identifier being used for this user.",
"isOptional": true,
"type": "string",
"name": "original"
}
],
"returnType": {
"id": "CaptureResult | void | number",
"name": "CaptureResult | void | number"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Surveys",
"description": "Checks the feature flags associated with this Survey to see if the survey can be rendered. This method is deprecated because it's synchronous and won't return the correct result if surveys are not loaded. Use `canRenderSurveyAsync` instead.",
"details": null,
"id": "canRenderSurvey",
"showDocs": true,
"title": "canRenderSurvey",
"examples": [
{
"id": "canrendersurvey",
"name": "Generated example for canRenderSurvey",
"code": "// Generated example for canRenderSurvey\ninsights.canRenderSurvey();"
}
],
"releaseTag": "deprecated",
"params": [
{
"description": "The ID of the survey to check.",
"isOptional": false,
"type": "string",
"name": "surveyId"
}
],
"returnType": {
"id": "SurveyRenderReason | null",
"name": "SurveyRenderReason | null"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Surveys",
"description": "Checks the feature flags associated with this Survey to see if the survey can be rendered.",
"details": null,
"id": "canRenderSurveyAsync",
"showDocs": true,
"title": "canRenderSurveyAsync",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.canRenderSurveyAsync(surveyId).then((result) => {\n if (result.visible) {\n // Survey can be rendered\n console.log('Survey can be rendered')\n } else {\n // Survey cannot be rendered\n console.log('Survey cannot be rendered:', result.disabledReason)\n }\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The ID of the survey to check.",
"isOptional": false,
"type": "string",
"name": "surveyId"
},
{
"description": "If true, the survey will be reloaded from the server, Default: false",
"isOptional": true,
"type": "boolean",
"name": "forceReload"
}
],
"returnType": {
"id": "Promise<SurveyRenderReason>",
"name": "Promise<SurveyRenderReason>"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Capture",
"description": "Captures an event with optional properties and configuration.",
"details": "You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)",
"id": "capture",
"showDocs": true,
"title": "capture",
"examples": [
{
"id": "basic_event_capture",
"name": "basic event capture",
"code": "\n\n// basic event capture\ninsights.capture('cta-button-clicked', {\n button_name: 'Get Started',\n page: 'homepage'\n})\n\n\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')",
"isOptional": false,
"type": "EventName",
"name": "event_name"
},
{
"description": "Properties to include with the event describing the user or event details",
"isOptional": true,
"type": "Properties | null",
"name": "properties"
},
{
"description": "Optional configuration for the capture request",
"isOptional": true,
"type": "CaptureOptions",
"name": "options"
}
],
"returnType": {
"id": "CaptureResult | undefined",
"name": "CaptureResult | undefined"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Error tracking",
"description": "Capture a caught exception manually",
"details": null,
"id": "captureException",
"showDocs": true,
"title": "captureException",
"examples": [
{
"id": "capture_a_caught_exception",
"name": "Capture a caught exception",
"code": "\n\n// Capture a caught exception\ntry {\n // something that might throw\n} catch (error) {\n insights.captureException(error)\n}\n\n\n"
},
{
"id": "with_additional_properties",
"name": "With additional properties",
"code": "\n\n// With additional properties\ninsights.captureException(error, {\n customProperty: 'value',\n anotherProperty: ['I', 'can be a list'],\n ...\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The error to capture",
"isOptional": false,
"type": "unknown",
"name": "error"
},
{
"description": "Any additional properties to add to the error event",
"isOptional": true,
"type": "Properties",
"name": "additionalProperties"
}
],
"returnType": {
"id": "CaptureResult | undefined",
"name": "CaptureResult | undefined"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "LLM analytics",
"description": "Capture written user feedback for a LLM trace. Numeric values are converted to strings.",
"details": null,
"id": "captureTraceFeedback",
"showDocs": true,
"title": "captureTraceFeedback",
"examples": [
{
"id": "capturetracefeedback",
"name": "Generated example for captureTraceFeedback",
"code": "// Generated example for captureTraceFeedback\ninsights.captureTraceFeedback();"
}
],
"releaseTag": "public",
"params": [
{
"description": "The trace ID to capture feedback for.",
"isOptional": false,
"type": "string | number",
"name": "traceId"
},
{
"description": "The feedback to capture.",
"isOptional": false,
"type": "string",
"name": "userFeedback"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "LLM analytics",
"description": "Capture a metric for a LLM trace. Numeric values are converted to strings.",
"details": null,
"id": "captureTraceMetric",
"showDocs": true,
"title": "captureTraceMetric",
"examples": [
{
"id": "capturetracemetric",
"name": "Generated example for captureTraceMetric",
"code": "// Generated example for captureTraceMetric\ninsights.captureTraceMetric();"
}
],
"releaseTag": "public",
"params": [
{
"description": "The trace ID to capture the metric for.",
"isOptional": false,
"type": "string | number",
"name": "traceId"
},
{
"description": "The name of the metric to capture.",
"isOptional": false,
"type": "string",
"name": "metricName"
},
{
"description": "The value of the metric to capture.",
"isOptional": false,
"type": "string | number | boolean",
"name": "metricValue"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Privacy",
"description": "Clear the user's opt in/out status of data capturing and cookies/localstorage for this Insights instance",
"details": null,
"id": "clear_opt_in_out_capturing",
"showDocs": true,
"title": "clear_opt_in_out_capturing",
"examples": [
{
"id": "clear_opt_in_out_capturing",
"name": "Generated example for clear_opt_in_out_capturing",
"code": "// Generated example for clear_opt_in_out_capturing\ninsights.clear_opt_in_out_capturing();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Creates a person profile for the current user, if they don't already have one and config.person_profiles is set to 'identified_only'. Produces a warning and does not create a profile if config.person_profiles is set to 'never'. Learn more about [person profiles](/docs/product-analytics/identify)",
"details": null,
"id": "createPersonProfile",
"showDocs": true,
"title": "createPersonProfile",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.createPersonProfile()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Initialization",
"description": "Enables or disables debug mode for detailed logging.",
"details": "Debug mode logs all Insights calls to the browser console for troubleshooting. Can also be enabled by adding `?__insights_debug=true` to the URL.",
"id": "debug",
"showDocs": true,
"title": "debug",
"examples": [
{
"id": "enable_debug_mode",
"name": "enable debug mode",
"code": "\n\n// enable debug mode\ninsights.debug(true)\n\n\n"
},
{
"id": "disable_debug_mode",
"name": "disable debug mode",
"code": "\n\n// disable debug mode\ninsights.debug(false)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "If true, will enable debug mode.",
"isOptional": true,
"type": "boolean",
"name": "debug"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Surveys",
"description": "Display a survey programmatically as either a popover or inline element.",
"details": null,
"id": "displaySurvey",
"showDocs": true,
"title": "displaySurvey",
"examples": [
{
"id": "display_as_popover_(respects_all_conditions_defined_in_the_dashboard)",
"name": "Display as popover (respects all conditions defined in the dashboard)",
"code": "\n\n// Display as popover (respects all conditions defined in the dashboard)\ninsights.displaySurvey('survey-id-123')\n\n\n"
},
{
"id": "display_inline_in_a_specific_element",
"name": "Display inline in a specific element",
"code": "\n\n// Display inline in a specific element\ninsights.displaySurvey('survey-id-123', {\n displayType: DisplaySurveyType.Inline,\n selector: '#survey-container'\n})\n\n\n"
},
{
"id": "force_display_ignoring_conditions_and_delays",
"name": "Force display ignoring conditions and delays",
"code": "\n\n// Force display ignoring conditions and delays\ninsights.displaySurvey('survey-id-123', {\n displayType: DisplaySurveyType.Popover,\n ignoreConditions: true,\n ignoreDelay: true\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The survey ID to display",
"isOptional": false,
"type": "string",
"name": "surveyId"
},
{
"description": "Display configuration",
"isOptional": true,
"type": "DisplaySurveyOptions",
"name": "options"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Returns the current distinct ID for the user.",
"details": "This is either the auto-generated ID or the ID set via `identify()`. The distinct ID is used to associate events with users in Insights.",
"id": "get_distinct_id",
"showDocs": true,
"title": "get_distinct_id",
"examples": [
{
"id": "get_the_current_user_id",
"name": "get the current user ID",
"code": "\n\n// get the current user ID\nconst userId = insights.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n"
},
{
"id": "use_in_loaded_callback",
"name": "use in loaded callback",
"code": "\n\n// use in loaded callback\ninsights.init('token', {\n loaded: (insights) => {\n const id = insights.get_distinct_id()\n // use the ID\n }\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string",
"name": "string"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "",
"description": "Returns the explicit consent status of the user.",
"details": "This can be used to check if the user has explicitly opted in or out of data capturing, or neither. This does not take the default config options into account, only whether the user has made an explicit choice, so this can be used to determine whether to show an initial cookie banner or not.",
"id": "get_explicit_consent_status",
"showDocs": true,
"title": "get_explicit_consent_status",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nconst consentStatus = insights.get_explicit_consent_status()\nif (consentStatus === \"granted\") {\n // user has explicitly opted in\n} else if (consentStatus === \"denied\") {\n // user has explicitly opted out\n} else if (consentStatus === \"pending\"){\n // user has not made a choice, show consent banner\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "'granted' | 'denied' | 'pending'",
"name": "'granted' | 'denied' | 'pending'"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Returns the value of a super property. Returns undefined if the property doesn't exist.",
"details": "get_property() can only be called after the Insights library has finished loading. init() has a loaded function available to handle this automatically.",
"id": "get_property",
"showDocs": true,
"title": "get_property",
"examples": [
{
"id": "grab_value_for_'$user_id'_after_the_insights_library_has_loaded",
"name": "grab value for '$user_id' after the insights library has loaded",
"code": "\n\n// grab value for '$user_id' after the insights library has loaded\ninsights.init('<YOUR PROJECT TOKEN>', {\n loaded: function(insights) {\n user_id = insights.get_property('$user_id');\n }\n});\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The name of the super property you want to retrieve",
"isOptional": false,
"type": "string",
"name": "property_name"
}
],
"returnType": {
"id": "Property | undefined",
"name": "Property | undefined"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "",
"description": "Returns the current session_id.",
"details": "This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.",
"id": "get_session_id",
"showDocs": true,
"title": "get_session_id",
"examples": [
{
"id": "get_session_id",
"name": "Generated example for get_session_id",
"code": "// Generated example for get_session_id\ninsights.get_session_id();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string",
"name": "string"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Session replay",
"description": "Returns the Replay url for the current session.",
"details": null,
"id": "get_session_replay_url",
"showDocs": true,
"title": "get_session_replay_url",
"examples": [
{
"id": "basic_usage",
"name": "basic usage",
"code": "\n\n// basic usage\ninsights.get_session_replay_url()\n\n@example\n\njs // timestamp insights.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback insights.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Options for the url",
"isOptional": true,
"type": "{\n withTimestamp?: boolean;\n timestampLookBack?: number;\n }",
"name": "options"
}
],
"returnType": {
"id": "string",
"name": "string"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Surveys",
"description": "Get surveys that should be enabled for the current user. See [fetching surveys documentation](/docs/surveys/implementing-custom-surveys#fetching-surveys-manually) for more details.",
"details": null,
"id": "getActiveMatchingSurveys",
"showDocs": true,
"title": "getActiveMatchingSurveys",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.getActiveMatchingSurveys((surveys) => {\n // do something\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The callback function will be called when the surveys are loaded or updated.",
"isOptional": false,
"type": "SurveyCallback",
"name": "callback"
},
{
"description": "Whether to force a reload of the surveys.",
"isOptional": true,
"type": "boolean",
"name": "forceReload"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Get the list of early access features. To check enrollment status, use `isFeatureEnabled`. [Learn more in the docs](/docs/feature-flags/early-access-feature-management#option-2-custom-implementation)",
"details": null,
"id": "getEarlyAccessFeatures",
"showDocs": true,
"title": "getEarlyAccessFeatures",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nconst insights = useInsights()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n insights.getEarlyAccessFeatures((features) => {\n // Filter features by stage\n const betaFeatures = features.filter(feature => feature.stage === 'beta')\n const conceptFeatures = features.filter(feature => feature.stage === 'concept')\n\n setComingSoonFeatures(conceptFeatures)\n\n if (!activeFlags || activeFlags.length === 0) {\n setInactiveBetas(betaFeatures)\n return\n }\n\n const activeBetas = betaFeatures.filter(\n beta => activeFlags.includes(beta.flagKey)\n );\n const inactiveBetas = betaFeatures.filter(\n beta => !activeFlags.includes(beta.flagKey)\n );\n setActiveBetas(activeBetas)\n setInactiveBetas(inactiveBetas)\n }, true, ['concept', 'beta'])\n}, [activeFlags])\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The callback function will be called when the early access features are loaded.",
"isOptional": false,
"type": "EarlyAccessFeatureCallback",
"name": "callback"
},
{
"description": "Whether to force a reload of the early access features.",
"isOptional": true,
"type": "boolean",
"name": "force_reload"
},
{
"description": "The stages of the early access features to load.",
"isOptional": true,
"type": "EarlyAccessFeatureStage[]",
"name": "stages"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Gets the value of a feature flag for the current user.",
"details": "Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.",
"id": "getFeatureFlag",
"showDocs": true,
"title": "getFeatureFlag",
"examples": [
{
"id": "check_boolean_flag",
"name": "check boolean flag",
"code": "\n\n// check boolean flag\nif (insights.getFeatureFlag('new-feature')) {\n // show new feature\n}\n\n\n"
},
{
"id": "check_multivariate_flag",
"name": "check multivariate flag",
"code": "\n\n// check multivariate flag\nconst variant = insights.getFeatureFlag('button-color')\nif (variant === 'red') {\n // show red button\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "key"
},
{
"description": "(optional) If send_event: false, we won't send an $feature_flag_call event to Insights.",
"isOptional": true,
"type": "{\n send_event?: boolean;\n }",
"name": "options"
}
],
"returnType": {
"id": "boolean | string | undefined",
"name": "boolean | string | undefined"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Get feature flag payload value matching key for user (supports multivariate flags).",
"details": null,
"id": "getFeatureFlagPayload",
"showDocs": true,
"title": "getFeatureFlagPayload",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nif(insights.getFeatureFlag('beta-feature') === 'some-value') {\n const someValue = insights.getFeatureFlagPayload('beta-feature')\n // do something\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "key"
}
],
"returnType": {
"id": "JsonType",
"name": "JsonType"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Returns the current groups.",
"details": null,
"id": "getGroups",
"showDocs": true,
"title": "getGroups",
"examples": [
{
"id": "getgroups",
"name": "Generated example for getGroups",
"code": "// Generated example for getGroups\ninsights.getGroups();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Record<string, any>",
"name": "Record<string, any>"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Initialization",
"description": "Returns the current page view ID.",
"details": null,
"id": "getPageViewId",
"showDocs": true,
"title": "getPageViewId",
"examples": [
{
"id": "getpageviewid",
"name": "Generated example for getPageViewId",
"code": "// Generated example for getPageViewId\ninsights.getPageViewId();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string | undefined",
"name": "string | undefined"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value.",
"details": "This is based on browser-level `sessionStorage`, NOT the Insights session. getSessionProperty() can only be called after the Insights library has finished loading. init() has a loaded function available to handle this automatically.",
"id": "getSessionProperty",
"showDocs": true,
"title": "getSessionProperty",
"examples": [
{
"id": "grab_value_for_'user_id'_after_the_insights_library_has_loaded",
"name": "grab value for 'user_id' after the insights library has loaded",
"code": "\n\n// grab value for 'user_id' after the insights library has loaded\ninsights.init('YOUR PROJECT TOKEN', {\n loaded: function(insights) {\n user_id = insights.getSessionProperty('user_id');\n }\n});\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The name of the session super property you want to retrieve",
"isOptional": false,
"type": "string",
"name": "property_name"
}
],
"returnType": {
"id": "Property | undefined",
"name": "Property | undefined"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Surveys",
"description": "Get list of all surveys.",
"details": null,
"id": "getSurveys",
"showDocs": true,
"title": "getSurveys",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nfunction callback(surveys, context) {\n // do something\n}\n\ninsights.getSurveys(callback, false)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Function that receives the array of surveys",
"isOptional": false,
"type": "SurveyCallback",
"name": "callback"
},
{
"description": "Optional boolean to force an API call for updated surveys",
"isOptional": true,
"type": "boolean",
"name": "forceReload"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)",
"details": "Groups allow you to analyze users collectively (e.g., by organization, team, or account). This sets the group association for all subsequent events and reloads feature flags.",
"id": "group",
"showDocs": true,
"title": "group",
"examples": [
{
"id": "associate_user_with_an_organization",
"name": "associate user with an organization",
"code": "\n\n// associate user with an organization\ninsights.group('organization', 'org_12345', {\n name: 'Acme Corp',\n plan: 'enterprise'\n})\n\n\n"
},
{
"id": "associate_with_multiple_group_types",
"name": "associate with multiple group types",
"code": "\n\n// associate with multiple group types\ninsights.group('organization', 'org_12345')\ninsights.group('team', 'team_67890')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Group type (example: 'organization')",
"isOptional": false,
"type": "string",
"name": "groupType"
},
{
"description": "Group key (example: 'org::5')",
"isOptional": false,
"type": "string",
"name": "groupKey"
},
{
"description": "Optional properties to set for group",
"isOptional": true,
"type": "Properties",
"name": "groupPropertiesToSet"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Privacy",
"description": "Checks if the user has opted into data capturing.",
"details": "Returns the current consent status for event tracking and data persistence.",
"id": "has_opted_in_capturing",
"showDocs": true,
"title": "has_opted_in_capturing",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nif (insights.has_opted_in_capturing()) {\n // show analytics features\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "boolean",
"name": "boolean"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Privacy",
"description": "Checks if the user has opted out of data capturing.",
"details": "Returns the current consent status for event tracking and data persistence.",
"id": "has_opted_out_capturing",
"showDocs": true,
"title": "has_opted_out_capturing",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nif (insights.has_opted_out_capturing()) {\n // disable analytics features\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "boolean",
"name": "boolean"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)",
"details": "By default, Insights assigns each user a randomly generated `distinct_id`. Use this method to replace that ID with your own unique identifier (like a user ID from your database).",
"id": "identify",
"showDocs": true,
"title": "identify",
"examples": [
{
"id": "basic_identification",
"name": "basic identification",
"code": "\n\n// basic identification\ninsights.identify('user_12345')\n\n\n"
},
{
"id": "identify_with_user_properties",
"name": "identify with user properties",
"code": "\n\n// identify with user properties\ninsights.identify('user_12345', {\n email: '[email protected]',\n plan: 'premium'\n})\n\n\n"
},
{
"id": "identify_with_set_and_set_once_properties",
"name": "identify with set and set_once properties",
"code": "\n\n// identify with set and set_once properties\ninsights.identify('user_12345',\n { last_login: new Date() }, // updates every time\n { signup_date: new Date() } // sets only once\n)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "A string that uniquely identifies a user. If not provided, the distinct_id currently in the persistent store (cookie or localStorage) will be used.",
"isOptional": true,
"type": "string",
"name": "new_distinct_id"
},
{
"description": "Optional: An associative array of properties to store about the user. Note: For feature flag evaluations, if the same key is present in the userPropertiesToSetOnce, it will be overwritten by the value in userPropertiesToSet.",
"isOptional": true,
"type": "Properties",
"name": "userPropertiesToSet"
},
{
"description": "Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value.",
"isOptional": true,
"type": "Properties",
"name": "userPropertiesToSetOnce"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Initialization",
"description": "Initializes a new instance of the Insights capturing object.",
"details": "All new instances are added to the main insights object as sub properties (such as `insights.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/insights/@hanzo/insights/blob/6e0e873/src/insights-core.js#L57-L91)",
"id": "init",
"showDocs": true,
"title": "init",
"examples": [
{
"id": "basic_initialization",
"name": "basic initialization",
"code": "\n\n// basic initialization\ninsights.init('<hi_project_api_key>', {\n api_host: '<hi_client_api_host>'\n})\n\n\n"
},
{
"id": "multiple_instances",
"name": "multiple instances",
"code": "\n\n// multiple instances\ninsights.init('<hi_project_api_key>', {}, 'project1')\ninsights.init('<hi_project_api_key>', {}, 'project2')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Your Insights API token",
"isOptional": false,
"type": "string",
"name": "token"
},
{
"description": "A dictionary of config options to override",
"isOptional": true,
"type": "OnlyValidKeys<Partial<InsightsConfig>, Partial<InsightsConfig>>",
"name": "config"
},
{
"description": "The name for the new insights instance that you want created",
"isOptional": true,
"type": "string",
"name": "name"
}
],
"returnType": {
"id": "Insights",
"name": "Insights"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Privacy",
"description": "Checks whether the Insights library is currently capturing events.\nUsually this means that the user has not opted out of capturing, but the exact behaviour can be controlled by some config options.\nAdditionally, if the cookieless_mode is set to 'on_reject', we will capture events in cookieless mode if the user has explicitly opted out.",
"details": null,
"id": "is_capturing",
"showDocs": true,
"title": "is_capturing",
"examples": [
{
"id": "is_capturing",
"name": "Generated example for is_capturing",
"code": "// Generated example for is_capturing\ninsights.is_capturing();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "boolean",
"name": "boolean"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Checks if a feature flag is enabled for the current user.",
"details": "Returns true if the flag is enabled, false if disabled, or undefined if not found. This is a convenience method that treats any truthy value as enabled.",
"id": "isFeatureEnabled",
"showDocs": true,
"title": "isFeatureEnabled",
"examples": [
{
"id": "simple_feature_flag_check",
"name": "simple feature flag check",
"code": "\n\n// simple feature flag check\nif (insights.isFeatureEnabled('new-checkout')) {\n showNewCheckout()\n}\n\n\n"
},
{
"id": "disable_event_tracking",
"name": "disable event tracking",
"code": "\n\n// disable event tracking\nif (insights.isFeatureEnabled('feature', { send_event: false })) {\n // flag checked without sending $feature_flag_call event\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "key"
},
{
"description": "(optional) If send_event: false, we won't send an $feature_flag_call event to Insights.",
"isOptional": true,
"type": "{\n send_event: boolean;\n }",
"name": "options"
}
],
"returnType": {
"id": "boolean | undefined",
"name": "boolean | undefined"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Toolbar",
"description": "returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded",
"details": null,
"id": "loadToolbar",
"showDocs": true,
"title": "loadToolbar",
"examples": [
{
"id": "loadtoolbar",
"name": "Generated example for loadToolbar",
"code": "// Generated example for loadToolbar\ninsights.loadToolbar();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "ToolbarParams",
"name": "params"
}
],
"returnType": {
"id": "boolean",
"name": "boolean"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Capture",
"description": "Exposes a set of events that Insights will emit. e.g. `eventCaptured` is emitted immediately before trying to send an event\nUnlike `onFeatureFlags` and `onSessionId` these are not called when the listener is registered, the first callback will be the next event _after_ registering a listener",
"details": null,
"id": "on",
"showDocs": true,
"title": "on",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.on('eventCaptured', (event) => {\n console.log(event)\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The event to listen for.",
"isOptional": false,
"type": "'eventCaptured'",
"name": "event"
},
{
"description": "The callback function to call when the event is emitted.",
"isOptional": false,
"type": "(...args: any[]) => void",
"name": "cb"
}
],
"returnType": {
"id": "() => void",
"name": "() => void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Register an event listener that runs when feature flags become available or when they change. If there are flags, the listener is called immediately in addition to being called on future changes. Note that this is not called only when we fetch feature flags from the server, but also when they change in the browser.",
"details": null,
"id": "onFeatureFlags",
"showDocs": true,
"title": "onFeatureFlags",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n // do something\n})\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The callback function will be called once the feature flags are ready or when they are updated. It'll return a list of feature flags enabled for the user, the variants, and also a context object indicating whether we succeeded to fetch the flags or not.",
"isOptional": false,
"type": "FeatureFlagsCallback",
"name": "callback"
}
],
"returnType": {
"id": "() => void",
"name": "() => void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Register an event listener that runs whenever the session id or window id change. If there is already a session id, the listener is called immediately in addition to being called on future changes.\nCan be used, for example, to sync the Insights session id with a backend session.",
"details": null,
"id": "onSessionId",
"showDocs": true,
"title": "onSessionId",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.onSessionId(function(sessionId, windowId) { // do something })\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The callback function will be called once a session id is present or when it or the window id are updated.",
"isOptional": false,
"type": "SessionIdChangedCallback",
"name": "callback"
}
],
"returnType": {
"id": "() => void",
"name": "() => void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Surveys",
"description": "Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from Insights using the getSurveys method - context: isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully",
"details": null,
"id": "onSurveysLoaded",
"showDocs": true,
"title": "onSurveysLoaded",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.onSurveysLoaded((surveys, context) => { // do something })\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The callback function will be called when surveys are loaded or updated.",
"isOptional": false,
"type": "SurveyCallback",
"name": "callback"
}
],
"returnType": {
"id": "() => void",
"name": "() => void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Privacy",
"description": "Opts the user into data capturing and persistence.",
"details": "Enables event tracking and data persistence (cookies/localStorage) for this Insights instance. By default, captures an `$opt_in` event unless disabled.",
"id": "opt_in_capturing",
"showDocs": true,
"title": "opt_in_capturing",
"examples": [
{
"id": "simple_opt-in",
"name": "simple opt-in",
"code": "\n\n// simple opt-in\ninsights.opt_in_capturing()\n\n\n"
},
{
"id": "opt-in_with_custom_event_and_properties",
"name": "opt-in with custom event and properties",
"code": "\n\n// opt-in with custom event and properties\ninsights.opt_in_capturing({\n captureEventName: 'Privacy Accepted',\n captureProperties: { source: 'banner' }\n})\n\n\n"
},
{
"id": "opt-in_without_capturing_event",
"name": "opt-in without capturing event",
"code": "\n\n// opt-in without capturing event\ninsights.opt_in_capturing({\n captureEventName: false\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": true,
"type": "{\n captureEventName?: EventName | null | false; /** event name to be used for capturing the opt-in action */\n captureProperties?: Properties; /** set of properties to be captured along with the opt-in action */\n }",
"name": "options"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Privacy",
"description": "Opts the user out of data capturing and persistence.",
"details": "Disables event tracking and data persistence (cookies/localStorage) for this Insights instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.",
"id": "opt_out_capturing",
"showDocs": true,
"title": "opt_out_capturing",
"examples": [
{
"id": "opt_user_out_(e.g.,_on_privacy_settings_page)",
"name": "opt user out (e.g., on privacy settings page)",
"code": "\n\n// opt user out (e.g., on privacy settings page)\ninsights.opt_out_capturing()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "",
"description": "push() keeps the standard async-array-push behavior around after the lib is loaded. This is only useful for external integrations that do not wish to rely on our convenience methods (created in the snippet).",
"details": null,
"id": "push",
"showDocs": true,
"title": "push",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.push(['register', { a: 'b' }]);\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "A [function_name, args...] array to be executed",
"isOptional": false,
"type": "SnippetArrayItem",
"name": "item"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Capture",
"description": "Registers super properties for the current session only.",
"details": "Session super properties are automatically added to all events during the current browser session. Unlike regular super properties, these are cleared when the session ends and are stored in sessionStorage.",
"id": "register_for_session",
"showDocs": true,
"title": "register_for_session",
"examples": [
{
"id": "register_session-specific_properties",
"name": "register session-specific properties",
"code": "\n\n// register session-specific properties\ninsights.register_for_session({\n current_page_type: 'checkout',\n ab_test_variant: 'control'\n})\n\n\n"
},
{
"id": "register_properties_for_user_flow_tracking",
"name": "register properties for user flow tracking",
"code": "\n\n// register properties for user flow tracking\ninsights.register_for_session({\n selected_plan: 'pro',\n completed_steps: 3,\n flow_id: 'signup_flow_v2'\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "An associative array of properties to store about the user",
"isOptional": false,
"type": "Properties",
"name": "properties"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Capture",
"description": "Registers super properties only if they haven't been set before.",
"details": "Unlike `register()`, this method will not overwrite existing super properties. Use this for properties that should only be set once, like signup date or initial referrer.",
"id": "register_once",
"showDocs": true,
"title": "register_once",
"examples": [
{
"id": "register_once-only_properties",
"name": "register once-only properties",
"code": "\n\n// register once-only properties\ninsights.register_once({\n first_login_date: new Date().toISOString(),\n initial_referrer: document.referrer\n})\n\n\n"
},
{
"id": "override_existing_value_if_it_matches_default",
"name": "override existing value if it matches default",
"code": "\n\n// override existing value if it matches default\ninsights.register_once(\n { user_type: 'premium' },\n 'unknown' // overwrite if current value is 'unknown'\n)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "An associative array of properties to store about the user",
"isOptional": false,
"type": "Properties",
"name": "properties"
},
{
"description": "Value to override if already set in super properties (ex: 'False') Default: 'None'",
"isOptional": true,
"type": "Property",
"name": "default_value"
},
{
"description": "How many days since the users last visit to store the super properties",
"isOptional": true,
"type": "number",
"name": "days"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Capture",
"description": "Registers super properties that are included with all events.",
"details": "Super properties are stored in persistence and automatically added to every event you capture. These values will overwrite any existing super properties with the same keys.",
"id": "register",
"showDocs": true,
"title": "register",
"examples": [
{
"id": "register_a_single_property",
"name": "register a single property",
"code": "\n\n// register a single property\ninsights.register({ plan: 'premium' })\n\n\n\n\n"
},
{
"id": "register_multiple_properties",
"name": "register multiple properties",
"code": "\n\n// register multiple properties\ninsights.register({\n email: '[email protected]',\n account_type: 'business',\n signup_date: '2023-01-15'\n})\n\n\n"
},
{
"id": "register_with_custom_expiration",
"name": "register with custom expiration",
"code": "\n\n// register with custom expiration\ninsights.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "properties to store about the user",
"isOptional": false,
"type": "Properties",
"name": "properties"
},
{
"description": "How many days since the user's last visit to store the super properties",
"isOptional": true,
"type": "number",
"name": "days"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Feature flag values are cached. If something has changed with your user and you'd like to refetch their flag values, call this method.",
"details": null,
"id": "reloadFeatureFlags",
"showDocs": true,
"title": "reloadFeatureFlags",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.reloadFeatureFlags()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Surveys",
"description": "Although we recommend using popover surveys and display conditions, if you want to show surveys programmatically without setting up all the extra logic needed for API surveys, you can render surveys programmatically with the renderSurvey method.\nThis takes a survey ID and an HTML selector to render an unstyled survey.",
"details": null,
"id": "renderSurvey",
"showDocs": true,
"title": "renderSurvey",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n"
}
],
"releaseTag": "deprecated",
"params": [
{
"description": "The ID of the survey to render.",
"isOptional": false,
"type": "string",
"name": "surveyId"
},
{
"description": "The selector of the HTML element to render the survey on.",
"isOptional": false,
"type": "string",
"name": "selector"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Resets all user data and starts a fresh session.\n⚠️ **Warning**: Only call this when a user logs out. Calling at the wrong time can cause split sessions.\nThis clears: - Session ID and super properties - User identification (sets new random distinct_id) - Cached data and consent settings",
"details": null,
"id": "reset",
"showDocs": true,
"title": "reset",
"examples": [
{
"id": "reset_on_user_logout",
"name": "reset on user logout",
"code": "\n\n// reset on user logout\nfunction logout() {\n insights.reset()\n // redirect to login page\n}\n\n\n"
},
{
"id": "reset_and_generate_new_device_id",
"name": "reset and generate new device ID",
"code": "\n\n// reset and generate new device ID\ninsights.reset(true) // also resets device_id\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": true,
"type": "boolean",
"name": "reset_device_id"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Resets the group properties for feature flags.",
"details": null,
"id": "resetGroupPropertiesForFlags",
"showDocs": true,
"title": "resetGroupPropertiesForFlags",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.resetGroupPropertiesForFlags()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": true,
"type": "string",
"name": "group_type"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)",
"details": null,
"id": "resetGroups",
"showDocs": true,
"title": "resetGroups",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.resetGroups()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Resets the person properties for feature flags.",
"details": null,
"id": "resetPersonPropertiesForFlags",
"showDocs": true,
"title": "resetPersonPropertiesForFlags",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.resetPersonPropertiesForFlags()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Session replay",
"description": "returns a boolean indicating whether session recording is currently running",
"details": null,
"id": "sessionRecordingStarted",
"showDocs": true,
"title": "sessionRecordingStarted",
"examples": [
{
"id": "stop_session_recording_if_it's_running",
"name": "Stop session recording if it's running",
"code": "\n\n// Stop session recording if it's running\nif (insights.sessionRecordingStarted()) {\n insights.stopSessionRecording()\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "boolean",
"name": "boolean"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Initialization",
"description": "Updates the configuration of the Insights instance.",
"details": null,
"id": "set_config",
"showDocs": true,
"title": "set_config",
"examples": [
{
"id": "set_config",
"name": "Generated example for set_config",
"code": "// Generated example for set_config\ninsights.set_config();"
}
],
"releaseTag": "public",
"params": [
{
"description": "A dictionary of new configuration values to update",
"isOptional": false,
"type": "Partial<InsightsConfig>",
"name": "config"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Set override group properties for feature flags. This is used when dealing with new groups / where you don't want to wait for ingestion to update properties. Takes in an object, the key of which is the group type.",
"details": null,
"id": "setGroupPropertiesForFlags",
"showDocs": true,
"title": "setGroupPropertiesForFlags",
"examples": [
{
"id": "set_properties_with_reload",
"name": "Set properties with reload",
"code": "\n\n// Set properties with reload\ninsights.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n"
},
{
"id": "set_properties_without_reload",
"name": "Set properties without reload",
"code": "\n\n// Set properties without reload\ninsights.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The properties to override, the key of which is the group type.",
"isOptional": false,
"type": "{\n [type: string]: Properties;\n }",
"name": "properties"
},
{
"description": "Whether to reload feature flags.",
"isOptional": true,
"type": "boolean",
"name": "reloadFeatureFlags"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Identification",
"description": "Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)",
"details": "Updates user properties that are stored with the person profile in Insights. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.",
"id": "setPersonProperties",
"showDocs": true,
"title": "setPersonProperties",
"examples": [
{
"id": "set_user_properties",
"name": "set user properties",
"code": "\n\n// set user properties\ninsights.setPersonProperties({\n email: '[email protected]',\n plan: 'premium'\n})\n\n\n"
},
{
"id": "set_properties",
"name": "set properties",
"code": "\n\n// set properties\ninsights.setPersonProperties(\n { name: 'Max Hedgehog' }, // $set properties\n { initial_url: '/blog' } // $set_once properties\n)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Optional: An associative array of properties to store about the user. Note: For feature flag evaluations, if the same key is present in the userPropertiesToSetOnce, it will be overwritten by the value in userPropertiesToSet.",
"isOptional": true,
"type": "Properties",
"name": "userPropertiesToSet"
},
{
"description": "Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value.",
"isOptional": true,
"type": "Properties",
"name": "userPropertiesToSetOnce"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Sometimes, you might want to evaluate feature flags using properties that haven't been ingested yet, or were set incorrectly earlier. You can do so by setting properties the flag depends on with these calls:",
"details": null,
"id": "setPersonPropertiesForFlags",
"showDocs": true,
"title": "setPersonPropertiesForFlags",
"examples": [
{
"id": "set_properties",
"name": "Set properties",
"code": "\n\n// Set properties\ninsights.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n"
},
{
"id": "set_properties_without_reloading",
"name": "Set properties without reloading",
"code": "\n\n// Set properties without reloading\ninsights.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The properties to override.",
"isOptional": false,
"type": "Properties",
"name": "properties"
},
{
"description": "Whether to reload feature flags.",
"isOptional": true,
"type": "boolean",
"name": "reloadFeatureFlags"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Session replay",
"description": "turns session recording on, and updates the config option `disable_session_recording` to false",
"details": null,
"id": "startSessionRecording",
"showDocs": true,
"title": "startSessionRecording",
"examples": [
{
"id": "start_and_ignore_controls",
"name": "Start and ignore controls",
"code": "\n\n// Start and ignore controls\ninsights.startSessionRecording(true)\n\n\n"
},
{
"id": "start_and_override_controls",
"name": "Start and override controls",
"code": "\n\n// Start and override controls\ninsights.startSessionRecording({\n // you don't have to send all of these\n sampling: true || false,\n linked_flag: true || false,\n url_trigger: true || false,\n event_trigger: true || false\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "optional boolean to override the default sampling behavior - ensures the next session recording to start will not be skipped by sampling or linked_flag config. `true` is shorthand for sampling: true, linked_flag: true",
"isOptional": true,
"type": "{\n sampling?: boolean;\n linked_flag?: boolean;\n url_trigger?: true;\n event_trigger?: true;\n } | true",
"name": "override"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Session replay",
"description": "turns session recording off, and updates the config option disable_session_recording to true",
"details": null,
"id": "stopSessionRecording",
"showDocs": true,
"title": "stopSessionRecording",
"examples": [
{
"id": "stop_session_recording",
"name": "Stop session recording",
"code": "\n\n// Stop session recording\ninsights.stopSessionRecording()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Capture",
"description": "Removes a session super property from the current session.",
"details": "This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.",
"id": "unregister_for_session",
"showDocs": true,
"title": "unregister_for_session",
"examples": [
{
"id": "remove_a_session_property",
"name": "remove a session property",
"code": "\n\n// remove a session property\ninsights.unregister_for_session('current_flow')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The name of the session super property to remove",
"isOptional": false,
"type": "string",
"name": "property"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Capture",
"description": "Removes a super property from persistent storage.",
"details": "This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.",
"id": "unregister",
"showDocs": true,
"title": "unregister",
"examples": [
{
"id": "remove_a_super_property",
"name": "remove a super property",
"code": "\n\n// remove a super property\ninsights.unregister('plan_type')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The name of the super property to remove",
"isOptional": false,
"type": "string",
"name": "property"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
},
{
"category": "Feature flags",
"description": "Opt the user in or out of an early access feature. [Learn more in the docs](/docs/feature-flags/early-access-feature-management#option-2-custom-implementation)",
"details": null,
"id": "updateEarlyAccessFeatureEnrollment",
"showDocs": true,
"title": "updateEarlyAccessFeatureEnrollment",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nconst toggleBeta = (betaKey) => {\n if (activeBetas.some(\n beta => beta.flagKey === betaKey\n )) {\n insights.updateEarlyAccessFeatureEnrollment(\n betaKey,\n false\n )\n setActiveBetas(\n prevActiveBetas => prevActiveBetas.filter(\n item => item.flagKey !== betaKey\n )\n );\n return\n }\n\n insights.updateEarlyAccessFeatureEnrollment(\n betaKey,\n true\n )\n setInactiveBetas(\n prevInactiveBetas => prevInactiveBetas.filter(\n item => item.flagKey !== betaKey\n )\n );\n}\n\nconst registerInterest = (featureKey) => {\n insights.updateEarlyAccessFeatureEnrollment(\n featureKey,\n true\n )\n // Update UI to show user has registered\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The key of the feature flag to update.",
"isOptional": false,
"type": "string",
"name": "key"
},
{
"description": "Whether the user is enrolled in the feature.",
"isOptional": false,
"type": "boolean",
"name": "isEnrolled"
},
{
"description": "The stage of the feature flag to update.",
"isOptional": true,
"type": "string",
"name": "stage"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "lib/src/insights-core.d.ts"
}
]
}
],
"types": [
{
"id": "ActionStepStringMatching",
"name": "ActionStepStringMatching",
"properties": [],
"path": "lib/src/insights-surveys-types.d.ts",
"example": "\"contains\" | \"exact\" | \"regex\""
},
{
"id": "ActionStepType",
"name": "ActionStepType",
"properties": [
{
"type": "string | null",
"name": "event"
},
{
"description": "ActionStepStringMatching.Exact",
"type": "ActionStepStringMatching | null",
"name": "href_matching"
},
{
"type": "string | null",
"name": "href"
},
{
"type": "string | null",
"name": "selector"
},
{
"description": "",
"type": "string",
"name": "tag_name"
},
{
"description": "StringMatching.Exact",
"type": "ActionStepStringMatching | null",
"name": "text_matching"
},
{
"type": "string | null",
"name": "text"
},
{
"description": "StringMatching.Contains",
"type": "ActionStepStringMatching | null",
"name": "url_matching"
},
{
"type": "string | null",
"name": "url"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "AutocaptureCompatibleElement",
"name": "AutocaptureCompatibleElement",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\""
},
{
"id": "AutocaptureConfig",
"name": "AutocaptureConfig",
"properties": [
{
"description": "When set to true, autocapture will capture the text of any element that is cut or copied.",
"type": "boolean",
"name": "capture_copied_text"
},
{
"description": "List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div div button svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist",
"type": "string[]",
"name": "css_selector_allowlist"
},
{
"description": "List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']",
"type": "DomAutocaptureEvents[]",
"name": "dom_event_allowlist"
},
{
"description": "List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target",
"type": "AutocaptureCompatibleElement[]",
"name": "element_allowlist"
},
{
"description": "Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]",
"type": "string[]",
"name": "element_attribute_ignorelist"
},
{
"description": "List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist",
"type": "(string | RegExp)[]",
"name": "url_allowlist"
},
{
"description": "List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist",
"type": "(string | RegExp)[]",
"name": "url_ignorelist"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "BasicSurveyQuestion",
"name": "BasicSurveyQuestion",
"properties": [
{
"type": "SurveyQuestionType.Open",
"name": "type"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "BeforeSendFn",
"name": "BeforeSendFn",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "(cr: CaptureResult | null) => CaptureResult | null"
},
{
"id": "BootstrapConfig",
"name": "BootstrapConfig",
"properties": [
{
"type": "string",
"name": "distinctID"
},
{
"type": "Record<string, JsonType>",
"name": "featureFlagPayloads"
},
{
"type": "Record<string, boolean | string>",
"name": "featureFlags"
},
{
"type": "boolean",
"name": "isIdentifiedID"
},
{
"description": "Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be the timestamp part + 24 hours *",
"type": "string",
"name": "sessionID"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "Breaker",
"name": "Breaker",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{}"
},
{
"id": "CapturedNetworkRequest",
"name": "CapturedNetworkRequest",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n method?: string;\n initiatorType?: InitiatorType;\n status?: number;\n timeOrigin?: number;\n timestamp?: number;\n startTime?: number;\n endTime?: number;\n requestHeaders?: Headers;\n requestBody?: string | null;\n responseHeaders?: Headers;\n responseBody?: string | null;\n isInitial?: boolean;\n}"
},
{
"id": "CaptureOptions",
"name": "CaptureOptions",
"properties": [
{
"description": "key of queue, e.g. 'sessionRecording' vs 'event'",
"type": "string",
"name": "_batchKey"
},
{
"description": "If set, overrides and disables config.properties_string_max_length",
"type": "boolean",
"name": "_noTruncate"
},
{
"description": "Used to override the desired endpoint for the captured event",
"type": "string",
"name": "_url"
},
{
"description": "Used when `$identify` is called Will set person properties but only once, it will NOT override previous values",
"type": "Properties",
"name": "$set_once"
},
{
"description": "Used when `$identify` is called Will set person properties overriding previous values",
"type": "Properties",
"name": "$set"
},
{
"description": "If set, skips the batched queue",
"type": "boolean",
"name": "send_instantly"
},
{
"description": "If set, skips the client side rate limiting",
"type": "boolean",
"name": "skip_client_rate_limiting"
},
{
"description": "If set, overrides the current timestamp",
"type": "Date",
"name": "timestamp"
},
{
"description": "If set, overrides the desired transport method",
"type": "RequestWithOptions['transport']",
"name": "transport"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "CaptureResult",
"name": "CaptureResult",
"properties": [
{
"type": "Properties",
"name": "$set_once"
},
{
"type": "Properties",
"name": "$set"
},
{
"type": "EventName",
"name": "event"
},
{
"type": "Properties",
"name": "properties"
},
{
"type": "Date",
"name": "timestamp"
},
{
"type": "string",
"name": "uuid"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "Compression",
"name": "Compression",
"properties": [
{
"type": "\"base64\"",
"name": "Base64"
},
{
"type": "\"gzip-js\"",
"name": "GZipJS"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "ConfigDefaults",
"name": "ConfigDefaults",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"2025-05-24\" | \"unset\""
},
{
"id": "DeadClickCandidate",
"name": "DeadClickCandidate",
"properties": [
{
"type": "number",
"name": "absoluteDelayMs"
},
{
"type": "number",
"name": "mutationDelayMs"
},
{
"type": "Element",
"name": "node"
},
{
"type": "MouseEvent",
"name": "originalEvent"
},
{
"type": "number",
"name": "scrollDelayMs"
},
{
"type": "number",
"name": "selectionChangedDelayMs"
},
{
"type": "number",
"name": "timestamp"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "DeadClicksAutoCaptureConfig",
"name": "DeadClicksAutoCaptureConfig",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n scroll_threshold_ms?: number;\n selection_change_threshold_ms?: number;\n mutation_threshold_ms?: number;\n __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>"
},
{
"id": "DisplaySurveyOptions",
"name": "DisplaySurveyOptions",
"properties": [],
"path": "lib/src/insights-surveys-types.d.ts",
"example": "DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions"
},
{
"id": "DisplaySurveyType",
"name": "DisplaySurveyType",
"properties": [
{
"type": "\"inline\"",
"name": "Inline"
},
{
"type": "\"popover\"",
"name": "Popover"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "DomAutocaptureEvents",
"name": "DomAutocaptureEvents",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"click\" | \"change\" | \"submit\""
},
{
"id": "EarlyAccessFeature",
"name": "EarlyAccessFeature",
"properties": [
{
"type": "string",
"name": "description"
},
{
"type": "string | null",
"name": "documentationUrl"
},
{
"type": "string | null",
"name": "flagKey"
},
{
"type": "string",
"name": "name"
},
{
"type": "'concept' | 'alpha' | 'beta'",
"name": "stage"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "EarlyAccessFeatureCallback",
"name": "EarlyAccessFeatureCallback",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "(earlyAccessFeatures: EarlyAccessFeature[]) => void"
},
{
"id": "EarlyAccessFeatureResponse",
"name": "EarlyAccessFeatureResponse",
"properties": [
{
"type": "EarlyAccessFeature[]",
"name": "earlyAccessFeatures"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "EarlyAccessFeatureStage",
"name": "EarlyAccessFeatureStage",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"concept\" | \"alpha\" | \"beta\" | \"general-availability\""
},
{
"id": "ErrorEventArgs",
"name": "ErrorEventArgs",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "[\n event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]"
},
{
"id": "ErrorTrackingOptions",
"name": "ErrorTrackingOptions",
"properties": [
{
"description": "UNSTABLE: determines whether exception caused by the Insights SDK will be captured\nfalse",
"type": "boolean",
"name": "__captureInsightsExceptions"
},
{
"description": "ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside insights support guidance. Accepts values between 0 and 100\n10",
"type": "number",
"name": "__exceptionRateLimiterBucketSize"
},
{
"description": "ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside insights support guidance. Accepts values between 0 and 100\n1",
"type": "number",
"name": "__exceptionRateLimiterRefillRate"
},
{
"description": "Decide whether exceptions thrown by browser extensions should be captured\nfalse",
"type": "boolean",
"name": "captureExtensionExceptions"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "ErrorTrackingSuppressionRule",
"name": "ErrorTrackingSuppressionRule",
"properties": [
{
"type": "'AND' | 'OR'",
"name": "type"
},
{
"type": "ErrorTrackingSuppressionRuleValue[]",
"name": "values"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "ErrorTrackingSuppressionRuleValue",
"name": "ErrorTrackingSuppressionRuleValue",
"properties": [
{
"type": "'$exception_types' | '$exception_values'",
"name": "key"
},
{
"type": "PropertyMatchType",
"name": "operator"
},
{
"type": "string",
"name": "type"
},
{
"type": "string | string[]",
"name": "value"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "EvaluationReason",
"name": "EvaluationReason",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n code: string;\n condition_index: number | undefined;\n description: string | undefined;\n}"
},
{
"id": "EventHandler",
"name": "EventHandler",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "(event: Event) => boolean | void"
},
{
"id": "EventName",
"name": "EventName",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"$pageview\" | \"$identify\" | \"custom_event\" | string"
},
{
"id": "ExceptionAutoCaptureConfig",
"name": "ExceptionAutoCaptureConfig",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n capture_unhandled_errors: boolean;\n capture_unhandled_rejections: boolean;\n capture_console_errors: boolean;\n}"
},
{
"id": "ExternalIntegrationKind",
"name": "ExternalIntegrationKind",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"intercom\" | \"crispChat\""
},
{
"id": "FeatureFlagDetail",
"name": "FeatureFlagDetail",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n key: string;\n enabled: boolean;\n original_enabled?: boolean | undefined;\n variant: string | undefined;\n original_variant?: string | undefined;\n reason: EvaluationReason | undefined;\n metadata: FeatureFlagMetadata | undefined;\n}"
},
{
"id": "FeatureFlagMetadata",
"name": "FeatureFlagMetadata",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n id: number;\n version: number | undefined;\n description: string | undefined;\n payload: JsonType | undefined;\n original_payload?: JsonType | undefined;\n}"
},
{
"id": "FeatureFlagsCallback",
"name": "FeatureFlagsCallback",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "(flags: string[], variants: Record<string, string | boolean>, context?: {\n errorsLoading?: boolean;\n}) => void"
},
{
"id": "FlagsResponse",
"name": "FlagsResponse",
"properties": [
{
"type": "boolean",
"name": "errorsWhileComputingFlags"
},
{
"type": "Record<string, JsonType>",
"name": "featureFlagPayloads"
},
{
"type": "Record<string, string | boolean>",
"name": "featureFlags"
},
{
"type": "Record<string, FeatureFlagDetail>",
"name": "flags"
},
{
"type": "string",
"name": "requestId"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "FlagVariant",
"name": "FlagVariant",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n flag: string;\n variant: string;\n}"
},
{
"id": "Headers_2",
"name": "Headers_2",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "Record<string, string>"
},
{
"id": "HeatmapConfig",
"name": "HeatmapConfig",
"properties": [
{
"description": "How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000",
"type": "number",
"name": "flush_interval_milliseconds"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "InitiatorType",
"name": "InitiatorType",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\""
},
{
"id": "JsonRecord",
"name": "JsonRecord",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n [key: string]: JsonType;\n}"
},
{
"id": "JsonType",
"name": "JsonType",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "string | number | boolean | null | undefined | JsonRecord | Array<JsonType>"
},
{
"id": "KnownEventName",
"name": "KnownEventName",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\""
},
{
"id": "LinkSurveyQuestion",
"name": "LinkSurveyQuestion",
"properties": [
{
"type": "string | null",
"name": "link"
},
{
"type": "SurveyQuestionType.Link",
"name": "type"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "MultipleSurveyQuestion",
"name": "MultipleSurveyQuestion",
"properties": [
{
"type": "string[]",
"name": "choices"
},
{
"type": "boolean",
"name": "hasOpenChoice"
},
{
"type": "boolean",
"name": "shuffleOptions"
},
{
"type": "boolean",
"name": "skipSubmitButton"
},
{
"type": "SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice",
"name": "type"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "NetworkRecordOptions",
"name": "NetworkRecordOptions",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n initiatorTypes?: InitiatorType[];\n maskRequestFn?: (data: CapturedNetworkRequest) => CapturedNetworkRequest | undefined;\n recordHeaders?: boolean | {\n request: boolean;\n response: boolean;\n };\n recordBody?: boolean | string[] | {\n request: boolean | string[];\n response: boolean | string[];\n };\n recordInitialRequests?: boolean;\n recordPerformance?: boolean;\n performanceEntryTypeToObserve: string[];\n payloadSizeLimitBytes: number;\n payloadHostDenyList?: string[];\n}"
},
{
"id": "NetworkRequest",
"name": "NetworkRequest",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n url: string;\n}"
},
{
"id": "OverrideConfig",
"name": "OverrideConfig",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n sampling: boolean;\n linked_flag: boolean;\n url_trigger: boolean;\n event_trigger: boolean;\n}"
},
{
"id": "PerformanceCaptureConfig",
"name": "PerformanceCaptureConfig",
"properties": [
{
"description": "We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)",
"type": "number",
"name": "__web_vitals_max_value"
},
{
"description": "Works with session replay to use the browser's native performance observer to capture performance metrics",
"type": "boolean",
"name": "network_timing"
},
{
"description": "By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']",
"type": "SupportedWebVitalsMetrics[]",
"name": "web_vitals_allowed_metrics"
},
{
"description": "We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000",
"type": "number",
"name": "web_vitals_delayed_flush_ms"
},
{
"description": "Use chrome's web vitals library to wrap fetch and capture web vitals",
"type": "boolean",
"name": "web_vitals"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "PersistentStore",
"name": "PersistentStore",
"properties": [
{
"type": "(error: any) => void",
"name": "_error"
},
{
"type": "(name: string) => any",
"name": "_get"
},
{
"type": "() => boolean",
"name": "_is_supported"
},
{
"type": "(name: string) => any",
"name": "_parse"
},
{
"type": "(name: string, cross_subdomain?: boolean) => void",
"name": "_remove"
},
{
"type": "(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void",
"name": "_set"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "InsightsConfig",
"name": "InsightsConfig",
"properties": [
{
"description": "PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject Insights tracing headers to all requests (X-INSIGHTS-DISTINCT-ID, X-INSIGHTS-SESSION-ID, X-INSIGHTS-WINDOW-ID)",
"type": "string[]",
"name": "__add_tracing_headers"
},
{
"description": "PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables collection of bot traffic as $bot_pageview events with detailed bot detection properties instead of dropping them entirely. Use it alongside opt_out_useragent_filter",
"type": "boolean",
"name": "__preview_capture_bot_pageviews"
},
{
"description": "Prevents @hanzo/insights from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events",
"type": "boolean",
"name": "__preview_disable_beacon"
},
{
"description": "Disables sending credentials when using XHR requests.",
"type": "boolean",
"name": "__preview_disable_xhr_credentials"
},
{
"description": "PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO INSIGHTS SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover",
"type": "boolean",
"name": "__preview_eager_load_replay"
},
{
"description": "PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint",
"type": "boolean",
"name": "__preview_flags_v2"
},
{
"description": "",
"type": "boolean",
"name": "__preview_lazy_load_replay"
},
{
"description": "PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true",
"type": "boolean",
"name": "__preview_remote_config"
},
{
"description": "",
"type": "(eventName: string, eventData: CaptureResult) => void",
"name": "_onCapture"
},
{
"description": "",
"type": "boolean",
"name": "advanced_disable_decide"
},
{
"description": "Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse",
"type": "boolean",
"name": "advanced_disable_feature_flags_on_first_load"
},
{
"description": "Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse",
"type": "boolean",
"name": "advanced_disable_feature_flags"
},
{
"description": "One of the very first things the Insights library does when init() is called is make a request to the /flags endpoint on Insights's backend. This endpoint contains information on how to run the Insights library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nWARNING: Disabling this will also prevent remote configuration from loading, which could mean features like web vitals, surveys, and other features configured in Insights settings are disabled unless explicitly enabled via client-side config. When setting this to true, make sure to explicitly configure any features you want to use (e.g., capture_performance, autocapture, etc.) in your SDK's init config.\nfalse",
"type": "boolean",
"name": "advanced_disable_flags"
},
{
"description": "Determines whether Insights should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse",
"type": "boolean",
"name": "advanced_disable_toolbar_metrics"
},
{
"description": "When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse",
"type": "boolean",
"name": "advanced_enable_surveys"
},
{
"description": "Determines whether Insights should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse",
"type": "boolean",
"name": "advanced_only_evaluate_survey_feature_flags"
},
{
"description": "URL of your Insights instance.\n'https://us.i.insights.hanzo.ai'",
"type": "string",
"name": "api_host"
},
{
"description": "",
"type": "string",
"name": "api_method"
},
{
"description": "The transport method to use for API requests.\n'fetch'",
"type": "'XHR' | 'fetch'",
"name": "api_transport"
},
{
"description": "Determines whether Insights should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent true",
"type": "boolean | AutocaptureConfig",
"name": "autocapture"
},
{
"description": "This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent",
"type": "BeforeSendFn | BeforeSendFn[]",
"name": "before_send"
},
{
"description": "An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing Insights and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing Insights to know the feature flag values immediately.\nAfter the SDK fetches feature flags from Insights, it will use those flag values instead of bootstrapped ones.",
"type": "BootstrapConfig",
"name": "bootstrap"
},
{
"description": "Determines whether to capture dead clicks.",
"type": "boolean | DeadClicksAutoCaptureConfig",
"name": "capture_dead_clicks"
},
{
"description": "Determines whether to capture exceptions.",
"type": "boolean | ExceptionAutoCaptureConfig",
"name": "capture_exceptions"
},
{
"description": "Determines whether to capture heatmaps.",
"type": "boolean | HeatmapConfig",
"name": "capture_heatmaps"
},
{
"description": "Determines whether Insights should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'",
"type": "boolean | 'if_capture_pageview'",
"name": "capture_pageleave"
},
{
"description": "Determines whether Insights should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue",
"type": "boolean | 'history_change'",
"name": "capture_pageview"
},
{
"description": "Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration.",
"type": "boolean | PerformanceCaptureConfig",
"name": "capture_performance"
},
{
"description": "Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull",
"type": "string | null",
"name": "consent_persistence_name"
},
{
"description": "Determines the number of days to store cookies for.\n365",
"type": "number",
"name": "cookie_expiration"
},
{
"description": "",
"type": "string",
"name": "cookie_name"
},
{
"description": "Enables cookieless mode. In this mode, Insights will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on Insights's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and Insights will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your Insights project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future.",
"type": "'always' | 'on_reject'",
"name": "cookieless_mode"
},
{
"description": "Determines if cookie should be set on the top level domain (example.com). If Insights-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`.",
"type": "boolean",
"name": "cross_subdomain_cookie"
},
{
"description": "Used to extend the list of user agents that are blocked by default.",
"type": "string[]",
"name": "custom_blocked_useragents"
},
{
"description": "Used to extend the list of campaign parameters that are saved by default.",
"type": "string[]",
"name": "custom_campaign_params"
},
{
"description": "Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]",
"type": "string[]",
"name": "custom_personal_data_properties"
},
{
"description": "Determines whether Insights should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__insights_debug=true` at the end of your URL You can also call `insights.debug()` in your code to enable debug mode\nfalse",
"type": "boolean",
"name": "debug"
},
{
"description": "Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'",
"type": "ConfigDefaults",
"name": "defaults"
},
{
"description": "Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse",
"type": "boolean",
"name": "disable_compression"
},
{
"description": "",
"type": "boolean",
"name": "disable_cookie"
},
{
"description": "Determines whether Insights should disable any external dependency loading. This will prevent Insights from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse",
"type": "boolean",
"name": "disable_external_dependency_loading"
},
{
"description": "Determines whether Insights should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse",
"type": "boolean",
"name": "disable_persistence"
},
{
"description": "Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse",
"type": "boolean",
"name": "disable_scroll_properties"
},
{
"description": "Determines whether Insights should disable session recording.\nfalse",
"type": "boolean",
"name": "disable_session_recording"
},
{
"description": "Determines whether Insights should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse",
"type": "boolean",
"name": "disable_surveys_automatic_display"
},
{
"description": "Determines whether Insights should disable all surveys functionality.\nfalse",
"type": "boolean",
"name": "disable_surveys"
},
{
"description": "Determines whether Insights should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue",
"type": "boolean",
"name": "disable_web_experiments"
},
{
"type": "boolean",
"name": "enable_heatmaps"
},
{
"description": "Determines whether Insights should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined",
"type": "boolean",
"name": "enable_recording_console_log"
},
{
"description": "Determines the error tracking options.",
"type": "ErrorTrackingOptions",
"name": "error_tracking"
},
{
"description": "Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined",
"type": "readonly string[]",
"name": "evaluation_environments"
},
{
"description": "Sets timeout for fetching feature flags\n3000",
"type": "number",
"name": "feature_flag_request_timeout_ms"
},
{
"description": "Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options",
"type": "{\n cache?: RequestInit['cache'];\n next_options?: NextOptions;\n }",
"name": "fetch_options"
},
{
"description": "Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID.",
"type": "(uuid: string) => string",
"name": "get_device_id"
},
{
"description": "",
"type": "boolean",
"name": "inapp_link_new_window"
},
{
"description": "",
"type": "string",
"name": "inapp_protocol"
},
{
"description": "Used to set-up external integrations with Insights data - such as session replays, distinct id, etc.",
"type": "Record<ExternalIntegrationKind, boolean>",
"name": "integrations"
},
{
"description": "",
"type": "boolean",
"name": "ip"
},
{
"description": "A function to be called once the Insights scripts have loaded successfully.",
"type": "(insights_instance: Insights) => void",
"name": "loaded"
},
{
"description": "Prevent autocapture from capturing any attribute names on elements.\nfalse",
"type": "boolean",
"name": "mask_all_element_attributes"
},
{
"description": "Prevent autocapture from capturing `textContent` on elements.\nfalse",
"type": "boolean",
"name": "mask_all_text"
},
{
"description": "Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`. false",
"type": "boolean",
"name": "mask_personal_data_properties"
},
{
"description": "The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Insights instances running at the same time.\n'insights'",
"type": "string",
"name": "name"
},
{
"description": "A function that is called when a request to the Insights API fails.",
"type": "(error: RequestResponse) => void",
"name": "on_request_error"
},
{
"description": "",
"type": "(failedRequest: XMLHttpRequest) => void",
"name": "on_xhr_error"
},
{
"description": "Determines if users should be opted in to site apps.\nfalse",
"type": "boolean",
"name": "opt_in_site_apps"
},
{
"description": "Determines if users should be opted out of Insights tracking by default, requiring additional logic to opt them into capturing by calling `insights.opt_in_capturing()`.\nfalse",
"type": "boolean",
"name": "opt_out_capturing_by_default"
},
{
"description": "",
"type": "string | null",
"name": "opt_out_capturing_cookie_prefix"
},
{
"description": "Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'",
"type": "'localStorage' | 'cookie'",
"name": "opt_out_capturing_persistence_type"
},
{
"description": "Determines if users should be opted out of browser data storage by this Insights instance by default, requiring additional logic to opt them into capturing by calling `insights.opt_in_capturing()`.\nfalse",
"type": "boolean",
"name": "opt_out_persistence_by_default"
},
{
"description": "Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, Insights will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse",
"type": "boolean",
"name": "opt_out_useragent_filter"
},
{
"description": "The name for the super properties persistent store\n''",
"type": "string",
"name": "persistence_name"
},
{
"description": "Determines how Insights stores information about the user. See [persistence](https://insights.hanzo.ai/docs/libraries/js#persistence) for details.\n'localStorage+cookie'",
"type": "'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'",
"name": "persistence"
},
{
"description": "You can control whether events from Insights-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `insights.identify`, `insights.alias`, `insights.setPersonProperties`, `insights.group`, `insights.setPersonPropertiesForFlags` or `insights.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'",
"type": "'always' | 'never' | 'identified_only'",
"name": "person_profiles"
},
{
"description": "A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example.",
"type": "(script: HTMLScriptElement) => HTMLScriptElement | null",
"name": "prepare_external_dependency_script"
},
{
"description": "A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example.",
"type": "(stylesheet: HTMLStyleElement) => HTMLStyleElement | null",
"name": "prepare_external_dependency_stylesheet"
},
{
"description": "",
"type": "'always' | 'never' | 'identified_only'",
"name": "process_person"
},
{
"description": "Determines the maximum length of the properties string that can be sent with capture calls.\n65535",
"type": "number",
"name": "properties_string_max_length"
},
{
"description": "",
"type": "string[]",
"name": "property_blacklist"
},
{
"description": "A list of properties that should never be sent with capture calls.\n[]",
"type": "string[]",
"name": "property_denylist"
},
{
"description": "Determines whether Insights should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent true",
"type": "boolean | RageclickConfig",
"name": "rageclick"
},
{
"description": "Client side rate limiting",
"type": "{\n events_per_second?: number;\n events_burst_limit?: number;\n }",
"name": "rate_limiting"
},
{
"description": "Determines whether Insights should batch requests to the Insights API.\ntrue",
"type": "boolean",
"name": "request_batching"
},
{
"description": "A list of headers that should be sent with requests to the Insights API.",
"type": "{\n [header_name: string]: string;\n }",
"name": "request_headers"
},
{
"description": "Used to change the behavior of the request queue. This is an advanced feature and should be used with caution.",
"type": "RequestQueueConfig",
"name": "request_queue_config"
},
{
"description": "Determines whether Insights should respect the Do Not Track header when computing consent in `ConsentManager`.",
"type": "boolean",
"name": "respect_dnt"
},
{
"description": "",
"type": "((properties: Properties, event_name: string) => Properties) | null",
"name": "sanitize_properties"
},
{
"description": "Determines whether Insights should save marketing parameters. These are `utm_*` paramaters and friends.",
"type": "boolean",
"name": "save_campaign_params"
},
{
"description": "Determines whether Insights should save referrer information.\ntrue",
"type": "boolean",
"name": "save_referrer"
},
{
"description": "Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified.",
"type": "string | string[]",
"name": "scroll_root_selector"
},
{
"description": "Determines whether Insights should use secure cookies. If this is `true`, Insights cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'",
"type": "boolean",
"name": "secure_cookie"
},
{
"description": "The segment analytics object.",
"type": "SegmentAnalytics",
"name": "segment"
},
{
"description": "Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes",
"type": "number",
"name": "session_idle_timeout_seconds"
},
{
"description": "Determines the session recording options.",
"type": "SessionRecordingOptions",
"name": "session_recording"
},
{
"description": "",
"type": "boolean",
"name": "store_google"
},
{
"description": "Sets timeout for fetching surveys\n10000",
"type": "number",
"name": "surveys_request_timeout_ms"
},
{
"description": "Survey-specific configuration options.\nundefined",
"type": "SurveyConfig",
"name": "surveys"
},
{
"description": "The token for your Insights project. It should NOT be provided manually in the config, but rather passed as the first parameter to `insights.init()`.",
"type": "string",
"name": "token"
},
{
"description": "If using a reverse proxy for `api_host` then this should be the actual Insights app URL (e.g. https://us.insights.hanzo.ai). This ensures that links to Insights point to the correct host.\nnull",
"type": "string | null",
"name": "ui_host"
},
{
"description": "Determines whether Insights should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse",
"type": "boolean",
"name": "upgrade"
},
{
"description": "",
"type": "boolean",
"name": "verbose"
},
{
"description": "",
"type": "{\n [header_name: string]: string;\n }",
"name": "xhr_headers"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "Properties",
"name": "Properties",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "// Properties is a Record<string, Property> \n// Below are Insights's default properties, you can add your own properties during capture\n{\n $timestamp: '2024-05-29T17:32:07.202Z',\n $os: 'Mac OS X',\n $os_version: '10.15.7',\n $browser: 'Chrome',\n $browser_version: '125',\n $device_type: 'Desktop',\n $current_url: 'https://example.com/page',\n $host: 'example.com',\n $pathname: '/page',\n $screen_height: 1080,\n $screen_width: 1920,\n $viewport_height: 950,\n $viewport_width: 1903,\n $lib: 'web',\n $lib_version: '1.31.0',\n $search_engine: 'google',\n $referrer: 'https://google.com',\n $referring_domain: 'www.google.com',\n $active_feature_flags: ['beta_feature'],\n $event_type: 'click',\n $utm_source: 'newsletter',\n $utm_medium: 'email',\n $utm_campaign: 'product_launch',\n $utm_term: 'new+product',\n $utm_content: 'logolink',\n $gclid: 'TeSter-123',\n $gad_source: 'google_ads',\n $gclsrc: 'dsa',\n $dclid: 'testDclid123',\n $wbraid: 'testWbraid123',\n $gbraid: 'testGbraid123',\n $fbclid: 'testFbclid123',\n $msclkid: 'testMsclkid123',\n $twclid: 'testTwclid123',\n $li_fat_id: 'testLiFatId123',\n $mc_cid: 'testMcCid123',\n $igshid: 'testIgshid123',\n $ttclid: 'testTtclid123',\n $plugins_succeeded: ['GeoIP (56578)'],\n $plugins_failed: ['plugin3'],\n $plugins_deferred: ['plugin4'],\n $ip: '192.168.1.1'\n}"
},
{
"id": "Property",
"name": "Property",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "// It can be a string\n\"[email protected]\"\n// It can be an object like field\n{\n firstName: 'Max',\n lastName: 'Hog',\n isAdmin: true,\n}\n"
},
{
"id": "PropertyMatchType",
"name": "PropertyMatchType",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\""
},
{
"id": "QueuedRequestWithOptions",
"name": "QueuedRequestWithOptions",
"properties": [
{
"description": "key of queue, e.g. 'sessionRecording' vs 'event'",
"type": "string",
"name": "batchKey"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "RageclickConfig",
"name": "RageclickConfig",
"properties": [
{
"description": "List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div div button svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture",
"type": "string[]",
"name": "css_selector_ignorelist"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "RatingSurveyQuestion",
"name": "RatingSurveyQuestion",
"properties": [
{
"type": "'number' | 'emoji'",
"name": "display"
},
{
"type": "string",
"name": "lowerBoundLabel"
},
{
"type": "3 | 5 | 7 | 10",
"name": "scale"
},
{
"type": "boolean",
"name": "skipSubmitButton"
},
{
"type": "SurveyQuestionType.Rating",
"name": "type"
},
{
"type": "string",
"name": "upperBoundLabel"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "RemoteConfig",
"name": "RemoteConfig",
"properties": [
{
"description": "Whether we should use a custom endpoint for analytics\nendpoint: \"/e\"",
"type": "{\n endpoint?: string;\n }",
"name": "analytics"
},
{
"description": "If set, disables autocapture",
"type": "boolean",
"name": "autocapture_opt_out"
},
{
"description": "This is currently in development and may have breaking changes without a major version bump",
"type": "boolean | {\n endpoint?: string;\n }",
"name": "autocaptureExceptions"
},
{
"description": "Whether to capture dead clicks",
"type": "boolean",
"name": "captureDeadClicks"
},
{
"description": "originally capturePerformance was replay only and so boolean true is equivalent to network_timing: true now capture performance can be separately enabled within replay and as a standalone web vitals tracker people can have them enabled separately they work standalone but enhance each other TODO: deprecate this so we make a new config that doesn't need this explanation",
"type": "boolean | PerformanceCaptureConfig",
"name": "capturePerformance"
},
{
"description": "Whether to only capture identified users by default",
"type": "boolean",
"name": "defaultIdentifiedOnly"
},
{
"description": "",
"type": "ToolbarParams",
"name": "editorParams"
},
{
"description": "Whether the `$elements_chain` property should be sent as a string or as an array\nfalse",
"type": "boolean",
"name": "elementsChainAsString"
},
{
"description": "Error tracking configuration options",
"type": "{\n autocaptureExceptions?: boolean;\n captureExtensionExceptions?: boolean;\n suppressionRules?: ErrorTrackingSuppressionRule[];\n }",
"name": "errorTracking"
},
{
"description": "Indicates if the team has any flags enabled (if not we don't need to load them)",
"type": "boolean",
"name": "hasFeatureFlags"
},
{
"description": "Whether heatmaps are enabled",
"type": "boolean",
"name": "heatmaps"
},
{
"description": "Whether the user is authenticated",
"type": "boolean",
"name": "isAuthenticated"
},
{
"description": "Session recording configuration options",
"type": "SessionRecordingRemoteConfig | false",
"name": "sessionRecording"
},
{
"description": "List of site apps with their IDs and URLs",
"type": "{\n id: string;\n url: string;\n }[]",
"name": "siteApps"
},
{
"description": "Supported compression algorithms",
"type": "Compression[]",
"name": "supportedCompression"
},
{
"description": "Whether surveys are enabled",
"type": "boolean | Survey[]",
"name": "surveys"
},
{
"description": "Parameters for the toolbar",
"type": "ToolbarParams",
"name": "toolbarParams"
},
{
"description": "deprecated, moved to toolbarParams",
"type": "'toolbar'",
"name": "toolbarVersion"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "RemoteConfigFeatureFlagCallback",
"name": "RemoteConfigFeatureFlagCallback",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "(payload: JsonType) => void"
},
{
"id": "RequestCallback",
"name": "RequestCallback",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "(response: RequestResponse) => void"
},
{
"id": "RequestQueueConfig",
"name": "RequestQueueConfig",
"properties": [
{
"description": "ADVANCED - alters the frequency which Insights sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000",
"type": "number",
"name": "flush_interval_ms"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "RequestResponse",
"name": "RequestResponse",
"properties": [
{
"type": "any",
"name": "json"
},
{
"type": "number",
"name": "statusCode"
},
{
"type": "string",
"name": "text"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "RequestWithOptions",
"name": "RequestWithOptions",
"properties": [
{
"type": "RequestCallback",
"name": "callback"
},
{
"type": "Compression | 'best-available'",
"name": "compression"
},
{
"type": "Record<string, any> | Record<string, any>[]",
"name": "data"
},
{
"type": "('XHR' | 'fetch' | 'sendBeacon')[]",
"name": "disableTransport"
},
{
"type": "boolean",
"name": "disableXHRCredentials"
},
{
"type": "{\n cache?: RequestInit['cache'];\n next?: NextOptions;\n }",
"name": "fetchOptions"
},
{
"type": "Record<string, any>",
"name": "headers"
},
{
"type": "'POST' | 'GET'",
"name": "method"
},
{
"type": "boolean",
"name": "noRetries"
},
{
"type": "number",
"name": "timeout"
},
{
"type": "'XHR' | 'fetch' | 'sendBeacon'",
"name": "transport"
},
{
"type": "string",
"name": "url"
},
{
"type": "{\n compression: Compression;\n }",
"name": "urlQueryArgs"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "RetriableRequestWithOptions",
"name": "RetriableRequestWithOptions",
"properties": [
{
"type": "number",
"name": "retriesPerformedSoFar"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "SessionIdChangedCallback",
"name": "SessionIdChangedCallback",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "(sessionId: string, windowId: string | null | undefined, changeReason?: {\n noSessionId: boolean;\n activityTimeout: boolean;\n sessionPastMaximumLength: boolean;\n}) => void"
},
{
"id": "SessionRecordingCanvasOptions",
"name": "SessionRecordingCanvasOptions",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n recordCanvas?: boolean | null;\n canvasFps?: number | null;\n canvasQuality?: string | null;\n}"
},
{
"id": "SessionRecordingOptions",
"name": "SessionRecordingOptions",
"properties": [
{
"description": "ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside insights support guidance. Accepts values between 0 and 100\n100",
"type": "number",
"name": "__mutationThrottlerBucketSize"
},
{
"description": "ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside insights support guidance. Accepts values between 0 and 100\n10",
"type": "number",
"name": "__mutationThrottlerRefillRate"
},
{
"description": "Derived from `rrweb.record` options",
"type": "string | RegExp",
"name": "blockClass"
},
{
"description": "Derived from `rrweb.record` options",
"type": "string | null",
"name": "blockSelector"
},
{
"description": "Allows local config to override remote canvas recording settings from the flags response",
"type": "SessionRecordingCanvasOptions",
"name": "captureCanvas"
},
{
"description": "Derived from `rrweb.record` options",
"type": "boolean",
"name": "collectFonts"
},
{
"description": "ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue",
"type": "boolean",
"name": "compress_events"
},
{
"description": "ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)",
"type": "number",
"name": "full_snapshot_interval_millis"
},
{
"description": "Derived from `rrweb.record` options",
"type": "string | RegExp",
"name": "ignoreClass"
},
{
"description": "Derived from `rrweb.record` options",
"type": "boolean",
"name": "inlineStylesheet"
},
{
"description": "Derived from `rrweb.record` options",
"type": "boolean",
"name": "maskAllInputs"
},
{
"description": "Modify the network request before it is captured. Returning null or undefined stops it being captured",
"type": "((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null",
"name": "maskCapturedNetworkRequestFn"
},
{
"description": "Derived from `rrweb.record` options",
"type": "((text: string, element?: HTMLElement) => string) | null",
"name": "maskInputFn"
},
{
"description": "Derived from `rrweb.record` options",
"type": "recordOptions['maskInputOptions']",
"name": "maskInputOptions"
},
{
"description": "",
"type": "((data: NetworkRequest) => NetworkRequest | null | undefined) | null",
"name": "maskNetworkRequestFn"
},
{
"description": "Derived from `rrweb.record` options",
"type": "string | RegExp",
"name": "maskTextClass"
},
{
"description": "Derived from `rrweb.record` options",
"type": "((text: string, element?: HTMLElement) => string) | null",
"name": "maskTextFn"
},
{
"description": "Derived from `rrweb.record` options",
"type": "string | null",
"name": "maskTextSelector"
},
{
"description": "Derived from `rrweb.record` options",
"type": "boolean",
"name": "recordBody"
},
{
"description": "Derived from `rrweb.record` options",
"type": "boolean",
"name": "recordCrossOriginIframes"
},
{
"description": "Derived from `rrweb.record` options",
"type": "boolean",
"name": "recordHeaders"
},
{
"description": "ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)",
"type": "number",
"name": "session_idle_threshold_ms"
},
{
"description": "Derived from `rrweb.record` options",
"type": "recordOptions['slimDOMOptions']",
"name": "slimDOMOptions"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "SessionRecordingPersistedConfig",
"name": "SessionRecordingPersistedConfig",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "Omit<SessionRecordingRemoteConfig, 'recordCanvas' | 'canvasFps' | 'canvasQuality' | 'networkPayloadCapture' | 'sampleRate' | 'minimumDurationMilliseconds'> & {\n enabled: boolean;\n networkPayloadCapture: SessionRecordingRemoteConfig['networkPayloadCapture'] & {\n capturePerformance: RemoteConfig['capturePerformance'];\n };\n canvasRecording: {\n enabled: SessionRecordingRemoteConfig['recordCanvas'];\n fps: SessionRecordingRemoteConfig['canvasFps'];\n quality: SessionRecordingRemoteConfig['canvasQuality'];\n };\n sampleRate: number | null;\n minimumDurationMilliseconds: number | null | undefined;\n}"
},
{
"id": "SessionRecordingRemoteConfig",
"name": "SessionRecordingRemoteConfig",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "SessionRecordingCanvasOptions & {\n endpoint?: string;\n consoleLogRecordingEnabled?: boolean;\n sampleRate?: string | null;\n minimumDurationMilliseconds?: number;\n linkedFlag?: string | FlagVariant | null;\n networkPayloadCapture?: Pick<NetworkRecordOptions, 'recordBody' | 'recordHeaders'>;\n masking?: Pick<SessionRecordingOptions, 'maskAllInputs' | 'maskTextSelector' | 'blockSelector'>;\n urlTriggers?: SessionRecordingUrlTrigger[];\n scriptConfig?: {\n script?: string | undefined;\n };\n urlBlocklist?: SessionRecordingUrlTrigger[];\n eventTriggers?: string[];\n triggerMatchType?: 'any' | 'all';\n}"
},
{
"id": "SessionRecordingUrlTrigger",
"name": "SessionRecordingUrlTrigger",
"properties": [
{
"type": "'regex'",
"name": "matching"
},
{
"type": "string",
"name": "url"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "SessionStartReason",
"name": "SessionStartReason",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"sampling_overridden\" | \"recording_initialized\" | \"linked_flag_matched\" | \"linked_flag_overridden\" | \"session_id_changed\" | \"url_trigger_matched\" | \"event_trigger_matched\""
},
{
"id": "SeverityLevel",
"name": "SeverityLevel",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "(typeof severityLevels)[number]"
},
{
"id": "SiteApp",
"name": "SiteApp",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n id: string;\n loaded: boolean;\n errored: boolean;\n processedBuffer: boolean;\n processEvent?: (globals: SiteAppGlobals) => void;\n}"
},
{
"id": "SiteAppGlobals",
"name": "SiteAppGlobals",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n event: {\n uuid: string;\n event: EventName;\n properties: Properties;\n timestamp?: Date;\n elements_chain?: string;\n distinct_id?: string;\n };\n person: {\n properties: Properties;\n };\n groups: Record<string, {\n id: string;\n type: string;\n properties: Properties;\n }>;\n}"
},
{
"id": "SiteAppLoader",
"name": "SiteAppLoader",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "{\n id: string;\n init: (config: {\n insights: Insights;\n callback: (success: boolean) => void;\n }) => {\n processEvent?: (globals: SiteAppGlobals) => void;\n };\n}"
},
{
"id": "SnippetArrayItem",
"name": "SnippetArrayItem",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "[method: string, ...args: any[]]"
},
{
"id": "SupportedWebVitalsMetrics",
"name": "SupportedWebVitalsMetrics",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"LCP\" | \"CLS\" | \"FCP\" | \"INP\""
},
{
"id": "Survey",
"name": "Survey",
"properties": [
{
"type": "SurveyAppearance | null",
"name": "appearance"
},
{
"type": "{\n url?: string;\n selector?: string;\n seenSurveyWaitPeriodInDays?: number;\n urlMatchType?: PropertyMatchType;\n events: {\n repeatedActivation?: boolean;\n values: {\n name: string;\n propertyFilters?: {\n [propertyName: string]: {\n values: string[];\n operator: PropertyMatchType;\n };\n };\n }[];\n } | null;\n actions: {\n values: SurveyActionType[];\n } | null;\n deviceTypes?: string[];\n deviceTypesMatchType?: PropertyMatchType;\n linkedFlagVariant?: string;\n } | null",
"name": "conditions"
},
{
"type": "string | null",
"name": "current_iteration_start_date"
},
{
"type": "number | null",
"name": "current_iteration"
},
{
"type": "string",
"name": "description"
},
{
"type": "boolean | null",
"name": "enable_partial_responses"
},
{
"type": "string | null",
"name": "end_date"
},
{
"type": "{\n key: string;\n value?: string;\n }[] | null",
"name": "feature_flag_keys"
},
{
"type": "string",
"name": "id"
},
{
"type": "string | null",
"name": "internal_targeting_flag_key"
},
{
"type": "string | null",
"name": "linked_flag_key"
},
{
"type": "string",
"name": "name"
},
{
"type": "SurveyQuestion[]",
"name": "questions"
},
{
"type": "SurveySchedule | null",
"name": "schedule"
},
{
"type": "string | null",
"name": "start_date"
},
{
"type": "string | null",
"name": "targeting_flag_key"
},
{
"type": "SurveyType",
"name": "type"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyActionType",
"name": "SurveyActionType",
"properties": [
{
"type": "number",
"name": "id"
},
{
"type": "string | null",
"name": "name"
},
{
"type": "ActionStepType[]",
"name": "steps"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyAppearance",
"name": "SurveyAppearance",
"properties": [
{
"type": "boolean",
"name": "autoDisappear"
},
{
"type": "string",
"name": "backgroundColor"
},
{
"type": "string",
"name": "borderColor"
},
{
"type": "string",
"name": "boxPadding"
},
{
"type": "string",
"name": "descriptionTextColor"
},
{
"type": "string",
"name": "disabledButtonOpacity"
},
{
"type": "boolean",
"name": "displayThankYouMessage"
},
{
"type": "string",
"name": "fontFamily"
},
{
"type": "string",
"name": "maxWidth"
},
{
"type": "string",
"name": "placeholder"
},
{
"type": "SurveyPosition",
"name": "position"
},
{
"type": "string",
"name": "ratingButtonActiveColor"
},
{
"type": "string",
"name": "ratingButtonColor"
},
{
"type": "string",
"name": "ratingButtonHoverColor"
},
{
"type": "boolean",
"name": "shuffleQuestions"
},
{
"type": "string",
"name": "submitButtonColor"
},
{
"type": "string",
"name": "submitButtonText"
},
{
"type": "string",
"name": "submitButtonTextColor"
},
{
"type": "number",
"name": "surveyPopupDelaySeconds"
},
{
"type": "string",
"name": "textColor"
},
{
"type": "string",
"name": "thankYouMessageCloseButtonText"
},
{
"type": "string",
"name": "thankYouMessageDescription"
},
{
"type": "SurveyQuestionDescriptionContentType",
"name": "thankYouMessageDescriptionContentType"
},
{
"type": "string",
"name": "thankYouMessageHeader"
},
{
"type": "boolean",
"name": "whiteLabel"
},
{
"type": "string",
"name": "widgetColor"
},
{
"type": "string",
"name": "widgetLabel"
},
{
"type": "string",
"name": "widgetSelector"
},
{
"type": "SurveyWidgetType",
"name": "widgetType"
},
{
"type": "string",
"name": "zIndex"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyCallback",
"name": "SurveyCallback",
"properties": [],
"path": "lib/src/insights-surveys-types.d.ts",
"example": "(surveys: Survey[], context?: {\n isLoaded: boolean;\n error?: string;\n}) => void"
},
{
"id": "SurveyConfig",
"name": "SurveyConfig",
"properties": [
{
"type": "number",
"name": "autoSubmitDelay"
},
{
"type": "boolean",
"name": "autoSubmitIfComplete"
},
{
"type": "boolean",
"name": "prefillFromUrl"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyElement",
"name": "SurveyElement",
"properties": [
{
"type": "string",
"name": "$el_text"
},
{
"type": "string[]",
"name": "attr_class"
},
{
"type": "string",
"name": "attr_id"
},
{
"type": "Record<string, any>",
"name": "attributes"
},
{
"type": "number",
"name": "event_id"
},
{
"type": "number",
"name": "group_id"
},
{
"type": "string",
"name": "href"
},
{
"type": "number",
"name": "nth_child"
},
{
"type": "number",
"name": "nth_of_type"
},
{
"type": "number",
"name": "order"
},
{
"type": "string",
"name": "tag_name"
},
{
"type": "string",
"name": "text"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyEventName",
"name": "SurveyEventName",
"properties": [
{
"type": "\"survey dismissed\"",
"name": "DISMISSED"
},
{
"type": "\"survey sent\"",
"name": "SENT"
},
{
"type": "\"survey shown\"",
"name": "SHOWN"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyEventProperties",
"name": "SurveyEventProperties",
"properties": [
{
"type": "\"$survey_completed\"",
"name": "SURVEY_COMPLETED"
},
{
"type": "\"$survey_id\"",
"name": "SURVEY_ID"
},
{
"type": "\"$survey_iteration\"",
"name": "SURVEY_ITERATION"
},
{
"type": "\"$survey_iteration_start_date\"",
"name": "SURVEY_ITERATION_START_DATE"
},
{
"type": "\"$survey_name\"",
"name": "SURVEY_NAME"
},
{
"type": "\"$survey_partially_completed\"",
"name": "SURVEY_PARTIALLY_COMPLETED"
},
{
"type": "\"$survey_questions\"",
"name": "SURVEY_QUESTIONS"
},
{
"type": "\"$survey_response\"",
"name": "SURVEY_RESPONSE"
},
{
"type": "\"$survey_submission_id\"",
"name": "SURVEY_SUBMISSION_ID"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyPosition",
"name": "SurveyPosition",
"properties": [
{
"type": "\"center\"",
"name": "Center"
},
{
"type": "\"left\"",
"name": "Left"
},
{
"type": "\"middle_center\"",
"name": "MiddleCenter"
},
{
"type": "\"middle_left\"",
"name": "MiddleLeft"
},
{
"type": "\"middle_right\"",
"name": "MiddleRight"
},
{
"type": "\"next_to_trigger\"",
"name": "NextToTrigger"
},
{
"type": "\"right\"",
"name": "Right"
},
{
"type": "\"top_center\"",
"name": "TopCenter"
},
{
"type": "\"top_left\"",
"name": "TopLeft"
},
{
"type": "\"top_right\"",
"name": "TopRight"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyQuestion",
"name": "SurveyQuestion",
"properties": [],
"path": "lib/src/insights-surveys-types.d.ts",
"example": "BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion"
},
{
"id": "SurveyQuestionBranchingType",
"name": "SurveyQuestionBranchingType",
"properties": [
{
"type": "\"end\"",
"name": "End"
},
{
"type": "\"next_question\"",
"name": "NextQuestion"
},
{
"type": "\"response_based\"",
"name": "ResponseBased"
},
{
"type": "\"specific_question\"",
"name": "SpecificQuestion"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyQuestionDescriptionContentType",
"name": "SurveyQuestionDescriptionContentType",
"properties": [],
"path": "lib/src/insights-surveys-types.d.ts",
"example": "\"html\" | \"text\""
},
{
"id": "SurveyQuestionType",
"name": "SurveyQuestionType",
"properties": [
{
"type": "\"link\"",
"name": "Link"
},
{
"type": "\"multiple_choice\"",
"name": "MultipleChoice"
},
{
"type": "\"open\"",
"name": "Open"
},
{
"type": "\"rating\"",
"name": "Rating"
},
{
"type": "\"single_choice\"",
"name": "SingleChoice"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyRenderReason",
"name": "SurveyRenderReason",
"properties": [
{
"type": "string",
"name": "disabledReason"
},
{
"type": "boolean",
"name": "visible"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveySchedule",
"name": "SurveySchedule",
"properties": [
{
"type": "\"always\"",
"name": "Always"
},
{
"type": "\"once\"",
"name": "Once"
},
{
"type": "\"recurring\"",
"name": "Recurring"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyType",
"name": "SurveyType",
"properties": [
{
"type": "\"api\"",
"name": "API"
},
{
"type": "\"external_survey\"",
"name": "ExternalSurvey"
},
{
"type": "\"popover\"",
"name": "Popover"
},
{
"type": "\"widget\"",
"name": "Widget"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyWidgetType",
"name": "SurveyWidgetType",
"properties": [
{
"type": "\"button\"",
"name": "Button"
},
{
"type": "\"selector\"",
"name": "Selector"
},
{
"type": "\"tab\"",
"name": "Tab"
}
],
"path": "lib/src/insights-surveys-types.d.ts"
},
{
"id": "SurveyWithTypeAndAppearance",
"name": "SurveyWithTypeAndAppearance",
"properties": [],
"path": "lib/src/insights-surveys-types.d.ts",
"example": "\"id\" | \"type\" | \"appearance\""
},
{
"id": "ToolbarParams",
"name": "ToolbarParams",
"properties": [
{
"type": "number",
"name": "actionId"
},
{
"type": "string[]",
"name": "dataAttributes"
},
{
"type": "string",
"name": "distinctId"
},
{
"type": "Record<string, string | boolean>",
"name": "featureFlags"
},
{
"type": "boolean",
"name": "instrument"
},
{
"type": "ToolbarSource",
"name": "source"
},
{
"type": "string",
"name": "temporaryToken"
},
{
"type": "string",
"name": "token"
},
{
"type": "ToolbarVersion",
"name": "toolbarVersion"
},
{
"type": "string",
"name": "userEmail"
},
{
"type": "ToolbarUserIntent",
"name": "userIntent"
}
],
"path": "lib/src/types.d.ts"
},
{
"id": "ToolbarSource",
"name": "ToolbarSource",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"url\" | \"localstorage\""
},
{
"id": "ToolbarUserIntent",
"name": "ToolbarUserIntent",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"add-action\" | \"edit-action\""
},
{
"id": "ToolbarVersion",
"name": "ToolbarVersion",
"properties": [],
"path": "lib/src/types.d.ts",
"example": "\"toolbar\""
}
],
"categories": [
"Initialization",
"Identification",
"Capture",
"Surveys",
"Error tracking",
"LLM analytics",
"Privacy",
"Session replay",
"Feature flags",
"Toolbar"
]
}