mirror of
https://github.com/hanzoai/insights-js.git
synced 2026-11-03 00:53:53 +00:00
4037 lines
138 KiB
JSON
4037 lines
138 KiB
JSON
{
|
|
"id": "@hanzo/insights",
|
|
"hogRef": "0.3",
|
|
"info": {
|
|
"version": "1.334.1",
|
|
"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": "Cancels a pending survey that is waiting to be displayed (e.g., due to a popup delay).",
|
|
"details": null,
|
|
"id": "cancelPendingSurvey",
|
|
"showDocs": true,
|
|
"title": "cancelPendingSurvey",
|
|
"examples": [
|
|
{
|
|
"id": "cancelpendingsurvey",
|
|
"name": "Generated example for cancelPendingSurvey",
|
|
"code": "// Generated example for cancelPendingSurvey\ninsights.cancelPendingSurvey();"
|
|
}
|
|
],
|
|
"releaseTag": "public",
|
|
"params": [
|
|
{
|
|
"description": "",
|
|
"isOptional": false,
|
|
"type": "string",
|
|
"name": "surveyId"
|
|
}
|
|
],
|
|
"returnType": {
|
|
"id": "void",
|
|
"name": "void"
|
|
},
|
|
"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\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\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\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": "Error tracking",
|
|
"description": "turns exception autocapture on, and updates the config option `capture_exceptions` to the provided config (or `true`)",
|
|
"details": null,
|
|
"id": "startExceptionAutocapture",
|
|
"showDocs": true,
|
|
"title": "startExceptionAutocapture",
|
|
"examples": [
|
|
{
|
|
"id": "start_with_default_exception_autocapture_rules._no-op_if_already_enabled",
|
|
"name": "Start with default exception autocapture rules. No-op if already enabled",
|
|
"code": "\n\n// Start with default exception autocapture rules. No-op if already enabled\ninsights.startExceptionAutocapture()\n\n\n"
|
|
},
|
|
{
|
|
"id": "start_and_override_controls",
|
|
"name": "Start and override controls",
|
|
"code": "\n\n// Start and override controls\ninsights.startExceptionAutocapture({\n // you don't have to send all of these (unincluded values will use the default)\n capture_unhandled_errors: true || false,\n capture_unhandled_rejections: true || false,\n capture_console_errors: true || false\n})\n\n\n\n"
|
|
}
|
|
],
|
|
"releaseTag": "public",
|
|
"params": [
|
|
{
|
|
"description": "optional configuration option to control the exception autocapture behavior",
|
|
"isOptional": true,
|
|
"type": "ExceptionAutoCaptureConfig",
|
|
"name": "config"
|
|
}
|
|
],
|
|
"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": "Error tracking",
|
|
"description": "turns exception autocapture off by updating the config option `capture_exceptions` to `false`",
|
|
"details": null,
|
|
"id": "stopExceptionAutocapture",
|
|
"showDocs": true,
|
|
"title": "stopExceptionAutocapture",
|
|
"examples": [
|
|
{
|
|
"id": "stop_capturing_exceptions_automatically",
|
|
"name": "Stop capturing exceptions automatically",
|
|
"code": "\n\n// Stop capturing exceptions automatically\ninsights.stopExceptionAutocapture()\n\n\n\n"
|
|
}
|
|
],
|
|
"releaseTag": "public",
|
|
"params": [],
|
|
"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"
|
|
},
|
|
{
|
|
"category": "Feature flags",
|
|
"description": "Manually update feature flag values without making a network request.\nThis is useful when you have feature flag values from an external source (e.g., server-side evaluation, edge middleware) and want to inject them into the client SDK.",
|
|
"details": null,
|
|
"id": "updateFlags",
|
|
"showDocs": true,
|
|
"title": "updateFlags",
|
|
"examples": [
|
|
{
|
|
"id": "replace_all_flags_with_server-evaluated_values",
|
|
"name": "Replace all flags with server-evaluated values",
|
|
"code": "\n\n// Replace all flags with server-evaluated values\ninsights.updateFlags({\n 'my-flag': true,\n 'my-experiment': 'variant-a'\n})\n\n// Merge with existing flags (update only specified flags)\ninsights.updateFlags(\n { 'my-flag': true },\n undefined,\n { merge: true }\n)\n\n// With payloads\ninsights.updateFlags(\n { 'my-flag': true },\n { 'my-flag': { some: 'data' } }\n)\n\n\n\n"
|
|
}
|
|
],
|
|
"releaseTag": "public",
|
|
"params": [
|
|
{
|
|
"description": "An object mapping flag keys to their values (boolean or string variant)",
|
|
"isOptional": false,
|
|
"type": "Record<string, boolean | string>",
|
|
"name": "flags"
|
|
},
|
|
{
|
|
"description": "Optional object mapping flag keys to their JSON payloads",
|
|
"isOptional": true,
|
|
"type": "Record<string, JsonType>",
|
|
"name": "payloads"
|
|
},
|
|
{
|
|
"description": "Optional settings. Use `{ merge: true }` to merge with existing flags instead of replacing.",
|
|
"isOptional": true,
|
|
"type": "{\n merge?: boolean;\n }",
|
|
"name": "options"
|
|
}
|
|
],
|
|
"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"
|
|
},
|
|
{
|
|
"description": "Property filters for action step matching",
|
|
"type": "{\n key: string;\n value?: string | number | boolean | (string | number | boolean)[] | null;\n operator?: PropertyMatchType;\n type?: string;\n }[]",
|
|
"name": "properties"
|
|
},
|
|
{
|
|
"description": "pre-compiled regex pattern for matching selector against $elements_chain",
|
|
"type": "string | null",
|
|
"name": "selector_regex"
|
|
},
|
|
{
|
|
"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": "BasicSurveyQuestion",
|
|
"name": "BasicSurveyQuestion",
|
|
"properties": [
|
|
{
|
|
"type": "SurveyQuestionType.Open",
|
|
"name": "type"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-surveys-types.d.ts"
|
|
},
|
|
{
|
|
"id": "Breaker",
|
|
"name": "Breaker",
|
|
"properties": [],
|
|
"path": "lib/src/types.d.ts",
|
|
"example": "{}"
|
|
},
|
|
{
|
|
"id": "Compression",
|
|
"name": "Compression",
|
|
"properties": [
|
|
{
|
|
"type": "\"base64\"",
|
|
"name": "Base64"
|
|
},
|
|
{
|
|
"type": "\"gzip-js\"",
|
|
"name": "GZipJS"
|
|
}
|
|
],
|
|
"path": "lib/src/types.d.ts"
|
|
},
|
|
{
|
|
"id": "ConversationsRemoteConfig",
|
|
"name": "ConversationsRemoteConfig",
|
|
"properties": [
|
|
{
|
|
"description": "Whether to show the name field in the identification form true (when requireEmail is true)",
|
|
"type": "boolean",
|
|
"name": "collectName"
|
|
},
|
|
{
|
|
"description": "Primary color for the widget UI",
|
|
"type": "string",
|
|
"name": "color"
|
|
},
|
|
{
|
|
"description": "List of allowed domains where the widget should be shown. Supports wildcards like \"https://*.example.com\" Empty array or not present means show on all domains.",
|
|
"type": "string[]",
|
|
"name": "domains"
|
|
},
|
|
{
|
|
"description": "Whether conversations are enabled for this team When true, the conversations API is available (insights.conversations.*)",
|
|
"type": "boolean",
|
|
"name": "enabled"
|
|
},
|
|
{
|
|
"description": "Greeting text to show when widget is first opened",
|
|
"type": "string",
|
|
"name": "greetingText"
|
|
},
|
|
{
|
|
"description": "Description for the identification form \"Please provide your details so we can help you better.\"",
|
|
"type": "string",
|
|
"name": "identificationFormDescription"
|
|
},
|
|
{
|
|
"description": "Title for the identification form \"Before we start...\"",
|
|
"type": "string",
|
|
"name": "identificationFormTitle"
|
|
},
|
|
{
|
|
"description": "Placeholder text for the message input",
|
|
"type": "string",
|
|
"name": "placeholderText"
|
|
},
|
|
{
|
|
"description": "Whether to require email before starting a conversation false",
|
|
"type": "boolean",
|
|
"name": "requireEmail"
|
|
},
|
|
{
|
|
"description": "Public token for authenticating conversations API requests This token is team-scoped and meant to be embedded in client code",
|
|
"type": "string",
|
|
"name": "token"
|
|
},
|
|
{
|
|
"description": "Whether the widget UI (button + chat panel) should be shown Only takes effect when enabled is true false",
|
|
"type": "boolean",
|
|
"name": "widgetEnabled"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ConversationsTraits",
|
|
"name": "ConversationsTraits",
|
|
"properties": [
|
|
{
|
|
"type": "string | null",
|
|
"name": "email"
|
|
},
|
|
{
|
|
"type": "string | null",
|
|
"name": "name"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ConversationsWidgetState",
|
|
"name": "ConversationsWidgetState",
|
|
"properties": [],
|
|
"path": "lib/src/insights-conversations-types.d.ts",
|
|
"example": "\"open\" | \"closed\""
|
|
},
|
|
{
|
|
"id": "DisplaySurveyOptions",
|
|
"name": "DisplaySurveyOptions",
|
|
"properties": [],
|
|
"path": "lib/src/insights-surveys-types.d.ts",
|
|
"example": "DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions"
|
|
},
|
|
{
|
|
"id": "DisplaySurveyPopoverOptions",
|
|
"name": "DisplaySurveyPopoverOptions",
|
|
"properties": [
|
|
{
|
|
"type": "DisplaySurveyType.Popover",
|
|
"name": "displayType"
|
|
},
|
|
{
|
|
"description": "Override the survey's configured position",
|
|
"type": "SurveyPosition",
|
|
"name": "position"
|
|
},
|
|
{
|
|
"description": "CSS selector for the element to position the survey next to (when position is NextToTrigger)",
|
|
"type": "string",
|
|
"name": "selector"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-surveys-types.d.ts"
|
|
},
|
|
{
|
|
"id": "DisplaySurveyType",
|
|
"name": "DisplaySurveyType",
|
|
"properties": [
|
|
{
|
|
"type": "\"inline\"",
|
|
"name": "Inline"
|
|
},
|
|
{
|
|
"type": "\"popover\"",
|
|
"name": "Popover"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-surveys-types.d.ts"
|
|
},
|
|
{
|
|
"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": "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": "EventHandler",
|
|
"name": "EventHandler",
|
|
"properties": [],
|
|
"path": "lib/src/types.d.ts",
|
|
"example": "(event: Event) => boolean | void"
|
|
},
|
|
{
|
|
"id": "FlagsResponse",
|
|
"name": "FlagsResponse",
|
|
"properties": [
|
|
{
|
|
"type": "boolean",
|
|
"name": "errorsWhileComputingFlags"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "evaluatedAt"
|
|
},
|
|
{
|
|
"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": "GetMessagesResponse",
|
|
"name": "GetMessagesResponse",
|
|
"properties": [
|
|
{
|
|
"description": "Whether there are more messages to fetch",
|
|
"type": "boolean",
|
|
"name": "has_more"
|
|
},
|
|
{
|
|
"description": "Array of messages",
|
|
"type": "Message[]",
|
|
"name": "messages"
|
|
},
|
|
{
|
|
"description": "ID of the ticket",
|
|
"type": "string",
|
|
"name": "ticket_id"
|
|
},
|
|
{
|
|
"description": "Current status of the ticket",
|
|
"type": "TicketStatus",
|
|
"name": "ticket_status"
|
|
},
|
|
{
|
|
"description": "Number of unread messages from the team",
|
|
"type": "number",
|
|
"name": "unread_count"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "GetTicketsOptions",
|
|
"name": "GetTicketsOptions",
|
|
"properties": [
|
|
{
|
|
"description": "Number of tickets to return (default: 20)",
|
|
"type": "number",
|
|
"name": "limit"
|
|
},
|
|
{
|
|
"description": "Pagination offset (default: 0)",
|
|
"type": "number",
|
|
"name": "offset"
|
|
},
|
|
{
|
|
"description": "Filter by ticket status (e.g., 'open', 'closed')",
|
|
"type": "string",
|
|
"name": "status"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "GetTicketsResponse",
|
|
"name": "GetTicketsResponse",
|
|
"properties": [
|
|
{
|
|
"description": "Total count of tickets",
|
|
"type": "number",
|
|
"name": "count"
|
|
},
|
|
{
|
|
"description": "Array of tickets",
|
|
"type": "Ticket[]",
|
|
"name": "results"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "JSONContent",
|
|
"name": "JSONContent",
|
|
"properties": [
|
|
{
|
|
"type": "Record<string, any>",
|
|
"name": "attrs"
|
|
},
|
|
{
|
|
"type": "JSONContent[]",
|
|
"name": "content"
|
|
},
|
|
{
|
|
"type": "{\n type: string;\n attrs?: Record<string, any>;\n }[]",
|
|
"name": "marks"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "text"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "type"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"id": "LinkSurveyQuestion",
|
|
"name": "LinkSurveyQuestion",
|
|
"properties": [
|
|
{
|
|
"type": "string | null",
|
|
"name": "link"
|
|
},
|
|
{
|
|
"type": "SurveyQuestionType.Link",
|
|
"name": "type"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-surveys-types.d.ts"
|
|
},
|
|
{
|
|
"id": "MarkAsReadResponse",
|
|
"name": "MarkAsReadResponse",
|
|
"properties": [
|
|
{
|
|
"description": "Whether the operation was successful",
|
|
"type": "boolean",
|
|
"name": "success"
|
|
},
|
|
{
|
|
"description": "Number of unread messages (should be 0 after marking as read)",
|
|
"type": "number",
|
|
"name": "unread_count"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "Message",
|
|
"name": "Message",
|
|
"properties": [
|
|
{
|
|
"description": "Display name of the message author",
|
|
"type": "string",
|
|
"name": "author_name"
|
|
},
|
|
{
|
|
"description": "Type of the message author",
|
|
"type": "MessageAuthorType",
|
|
"name": "author_type"
|
|
},
|
|
{
|
|
"description": "The message content/text",
|
|
"type": "string",
|
|
"name": "content"
|
|
},
|
|
{
|
|
"description": "ISO timestamp when the message was created",
|
|
"type": "string",
|
|
"name": "created_at"
|
|
},
|
|
{
|
|
"description": "Unique identifier for the message",
|
|
"type": "string",
|
|
"name": "id"
|
|
},
|
|
{
|
|
"description": "Whether this is an internal note (not shown to customer)",
|
|
"type": "boolean",
|
|
"name": "is_private"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "MessageAuthorType",
|
|
"name": "MessageAuthorType",
|
|
"properties": [],
|
|
"path": "lib/src/insights-conversations-types.d.ts",
|
|
"example": "\"customer\" | \"AI\" | \"human\""
|
|
},
|
|
{
|
|
"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": "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": "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": [],
|
|
"path": "lib/src/types.d.ts",
|
|
"example": "Omit<BaseInsightsConfig, 'loaded'> & {\n loaded: (insights: InsightsInterface) => void;\n}"
|
|
},
|
|
{
|
|
"id": "InsightsInterface",
|
|
"name": "InsightsInterface",
|
|
"properties": [],
|
|
"path": "lib/src/types.d.ts",
|
|
"example": "\"config\" | \"init\" | \"set_config\""
|
|
},
|
|
{
|
|
"id": "ProductTour",
|
|
"name": "ProductTour",
|
|
"properties": [
|
|
{
|
|
"type": "ProductTourAppearance",
|
|
"name": "appearance"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "auto_launch"
|
|
},
|
|
{
|
|
"type": "ProductTourConditions",
|
|
"name": "conditions"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "current_iteration"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "description"
|
|
},
|
|
{
|
|
"type": "ProductTourDisplayFrequency",
|
|
"name": "display_frequency"
|
|
},
|
|
{
|
|
"type": "string | null",
|
|
"name": "end_date"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "id"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "internal_targeting_flag_key"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "linked_flag_key"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "name"
|
|
},
|
|
{
|
|
"type": "string | null",
|
|
"name": "start_date"
|
|
},
|
|
{
|
|
"type": "ProductTourStep[]",
|
|
"name": "steps"
|
|
},
|
|
{
|
|
"type": "'product_tour'",
|
|
"name": "type"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ProductTourAppearance",
|
|
"name": "ProductTourAppearance",
|
|
"properties": [
|
|
{
|
|
"type": "string",
|
|
"name": "backgroundColor"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "borderColor"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "borderRadius"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "boxShadow"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "buttonBorderRadius"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "buttonColor"
|
|
},
|
|
{
|
|
"description": "defaults to true, auto-set to false for announcements/banners",
|
|
"type": "boolean",
|
|
"name": "dismissOnClickOutside"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "fontFamily"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "showOverlay"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "textColor"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "whiteLabel"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "zIndex"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ProductTourBannerConfig",
|
|
"name": "ProductTourBannerConfig",
|
|
"properties": [
|
|
{
|
|
"type": "{\n type: 'none' | 'link' | 'trigger_tour';\n link?: string;\n tourId?: string;\n }",
|
|
"name": "action"
|
|
},
|
|
{
|
|
"type": "'sticky' | 'static'",
|
|
"name": "behavior"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ProductTourButtonAction",
|
|
"name": "ProductTourButtonAction",
|
|
"properties": [],
|
|
"path": "lib/src/insights-product-tours-types.d.ts",
|
|
"example": "\"dismiss\" | \"link\" | \"next_step\" | \"previous_step\" | \"trigger_tour\""
|
|
},
|
|
{
|
|
"id": "ProductTourCallback",
|
|
"name": "ProductTourCallback",
|
|
"properties": [],
|
|
"path": "lib/src/insights-product-tours-types.d.ts",
|
|
"example": "(tours: ProductTour[], context?: {\n isLoaded: boolean;\n error?: string;\n}) => void"
|
|
},
|
|
{
|
|
"id": "ProductTourConditions",
|
|
"name": "ProductTourConditions",
|
|
"properties": [
|
|
{
|
|
"type": "{\n values: SurveyActionType[];\n } | null",
|
|
"name": "actions"
|
|
},
|
|
{
|
|
"type": "number",
|
|
"name": "autoShowDelaySeconds"
|
|
},
|
|
{
|
|
"type": "{\n values: SurveyEventWithFilters[];\n } | null",
|
|
"name": "cancelEvents"
|
|
},
|
|
{
|
|
"type": "{\n values: SurveyEventWithFilters[];\n } | null",
|
|
"name": "events"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "selector"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "url"
|
|
},
|
|
{
|
|
"type": "PropertyMatchType",
|
|
"name": "urlMatchType"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ProductTourDismissReason",
|
|
"name": "ProductTourDismissReason",
|
|
"properties": [],
|
|
"path": "lib/src/insights-product-tours-types.d.ts",
|
|
"example": "\"user_clicked_skip\" | \"user_clicked_outside\" | \"escape_key\" | \"element_unavailable\""
|
|
},
|
|
{
|
|
"id": "ProductTourDisplayFrequency",
|
|
"name": "ProductTourDisplayFrequency",
|
|
"properties": [],
|
|
"path": "lib/src/insights-product-tours-types.d.ts",
|
|
"example": "\"show_once\" | \"until_interacted\" | \"always\""
|
|
},
|
|
{
|
|
"id": "ProductTourRenderReason",
|
|
"name": "ProductTourRenderReason",
|
|
"properties": [],
|
|
"path": "lib/src/insights-product-tours-types.d.ts",
|
|
"example": "\"auto\" | \"api\" | \"trigger\" | \"event\""
|
|
},
|
|
{
|
|
"id": "ProductTourSelectorError",
|
|
"name": "ProductTourSelectorError",
|
|
"properties": [],
|
|
"path": "lib/src/insights-product-tours-types.d.ts",
|
|
"example": "\"not_found\" | \"multiple_matches\" | \"not_visible\""
|
|
},
|
|
{
|
|
"id": "ProductTourStep",
|
|
"name": "ProductTourStep",
|
|
"properties": [
|
|
{
|
|
"description": "Banner configuration (only for banner steps)",
|
|
"type": "ProductTourBannerConfig",
|
|
"name": "bannerConfig"
|
|
},
|
|
{
|
|
"description": "Button configuration for modal steps",
|
|
"type": "ProductTourStepButtons",
|
|
"name": "buttons"
|
|
},
|
|
{
|
|
"type": "JSONContent | null",
|
|
"name": "content"
|
|
},
|
|
{
|
|
"description": "Pre-rendered HTML content from the editor. If present, SDK should use this instead of rendering from JSONContent.",
|
|
"type": "string",
|
|
"name": "contentHtml"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "id"
|
|
},
|
|
{
|
|
"description": "Enhanced element data for more reliable lookup at runtime",
|
|
"type": "InferredSelector",
|
|
"name": "inferenceData"
|
|
},
|
|
{
|
|
"description": "ID of the auto-created survey for this step (set by backend)",
|
|
"type": "string",
|
|
"name": "linkedSurveyId"
|
|
},
|
|
{
|
|
"description": "ID of the survey question (set by backend, used for event tracking)",
|
|
"type": "string",
|
|
"name": "linkedSurveyQuestionId"
|
|
},
|
|
{
|
|
"description": "Maximum tooltip width in pixels (defaults to 320px)",
|
|
"type": "number",
|
|
"name": "maxWidth"
|
|
},
|
|
{
|
|
"description": "Position for modal/survey steps (defaults to middle_center)",
|
|
"type": "SurveyPosition",
|
|
"name": "modalPosition"
|
|
},
|
|
{
|
|
"type": "'button' | 'click'",
|
|
"name": "progressionTrigger"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "selector"
|
|
},
|
|
{
|
|
"description": "Inline survey question config - if present, this is a survey step",
|
|
"type": "ProductTourSurveyQuestion",
|
|
"name": "survey"
|
|
},
|
|
{
|
|
"type": "ProductTourStepType",
|
|
"name": "type"
|
|
},
|
|
{
|
|
"description": "Use CSS selector instead of inference. Defaults to false (use inference).",
|
|
"type": "boolean",
|
|
"name": "useManualSelector"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ProductTourStepButton",
|
|
"name": "ProductTourStepButton",
|
|
"properties": [
|
|
{
|
|
"type": "ProductTourButtonAction",
|
|
"name": "action"
|
|
},
|
|
{
|
|
"description": "URL to open when action is 'link'",
|
|
"type": "string",
|
|
"name": "link"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "text"
|
|
},
|
|
{
|
|
"description": "Tour ID to trigger when action is 'trigger_tour'",
|
|
"type": "string",
|
|
"name": "tourId"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ProductTourStepButtons",
|
|
"name": "ProductTourStepButtons",
|
|
"properties": [
|
|
{
|
|
"type": "ProductTourStepButton",
|
|
"name": "primary"
|
|
},
|
|
{
|
|
"type": "ProductTourStepButton",
|
|
"name": "secondary"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ProductTourStepType",
|
|
"name": "ProductTourStepType",
|
|
"properties": [],
|
|
"path": "lib/src/insights-product-tours-types.d.ts",
|
|
"example": "\"element\" | \"modal\" | \"survey\" | \"banner\""
|
|
},
|
|
{
|
|
"id": "ProductTourSurveyQuestion",
|
|
"name": "ProductTourSurveyQuestion",
|
|
"properties": [
|
|
{
|
|
"description": "Rating display type - emoji or number",
|
|
"type": "'emoji' | 'number'",
|
|
"name": "display"
|
|
},
|
|
{
|
|
"description": "Label for low end of rating scale (e.g., \"Not likely\")",
|
|
"type": "string",
|
|
"name": "lowerBoundLabel"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "questionText"
|
|
},
|
|
{
|
|
"description": "Rating scale - 3 or 5 for emoji, 5 or 10 for number",
|
|
"type": "3 | 5 | 10",
|
|
"name": "scale"
|
|
},
|
|
{
|
|
"type": "ProductTourSurveyQuestionType",
|
|
"name": "type"
|
|
},
|
|
{
|
|
"description": "Label for high end of rating scale (e.g., \"Very likely\")",
|
|
"type": "string",
|
|
"name": "upperBoundLabel"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"id": "ProductTourSurveyQuestionType",
|
|
"name": "ProductTourSurveyQuestionType",
|
|
"properties": [],
|
|
"path": "lib/src/insights-product-tours-types.d.ts",
|
|
"example": "\"open\" | \"rating\""
|
|
},
|
|
{
|
|
"id": "PropertyFilters",
|
|
"name": "PropertyFilters",
|
|
"properties": [],
|
|
"path": "lib/src/insights-surveys-types.d.ts",
|
|
"example": "{\n [propertyName: string]: {\n values: string[];\n operator: PropertyOperator;\n };\n}"
|
|
},
|
|
{
|
|
"id": "PropertyMatchType",
|
|
"name": "PropertyMatchType",
|
|
"properties": [],
|
|
"path": "lib/src/types.d.ts",
|
|
"example": "\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\""
|
|
},
|
|
{
|
|
"id": "PropertyOperator",
|
|
"name": "PropertyOperator",
|
|
"properties": [],
|
|
"path": "lib/src/insights-surveys-types.d.ts",
|
|
"example": "\"gt\" | \"lt\""
|
|
},
|
|
{
|
|
"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": "RatingSurveyQuestion",
|
|
"name": "RatingSurveyQuestion",
|
|
"properties": [
|
|
{
|
|
"type": "'number' | 'emoji'",
|
|
"name": "display"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "lowerBoundLabel"
|
|
},
|
|
{
|
|
"type": "2 | 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": "Conversations widget configuration",
|
|
"type": "boolean | ConversationsRemoteConfig",
|
|
"name": "conversations"
|
|
},
|
|
{
|
|
"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": "Whether capturing logs to the logs product is enabled",
|
|
"type": "{\n captureConsoleLogs?: boolean;\n }",
|
|
"name": "logs"
|
|
},
|
|
{
|
|
"description": "Whether product tours are enabled",
|
|
"type": "boolean",
|
|
"name": "productTours"
|
|
},
|
|
{
|
|
"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": "RequestWithOptions",
|
|
"name": "RequestWithOptions",
|
|
"properties": [
|
|
{
|
|
"type": "(response: import('@hanzo/types').RequestResponse) => void",
|
|
"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": "SendMessagePayload",
|
|
"name": "SendMessagePayload",
|
|
"properties": [
|
|
{
|
|
"description": "Distinct ID for linking to Insights Person",
|
|
"type": "string",
|
|
"name": "distinct_id"
|
|
},
|
|
{
|
|
"description": "The message content to send",
|
|
"type": "string",
|
|
"name": "message"
|
|
},
|
|
{
|
|
"description": "Session context captured when creating a new ticket Stored in a JSONField for flexibility",
|
|
"type": "SessionContext",
|
|
"name": "session_context"
|
|
},
|
|
{
|
|
"description": "Session ID captured when creating a new ticket Stored as a separate queryable DB field",
|
|
"type": "string",
|
|
"name": "session_id"
|
|
},
|
|
{
|
|
"description": "Ticket ID to send the message to (null to create a new ticket)",
|
|
"type": "string | null",
|
|
"name": "ticket_id"
|
|
},
|
|
{
|
|
"description": "User identification traits",
|
|
"type": "{\n name: string | null;\n email: string | null;\n }",
|
|
"name": "traits"
|
|
},
|
|
{
|
|
"description": "Widget session ID for access control",
|
|
"type": "string",
|
|
"name": "widget_session_id"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "SendMessageResponse",
|
|
"name": "SendMessageResponse",
|
|
"properties": [
|
|
{
|
|
"description": "ISO timestamp when the message was created",
|
|
"type": "string",
|
|
"name": "created_at"
|
|
},
|
|
{
|
|
"description": "ID of the newly created message",
|
|
"type": "string",
|
|
"name": "message_id"
|
|
},
|
|
{
|
|
"description": "ID of the ticket this message belongs to",
|
|
"type": "string",
|
|
"name": "ticket_id"
|
|
},
|
|
{
|
|
"description": "Current status of the ticket",
|
|
"type": "TicketStatus",
|
|
"name": "ticket_status"
|
|
},
|
|
{
|
|
"description": "Number of unread messages from the team After customer sends a message, this is always 0",
|
|
"type": "number",
|
|
"name": "unread_count"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "SessionContext",
|
|
"name": "SessionContext",
|
|
"properties": [
|
|
{
|
|
"description": "Page URL where the ticket was created",
|
|
"type": "string",
|
|
"name": "current_url"
|
|
},
|
|
{
|
|
"description": "URL to the session replay at the time the ticket was created Includes timestamp to jump to the exact moment",
|
|
"type": "string",
|
|
"name": "session_replay_url"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-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": "ShowTourOptions",
|
|
"name": "ShowTourOptions",
|
|
"properties": [
|
|
{
|
|
"type": "boolean",
|
|
"name": "enableStrictValidation"
|
|
},
|
|
{
|
|
"type": "ProductTourRenderReason",
|
|
"name": "reason"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-product-tours-types.d.ts"
|
|
},
|
|
{
|
|
"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": "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: SurveyEventWithFilters[];\n } | null;\n cancelEvents: {\n values: SurveyEventWithFilters[];\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": "string",
|
|
"name": "boxPadding"
|
|
},
|
|
{
|
|
"description": "",
|
|
"type": "string",
|
|
"name": "descriptionTextColor"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "disabledButtonOpacity"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "fontFamily"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "hideCancelButton"
|
|
},
|
|
{
|
|
"description": "",
|
|
"type": "string",
|
|
"name": "inputBackgroundColor"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "maxWidth"
|
|
},
|
|
{
|
|
"type": "SurveyPosition",
|
|
"name": "position"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "ratingButtonHoverColor"
|
|
},
|
|
{
|
|
"type": "SurveyTabPosition",
|
|
"name": "tabPosition"
|
|
},
|
|
{
|
|
"type": "boolean",
|
|
"name": "whiteLabel"
|
|
},
|
|
{
|
|
"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": [
|
|
{
|
|
"description": "",
|
|
"type": "number",
|
|
"name": "autoSubmitDelay"
|
|
},
|
|
{
|
|
"description": "",
|
|
"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 abandoned\"",
|
|
"name": "ABANDONED"
|
|
},
|
|
{
|
|
"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": "\"$product_tour_id\"",
|
|
"name": "PRODUCT_TOUR_ID"
|
|
},
|
|
{
|
|
"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_last_seen_date\"",
|
|
"name": "SURVEY_LAST_SEEN_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": "SurveyEventType",
|
|
"name": "SurveyEventType",
|
|
"properties": [
|
|
{
|
|
"type": "\"events\"",
|
|
"name": "Activation"
|
|
},
|
|
{
|
|
"type": "\"cancelEvents\"",
|
|
"name": "Cancellation"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-surveys-types.d.ts"
|
|
},
|
|
{
|
|
"id": "SurveyEventWithFilters",
|
|
"name": "SurveyEventWithFilters",
|
|
"properties": [
|
|
{
|
|
"type": "string",
|
|
"name": "name"
|
|
},
|
|
{
|
|
"type": "PropertyFilters",
|
|
"name": "propertyFilters"
|
|
}
|
|
],
|
|
"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": "SurveyResponseValue",
|
|
"name": "SurveyResponseValue",
|
|
"properties": [],
|
|
"path": "lib/src/insights-surveys-types.d.ts",
|
|
"example": "string | number | string[] | null"
|
|
},
|
|
{
|
|
"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": "SurveyTabPosition",
|
|
"name": "SurveyTabPosition",
|
|
"properties": [
|
|
{
|
|
"type": "\"bottom\"",
|
|
"name": "Bottom"
|
|
},
|
|
{
|
|
"type": "\"left\"",
|
|
"name": "Left"
|
|
},
|
|
{
|
|
"type": "\"right\"",
|
|
"name": "Right"
|
|
},
|
|
{
|
|
"type": "\"top\"",
|
|
"name": "Top"
|
|
}
|
|
],
|
|
"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": "Ticket",
|
|
"name": "Ticket",
|
|
"properties": [
|
|
{
|
|
"description": "ISO timestamp when the ticket was created",
|
|
"type": "string",
|
|
"name": "created_at"
|
|
},
|
|
{
|
|
"description": "Unique identifier for the ticket",
|
|
"type": "string",
|
|
"name": "id"
|
|
},
|
|
{
|
|
"description": "ISO timestamp of the last message",
|
|
"type": "string",
|
|
"name": "last_message_at"
|
|
},
|
|
{
|
|
"description": "Preview of the last message",
|
|
"type": "string",
|
|
"name": "last_message"
|
|
},
|
|
{
|
|
"description": "Total number of messages in this ticket",
|
|
"type": "number",
|
|
"name": "message_count"
|
|
},
|
|
{
|
|
"description": "Array of messages (only present in detailed ticket view)",
|
|
"type": "Message[]",
|
|
"name": "messages"
|
|
},
|
|
{
|
|
"description": "Current status of the ticket",
|
|
"type": "TicketStatus",
|
|
"name": "status"
|
|
},
|
|
{
|
|
"description": "Number of unread messages from the team",
|
|
"type": "number",
|
|
"name": "unread_count"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
},
|
|
{
|
|
"id": "TicketStatus",
|
|
"name": "TicketStatus",
|
|
"properties": [],
|
|
"path": "lib/src/insights-conversations-types.d.ts",
|
|
"example": "\"new\" | \"open\" | \"pending\" | \"on_hold\" | \"resolved\""
|
|
},
|
|
{
|
|
"id": "UserProvidedTraits",
|
|
"name": "UserProvidedTraits",
|
|
"properties": [
|
|
{
|
|
"type": "string",
|
|
"name": "email"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"name": "name"
|
|
}
|
|
],
|
|
"path": "lib/src/insights-conversations-types.d.ts"
|
|
}
|
|
],
|
|
"categories": [
|
|
"Initialization",
|
|
"Identification",
|
|
"Capture",
|
|
"Surveys",
|
|
"Error tracking",
|
|
"LLM analytics",
|
|
"Privacy",
|
|
"Session replay",
|
|
"Feature flags",
|
|
"Toolbar"
|
|
]
|
|
} |