Files
insights-js/packages/react-native/references/posthog-react-native-references-4.45.2.json

3118 lines
116 KiB
JSON

{
"id": "insights-react-native",
"hogRef": "0.3",
"info": {
"version": "4.45.2",
"id": "insights-react-native",
"title": "Insights React Native SDK",
"description": "Insights React Native SDK allows you to capture events and send them to Insights from your React Native applications.",
"slugPrefix": "insights-react-native",
"specUrl": "https://github.com/Insights/insights-js"
},
"classes": [
{
"id": "Insights",
"title": "Insights",
"functions": [
{
"category": "Initialization",
"description": "InsightsProvider is a React component that provides Insights functionality to your React Native app. You can find all configuration options in the [React Native SDK docs](https://insights.hanzo.ai/docs/libraries/react-native#configuration-options).\nAutocapturing navigation requires further configuration. See the [React Native SDK navigation docs](https://insights.hanzo.ai/docs/libraries/react-native#capturing-screen-views) for more information about autocapturing navigation.\nThis is the recommended way to set up Insights for React Native. This utilizes the Context API to pass the Insights client around, enable autocapture.",
"details": null,
"id": "InsightsProvider",
"showDocs": true,
"title": "InsightsProvider",
"examples": [
{
"id": "add_to_app.(js|ts)",
"name": "Add to App.(js|ts)",
"code": "\n\n// Add to App.(js|ts)\nimport { useInsights, InsightsProvider } from 'insights-react-native'\n\nexport function MyApp() {\n return (\n <InsightsProvider apiKey=\"<hi_project_api_key>\" options={{\n host: '<hi_client_api_host>',\n }}>\n <MyComponent />\n </InsightsProvider>\n )\n}\n\n// And access the Insights client via the useInsights hook\nimport { useInsights } from 'insights-react-native'\n\nconst MyComponent = () => {\n const insights = useInsights()\n\n useEffect(() => {\n insights.capture(\"event_name\")\n }, [insights])\n}\n\n\n\n"
},
{
"id": "using_with_existing_client",
"name": "Using with existing client",
"code": "\n\n// Using with existing client\nimport { Insights } from 'insights-react-native'\n\nconst insights = new Insights('<hi_project_api_key>', {\n host: '<hi_client_api_host>'\n})\n\nexport function MyApp() {\n return (\n <InsightsProvider client={insights}>\n <MyComponent />\n </InsightsProvider>\n )\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "InsightsProviderProps",
"name": "{ children, client, options, apiKey, autocapture, style, debug, }"
}
],
"returnType": {
"id": "JSX.Element | null",
"name": "JSX.Element | null"
}
},
{
"category": "Initialization",
"description": "Creates a new Insights instance for React Native. You can find all configuration options in the [React Native SDK docs](https://insights.hanzo.ai/docs/libraries/react-native#configuration-options).\nIf you prefer not to use the InsightsProvider, you can initialize Insights in its own file and import the instance from there.",
"details": null,
"id": "Insights",
"showDocs": true,
"title": "Insights",
"examples": [
{
"id": "insights.ts",
"name": "insights.ts",
"code": "\n\n// insights.ts\nimport Insights from 'insights-react-native'\n\nexport const insights = new Insights('<hi_project_api_key>', {\n host: '<hi_client_api_host>'\n})\n\n// Then you can access Insights by importing your instance\n// Another file:\nimport { insights } from './insights'\n\nexport function MyApp1() {\n useEffect(async () => {\n insights.capture('event_name')\n }, [insights])\n\n return <View>Your app code</View>\n}\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Your Insights API key",
"isOptional": false,
"type": "string",
"name": "apiKey"
},
{
"description": "Insights configuration options",
"isOptional": true,
"type": "InsightsOptions",
"name": "options"
}
],
"returnType": {
"id": "any",
"name": "any"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Identification",
"description": "Assigns an alias to the current user.\nSometimes, you want to assign multiple distinct IDs to a single user. This is helpful when your primary distinct ID is inaccessible. For example, if a distinct ID used on the frontend is not available in your backend.",
"details": null,
"id": "alias",
"showDocs": true,
"title": "alias",
"examples": [
{
"id": "set_alias_for_current_user",
"name": "set alias for current user",
"code": "\n\n// set alias for current user\ninsights.alias('distinct_id')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The alias to assign to the current user",
"isOptional": false,
"type": "string",
"name": "alias"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.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": "Error | unknown",
"name": "error"
},
{
"description": "Any additional properties to add to the error event",
"isOptional": true,
"type": "InsightsEventProperties",
"name": "additionalProperties"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Capture",
"description": "Captures a structured log record and sends it to Insights's logs product (`/i/v1/logs`). Low-level primitive — most callers will prefer `insights.logger.info(...)` / `.warn(...)` / `.error(...)` etc., which wrap this with a level pre-set.\nRecords are buffered per-session, rate-limited, batched into OTLP payloads, and flushed on a timer, on AppState change, or when the buffer reaches capacity. Configure flush cadence, rate cap, and a `beforeSend` filter via the `logs` option on `new Insights(...)`.\nNote — naming collision: `insights.captureLog()` (this method) is the **logs product** API. There is also a separate, pre-existing `sessionReplayConfig.captureLog` boolean that controls whether **session replay** records the device's `console.*` output. The two are unrelated: this method emits structured records to the logs pipeline regardless of whether session replay is on.",
"details": null,
"id": "captureLog",
"showDocs": true,
"title": "captureLog",
"examples": [
{
"id": "",
"name": "",
"code": "\n\ninsights.captureLog({\n body: 'checkout completed',\n level: 'info',\n attributes: { order_id: 'ord_789', amount_cents: 4999 },\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Log record. `body` is required; `level` defaults to `'info'`. `attributes` are attached as OTLP key-value attributes and will override auto-populated ones (distinctId, sessionId) on key conflict.",
"isOptional": false,
"type": "CaptureLogOptions",
"name": "options"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Identification",
"description": "Creates a person profile for the current user, if they don't already have one.\nThis is useful when using `personProfiles: 'identified_only'` mode and you want to explicitly create a profile for an anonymous user before they identify.\nIf `personProfiles` is 'identified_only' and no profile exists, this will create one. If `personProfiles` is 'never', this will log an error and do nothing. If `personProfiles` is 'always' or a profile already exists, this is a no-op.",
"details": null,
"id": "createPersonProfile",
"showDocs": true,
"title": "createPersonProfile",
"examples": [
{
"id": "create_a_person_profile_for_an_anonymous_user",
"name": "Create a person profile for an anonymous user",
"code": "\n\n// Create a person profile for an anonymous user\ninsights.createPersonProfile()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "fetch",
"showDocs": true,
"title": "fetch",
"examples": [
{
"id": "fetch",
"name": "Generated example for fetch",
"code": "// Generated example for fetch\ninsights.fetch();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "url"
},
{
"description": "",
"isOptional": false,
"type": "InsightsFetchOptions",
"name": "options"
}
],
"returnType": {
"id": "Promise<InsightsFetchResponse>",
"name": "Promise<InsightsFetchResponse>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Capture",
"description": "Manually flushes the event queue.\nYou can set the number of events in the configuration that should queue before flushing. Setting this to 1 will send events immediately and will use more battery. This is set to 20 by default. You can also manually flush the queue. If a flush is already in progress it returns a promise for the existing flush.\nNote: this drains the **events** pipeline only. Logs are flushed via , and drains both before terminating.",
"details": null,
"id": "flush",
"showDocs": true,
"title": "flush",
"examples": [
{
"id": "manually_flush_the_queue",
"name": "manually flush the queue",
"code": "\n\n// manually flush the queue\nawait insights.flush()\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Capture",
"description": "Manually flushes the logs queue.\nLogs flush automatically on a timer, when the buffer fills, or on AppState change — most apps never need to call this. Use it when you want a synchronous-style hand-off (e.g. before navigating away from a critical screen, in a custom crash handler, or while testing locally).\nIf a flush is already in progress, both callers join the same in-flight promise — no double-send.\nNote: this drains the **logs** pipeline only. Events are flushed via , and drains both before terminating.",
"details": null,
"id": "flushLogs",
"showDocs": true,
"title": "flushLogs",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nawait insights.flushLogs()\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getCommonEventProperties",
"showDocs": true,
"title": "getCommonEventProperties",
"examples": [
{
"id": "getcommoneventproperties",
"name": "Generated example for getCommonEventProperties",
"code": "// Generated example for getCommonEventProperties\ninsights.getCommonEventProperties();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "InsightsEventProperties",
"name": "InsightsEventProperties"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getCustomUserAgent",
"showDocs": true,
"title": "getCustomUserAgent",
"examples": [
{
"id": "getcustomuseragent",
"name": "Generated example for getCustomUserAgent",
"code": "// Generated example for getCustomUserAgent\ninsights.getCustomUserAgent();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string",
"name": "string"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"description": "Returns the stable device identifier used for device-level feature flag bucketing. This ID persists across identify() and reset() calls, only changing on a fresh app install, manual cache clearing, or OS-initiated storage cleanup.",
"details": null,
"id": "getDeviceId",
"showDocs": true,
"title": "getDeviceId",
"examples": [
{
"id": "getdeviceid",
"name": "Generated example for getDeviceId",
"code": "// Generated example for getDeviceId\ninsights.getDeviceId();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string",
"name": "string"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Identification",
"description": "Gets the current user's distinct ID.\nYou may find it helpful to get the current user's distinct ID. For example, to check whether you've already called identify for a user or not. This returns either the ID automatically generated by Insights or the ID that has been passed by a call to identify().",
"details": null,
"id": "getDistinctId",
"showDocs": true,
"title": "getDistinctId",
"examples": [
{
"id": "get_current_distinct_id",
"name": "get current distinct ID",
"code": "\n\n// get current distinct ID\nconst distinctId = insights.getDistinctId()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string",
"name": "string"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Feature flags",
"description": "Gets the value of a feature flag for the current user.\nDefaults to undefined if not loaded yet or if there was a problem loading. Multivariant feature flags are returned as a string.",
"details": null,
"id": "getFeatureFlag",
"showDocs": true,
"title": "getFeatureFlag",
"examples": [
{
"id": "get_feature_flag_value",
"name": "get feature flag value",
"code": "\n\n// get feature flag value\nconst value = insights.getFeatureFlag('key-for-your-boolean-flag')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The feature flag key",
"isOptional": false,
"type": "string",
"name": "key"
}
],
"returnType": {
"id": "boolean | string | undefined",
"name": "boolean | string | undefined"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Feature flags",
"description": "Gets the payload of a feature flag for the current user.\nReturns JsonType or undefined if not loaded yet or if there was a problem loading.",
"details": null,
"id": "getFeatureFlagPayload",
"showDocs": true,
"title": "getFeatureFlagPayload",
"examples": [
{
"id": "get_feature_flag_payload",
"name": "get feature flag payload",
"code": "\n\n// get feature flag payload\nconst payload = insights.getFeatureFlagPayload('key-for-your-multivariate-flag')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The feature flag key",
"isOptional": false,
"type": "string",
"name": "key"
}
],
"returnType": {
"id": "JsonType | undefined",
"name": "JsonType | undefined"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getLibraryId",
"showDocs": true,
"title": "getLibraryId",
"examples": [
{
"id": "getlibraryid",
"name": "Generated example for getLibraryId",
"code": "// Generated example for getLibraryId\ninsights.getLibraryId();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string",
"name": "string"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getLibraryVersion",
"showDocs": true,
"title": "getLibraryVersion",
"examples": [
{
"id": "getlibraryversion",
"name": "Generated example for getLibraryVersion",
"code": "// Generated example for getLibraryVersion\ninsights.getLibraryVersion();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string",
"name": "string"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getPersistedProperty",
"showDocs": true,
"title": "getPersistedProperty",
"examples": [
{
"id": "getpersistedproperty",
"name": "Generated example for getPersistedProperty",
"code": "// Generated example for getPersistedProperty\ninsights.getPersistedProperty();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "InsightsPersistedProperty",
"name": "key"
}
],
"returnType": {
"id": "T | undefined",
"name": "T | undefined"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getSessionId",
"showDocs": true,
"title": "getSessionId",
"examples": [
{
"id": "getsessionid",
"name": "Generated example for getSessionId",
"code": "// Generated example for getSessionId\ninsights.getSessionId();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string",
"name": "string"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getSurveyDisplayLanguageOverride",
"showDocs": true,
"title": "getSurveyDisplayLanguageOverride",
"examples": [
{
"id": "getsurveydisplaylanguageoverride",
"name": "Generated example for getSurveyDisplayLanguageOverride",
"code": "// Generated example for getSurveyDisplayLanguageOverride\ninsights.getSurveyDisplayLanguageOverride();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string | null",
"name": "string | null"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getSurveys",
"showDocs": true,
"title": "getSurveys",
"examples": [
{
"id": "getsurveys",
"name": "Generated example for getSurveys",
"code": "// Generated example for getSurveys\ninsights.getSurveys();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<SurveyResponse['surveys']>",
"name": "Promise<SurveyResponse['surveys']>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Group analytics",
"description": "Associates the current user with a group.\nGroup analytics allows you to associate the events for that person's session with a group (e.g. teams, organizations, etc.). This is a paid feature and is not available on the open-source or free cloud plan.",
"details": null,
"id": "group",
"showDocs": true,
"title": "group",
"examples": [
{
"id": "associate_with_a_group",
"name": "associate with a group",
"code": "\n\n// associate with a group\ninsights.group('company', 'company_id_in_your_db')\n\n\n"
},
{
"id": "associate_with_a_group_and_update_properties",
"name": "associate with a group and update properties",
"code": "\n\n// associate with a group and update properties\ninsights.group('company', 'company_id_in_your_db', {\n name: 'Awesome Inc.',\n employees: 11,\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The type of group (e.g. 'company', 'team')",
"isOptional": false,
"type": "string",
"name": "groupType"
},
{
"description": "The unique identifier for the group",
"isOptional": false,
"type": "string",
"name": "groupKey"
},
{
"description": "Optional properties to set for the group",
"isOptional": true,
"type": "InsightsEventProperties",
"name": "properties"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Identification",
"description": "Associates events with a specific user. Learn more about [identifying users](https://insights.hanzo.ai/docs/product-analytics/identify)",
"details": null,
"id": "identify",
"showDocs": true,
"title": "identify",
"examples": [
{
"id": "basic_identify",
"name": "Basic identify",
"code": "\n\n// Basic identify\ninsights.identify('distinctID', {\n email: '[email protected]',\n name: 'My Name'\n})\n\n\n"
},
{
"id": "using_$set_and_$set_once",
"name": "Using $set and $set_once",
"code": "\n\n// Using $set and $set_once\ninsights.identify('distinctID', {\n $set: {\n email: '[email protected]',\n name: 'My Name'\n },\n $set_once: {\n date_of_first_log_in: '2024-03-01'\n }\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "A unique identifier for your user. Typically either their email or database ID.",
"isOptional": true,
"type": "string",
"name": "distinctId"
},
{
"description": "Optional dictionary with key:value pairs to set the person properties",
"isOptional": true,
"type": "InsightsEventProperties",
"name": "properties"
},
{
"description": "Optional capture options",
"isOptional": true,
"type": "InsightsCaptureOptions",
"name": "options"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "initReactNativeNavigation",
"showDocs": true,
"title": "initReactNativeNavigation",
"examples": [
{
"id": "initreactnativenavigation",
"name": "Generated example for initReactNativeNavigation",
"code": "// Generated example for initReactNativeNavigation\ninsights.initReactNativeNavigation();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "InsightsAutocaptureOptions",
"name": "options"
}
],
"returnType": {
"id": "boolean",
"name": "boolean"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Feature flags",
"description": "Checks if a feature flag is enabled for the current user.\nDefaults to undefined if not loaded yet or if there was a problem loading.",
"details": null,
"id": "isFeatureEnabled",
"showDocs": true,
"title": "isFeatureEnabled",
"examples": [
{
"id": "check_if_feature_flag_is_enabled",
"name": "check if feature flag is enabled",
"code": "\n\n// check if feature flag is enabled\nconst isEnabled = insights.isFeatureEnabled('key-for-your-boolean-flag')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The feature flag key",
"isOptional": false,
"type": "string",
"name": "key"
}
],
"returnType": {
"id": "boolean | undefined",
"name": "boolean | undefined"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Session Replay",
"description": "Returns whether session replay is currently active.\nNote: This is only available on iOS and Android. On web/macOS, this always returns false.",
"details": null,
"id": "isSessionReplayActive",
"showDocs": true,
"title": "isSessionReplayActive",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nconst isActive = await insights.isSessionReplayActive()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<boolean>",
"name": "Promise<boolean>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Privacy",
"description": "Opts the user in to data capture.\nBy default, Insights has tracking enabled unless it is forcefully disabled by default using the option defaultOptIn: false . Once this has been called it is persisted and will be respected until optOut is called again or the reset function is called.",
"details": null,
"id": "optIn",
"showDocs": true,
"title": "optIn",
"examples": [
{
"id": "opt_in_to_tracking",
"name": "opt in to tracking",
"code": "\n\n// opt in to tracking\ninsights.optIn()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Privacy",
"description": "Opts the user out of data capture.\nYou can completely opt-out users from data capture. Once this has been called it is persisted and will be respected until optIn is called again or the reset function is called.",
"details": null,
"id": "optOut",
"showDocs": true,
"title": "optOut",
"examples": [
{
"id": "opt_out_of_tracking",
"name": "opt out of tracking",
"code": "\n\n// opt out of tracking\ninsights.optOut()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Capture",
"description": "Registers super properties that are sent with every event.\nSuper properties are properties associated with events that are set once and then sent with every capture call. They persist across sessions and are stored locally.",
"details": null,
"id": "register",
"showDocs": true,
"title": "register",
"examples": [
{
"id": "register_super_properties",
"name": "register super properties",
"code": "\n\n// register super properties\ninsights.register({\n 'icecream pref': 'vanilla',\n team_id: 22,\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "An associative array of properties to store about the user",
"isOptional": false,
"type": "InsightsEventProperties",
"name": "properties"
}
],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Feature flags",
"description": "Reloads feature flags from the server.\nInsights loads feature flags when instantiated and refreshes whenever methods are called that affect the flag. If you want to manually trigger a refresh, you can call this method.",
"details": null,
"id": "reloadFeatureFlags",
"showDocs": true,
"title": "reloadFeatureFlags",
"examples": [
{
"id": "reload_feature_flags",
"name": "reload feature flags",
"code": "\n\n// reload feature flags\ninsights.reloadFeatureFlags()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Feature flags",
"description": "Reloads feature flags from the server asynchronously.\nInsights loads feature flags when instantiated and refreshes whenever methods are called that affect the flag. If you want to manually trigger a refresh and get the result, you can call this method.",
"details": null,
"id": "reloadFeatureFlagsAsync",
"showDocs": true,
"title": "reloadFeatureFlagsAsync",
"examples": [
{
"id": "reload_feature_flags_and_get_result",
"name": "reload feature flags and get result",
"code": "\n\n// reload feature flags and get result\ninsights.reloadFeatureFlagsAsync().then((refreshedFlags) => console.log(refreshedFlags))\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<Record<string, boolean | string> | undefined>",
"name": "Promise<Record<string, boolean | string> | undefined>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Identification",
"description": "Resets the user's ID and anonymous ID after logout.\nTo reset the user's ID and anonymous ID, call reset. Usually you would do this right after the user logs out. This also clears all stored super properties and more.\nBy default (when `propertiesToKeep` is not provided), the app lifecycle properties (`InstalledAppBuild` and `InstalledAppVersion`) are automatically preserved to prevent duplicate \"Application Installed\" events on the next app launch.\nIf you pass `propertiesToKeep` explicitly, only the properties you specify will be preserved. To keep the default app lifecycle behavior, include `InsightsPersistedProperty.InstalledAppBuild` and `InsightsPersistedProperty.InstalledAppVersion` in your array.\nNote: The event queue (`InsightsPersistedProperty.Queue`) and logs queue (`InsightsPersistedProperty.LogsQueue`) are always preserved regardless of what is passed in `propertiesToKeep`, to ensure in-flight data is not lost.",
"details": null,
"id": "reset",
"showDocs": true,
"title": "reset",
"examples": [
{
"id": "reset_after_logout_(preserves_app_lifecycle_properties_by_default)",
"name": "reset after logout (preserves app lifecycle properties by default)",
"code": "\n\n// reset after logout (preserves app lifecycle properties by default)\ninsights.reset()\n\n\n"
},
{
"id": "reset_but_keep_feature_flag_overrides_and_app_lifecycle_properties",
"name": "reset but keep feature flag overrides and app lifecycle properties",
"code": "\n\n// reset but keep feature flag overrides and app lifecycle properties\ninsights.reset([\n InsightsPersistedProperty.OverrideFeatureFlags,\n InsightsPersistedProperty.InstalledAppBuild,\n InsightsPersistedProperty.InstalledAppVersion,\n])\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Optional array of persisted properties to preserve during reset. When not provided, app lifecycle and device bucketing properties are automatically preserved. When provided, only the specified properties are preserved. The event queue and logs queue are always preserved regardless.",
"isOptional": true,
"type": "InsightsPersistedProperty[]",
"name": "propertiesToKeep"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Feature flags",
"description": "Resets group properties for feature flag evaluation.",
"details": null,
"id": "resetGroupPropertiesForFlags",
"showDocs": true,
"title": "resetGroupPropertiesForFlags",
"examples": [
{
"id": "reset_group_properties_for_flags",
"name": "reset group properties for flags",
"code": "\n\n// reset group properties for flags\ninsights.resetGroupPropertiesForFlags()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Whether to reload feature flags after setting the properties. Defaults to true.",
"isOptional": true,
"type": "boolean",
"name": "reloadFeatureFlags"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Feature flags",
"description": "Resets person properties for feature flag evaluation.",
"details": null,
"id": "resetPersonPropertiesForFlags",
"showDocs": true,
"title": "resetPersonPropertiesForFlags",
"examples": [
{
"id": "reset_person_properties_for_flags",
"name": "reset person properties for flags",
"code": "\n\n// reset person properties for flags\ninsights.resetPersonPropertiesForFlags()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Whether to reload feature flags after setting the properties. Defaults to true.",
"isOptional": true,
"type": "boolean",
"name": "reloadFeatureFlags"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "resetSessionId",
"showDocs": true,
"title": "resetSessionId",
"examples": [
{
"id": "resetsessionid",
"name": "Generated example for resetSessionId",
"code": "// Generated example for resetSessionId\ninsights.resetSessionId();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Capture",
"description": "Captures a screen view event.",
"details": "This function requires a name. You may also pass in an optional properties object. Screen name is automatically registered for the session and will be included in subsequent events.",
"id": "screen",
"showDocs": true,
"title": "screen",
"examples": [
{
"id": "basic_screen_capture",
"name": "Basic screen capture",
"code": "\n\n// Basic screen capture\ninsights.screen('dashboard')\n\n\n"
},
{
"id": "screen_capture_with_properties",
"name": "Screen capture with properties",
"code": "\n\n// Screen capture with properties\ninsights.screen('dashboard', {\n background: 'blue',\n hero: 'superhog',\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The name of the screen",
"isOptional": false,
"type": "string",
"name": "name"
},
{
"description": "Optional properties to include with the screen event",
"isOptional": true,
"type": "InsightsEventProperties",
"name": "properties"
},
{
"description": "Optional capture options",
"isOptional": true,
"type": "InsightsCaptureOptions",
"name": "options"
}
],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Feature flags",
"description": "Sets group properties for feature flag evaluation.\nThese properties are automatically attached to the current group (set via insights.group()). When you change the group, these properties are reset.",
"details": null,
"id": "setGroupPropertiesForFlags",
"showDocs": true,
"title": "setGroupPropertiesForFlags",
"examples": [
{
"id": "set_group_properties_for_flags",
"name": "set group properties for flags",
"code": "\n\n// set group properties for flags\ninsights.setGroupPropertiesForFlags({'company': {'property1': 'value', property2: 'value2'}})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The group properties to set for flag evaluation",
"isOptional": false,
"type": "Record<string, Record<string, string>>",
"name": "properties"
},
{
"description": "Whether to reload feature flags after setting the properties. Defaults to true.",
"isOptional": true,
"type": "boolean",
"name": "reloadFeatureFlags"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "setPersistedProperty",
"showDocs": true,
"title": "setPersistedProperty",
"examples": [
{
"id": "setpersistedproperty",
"name": "Generated example for setPersistedProperty",
"code": "// Generated example for setPersistedProperty\ninsights.setPersistedProperty();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "InsightsPersistedProperty",
"name": "key"
},
{
"description": "",
"isOptional": false,
"type": "T | null",
"name": "value"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Identification",
"description": "Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](https://insights.hanzo.ai/docs/product-analytics/identify)",
"details": "Updates user properties that are stored with the person profile in Insights. If `personProfiles` 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_with_$set_once",
"name": "set properties with $set_once",
"code": "\n\n// set properties with $set_once\ninsights.setPersonProperties(\n { name: 'Max Hedgehog' }, // $set properties\n { initial_url: '/blog' } // $set_once properties\n)\n\n\n"
},
{
"id": "set_properties_without_reloading_feature_flags",
"name": "set properties without reloading feature flags",
"code": "\n\n// set properties without reloading feature flags\ninsights.setPersonProperties({ plan: 'premium' }, undefined, false)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Optional: An object of properties to store about the user. These properties will overwrite any existing values for the same keys.",
"isOptional": true,
"type": "{\n [key: string]: JsonType;\n }",
"name": "userPropertiesToSet"
},
{
"description": "Optional: An object of properties to store about the user. If a property is previously set, this does not override that value.",
"isOptional": true,
"type": "{\n [key: string]: JsonType;\n }",
"name": "userPropertiesToSetOnce"
},
{
"description": "Whether to reload feature flags after setting the properties. Defaults to true.",
"isOptional": true,
"type": "boolean",
"name": "reloadFeatureFlags"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Feature flags",
"description": "Sets person properties for feature flag evaluation.\nSometimes, 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 this call. These are set for the entire session. Successive calls are additive: all properties you set are combined together and sent for flag evaluation.",
"details": null,
"id": "setPersonPropertiesForFlags",
"showDocs": true,
"title": "setPersonPropertiesForFlags",
"examples": [
{
"id": "set_person_properties_for_flags",
"name": "set person properties for flags",
"code": "\n\n// set person properties for flags\ninsights.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The person properties to set for flag evaluation",
"isOptional": false,
"type": "Record<string, JsonType>",
"name": "properties"
},
{
"description": "Whether to reload feature flags after setting the properties. Defaults to true.",
"isOptional": true,
"type": "boolean",
"name": "reloadFeatureFlags"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Session Replay",
"description": "Starts session recording. This method will have no effect if Insights is not enabled, or if session replay is disabled in your project settings.\nNote: This is only available on iOS and Android. On web/macOS, this is a no-op.\nRequires `insights-react-native-session-replay` version 1.3.0 or higher.",
"details": null,
"id": "startSessionRecording",
"showDocs": true,
"title": "startSessionRecording",
"examples": [
{
"id": "resume_the_current_session_recording",
"name": "Resume the current session recording",
"code": "\n\n// Resume the current session recording\nawait insights.startSessionRecording()\n\n\n"
},
{
"id": "start_a_new_session_recording",
"name": "Start a new session recording",
"code": "\n\n// Start a new session recording\nawait insights.startSessionRecording(false)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Whether to resume recording of current session (true) or start a new session (false). Defaults to true.",
"isOptional": true,
"type": "boolean",
"name": "resumeCurrent"
}
],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Session Replay",
"description": "Stops the current session recording if one is in progress.\nNote: This is only available on iOS and Android. On web/macOS, this is a no-op.\nRequires `insights-react-native-session-replay` version 1.3.0 or higher.",
"details": null,
"id": "stopSessionRecording",
"showDocs": true,
"title": "stopSessionRecording",
"examples": [
{
"id": "",
"name": "",
"code": "\n\nawait insights.stopSessionRecording()\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Capture",
"description": "Removes a super property so it won't be sent with future events.\nSuper Properties are persisted across sessions so you have to explicitly remove them if they are no longer relevant.",
"details": null,
"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('icecream pref')\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "The name of the super property to remove",
"isOptional": false,
"type": "string",
"name": "property"
}
],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "autocapture",
"showDocs": true,
"title": "autocapture",
"examples": [
{
"id": "autocapture",
"name": "Generated example for autocapture",
"code": "// Generated example for autocapture\ninsights.autocapture();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "eventType"
},
{
"description": "",
"isOptional": false,
"type": "InsightsAutocaptureElement[]",
"name": "elements"
},
{
"description": "",
"isOptional": true,
"type": "InsightsEventProperties",
"name": "properties"
},
{
"description": "",
"isOptional": true,
"type": "InsightsCaptureOptions",
"name": "options"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "capture",
"showDocs": true,
"title": "capture",
"examples": [
{
"id": "capture",
"name": "Generated example for capture",
"code": "// Generated example for capture\ninsights.capture();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "event"
},
{
"description": "",
"isOptional": true,
"type": "InsightsEventProperties",
"name": "properties"
},
{
"description": "",
"isOptional": true,
"type": "InsightsCaptureOptions",
"name": "options"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.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": "dist/insights-rn.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": "dist/insights-rn.d.ts"
},
{
"category": "Identification",
"description": "Returns the current anonymous ID.\nThis is the ID assigned to users before they are identified. It's used to track anonymous users and link them to identified users when they sign up.",
"details": null,
"id": "getAnonymousId",
"showDocs": true,
"title": "getAnonymousId",
"examples": [
{
"id": "get_the_anonymous_id",
"name": "get the anonymous ID",
"code": "\n\n// get the anonymous ID\nconst anonId = insights.getAnonymousId()\nconsole.log('Anonymous ID:', anonId)\n\n\n\n"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "string",
"name": "string"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getFeatureFlagDetails",
"showDocs": true,
"title": "getFeatureFlagDetails",
"examples": [
{
"id": "getfeatureflagdetails",
"name": "Generated example for getFeatureFlagDetails",
"code": "// Generated example for getFeatureFlagDetails\ninsights.getFeatureFlagDetails();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "InsightsFeatureFlagDetails | undefined",
"name": "InsightsFeatureFlagDetails | undefined"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getFeatureFlagPayloads",
"showDocs": true,
"title": "getFeatureFlagPayloads",
"examples": [
{
"id": "getfeatureflagpayloads",
"name": "Generated example for getFeatureFlagPayloads",
"code": "// Generated example for getFeatureFlagPayloads\ninsights.getFeatureFlagPayloads();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "InsightsFlagsResponse['featureFlagPayloads'] | undefined",
"name": "InsightsFlagsResponse['featureFlagPayloads'] | undefined"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getFeatureFlagResult",
"showDocs": true,
"title": "getFeatureFlagResult",
"examples": [
{
"id": "getfeatureflagresult",
"name": "Generated example for getFeatureFlagResult",
"code": "// Generated example for getFeatureFlagResult\ninsights.getFeatureFlagResult();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "key"
},
{
"description": "",
"isOptional": true,
"type": "FeatureFlagResultOptions",
"name": "options"
}
],
"returnType": {
"id": "FeatureFlagResult | undefined",
"name": "FeatureFlagResult | undefined"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getFeatureFlags",
"showDocs": true,
"title": "getFeatureFlags",
"examples": [
{
"id": "getfeatureflags",
"name": "Generated example for getFeatureFlags",
"code": "// Generated example for getFeatureFlags\ninsights.getFeatureFlags();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "InsightsFlagsResponse['featureFlags'] | undefined",
"name": "InsightsFlagsResponse['featureFlags'] | undefined"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "getFeatureFlagsAndPayloads",
"showDocs": true,
"title": "getFeatureFlagsAndPayloads",
"examples": [
{
"id": "getfeatureflagsandpayloads",
"name": "Generated example for getFeatureFlagsAndPayloads",
"code": "// Generated example for getFeatureFlagsAndPayloads\ninsights.getFeatureFlagsAndPayloads();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "{\n flags: InsightsFlagsResponse['featureFlags'] | undefined;\n payloads: InsightsFlagsResponse['featureFlagPayloads'] | undefined;\n }",
"name": "{\n flags: InsightsFlagsResponse['featureFlags'] | undefined;\n payloads: InsightsFlagsResponse['featureFlagPayloads'] | undefined;\n }"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "groupIdentify",
"showDocs": true,
"title": "groupIdentify",
"examples": [
{
"id": "groupidentify",
"name": "Generated example for groupIdentify",
"code": "// Generated example for groupIdentify\ninsights.groupIdentify();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "groupType"
},
{
"description": "",
"isOptional": false,
"type": "string | number",
"name": "groupKey"
},
{
"description": "",
"isOptional": true,
"type": "InsightsEventProperties",
"name": "groupProperties"
},
{
"description": "",
"isOptional": true,
"type": "InsightsCaptureOptions",
"name": "options"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"description": "* ** GROUPS *",
"details": null,
"id": "groups",
"showDocs": true,
"title": "groups",
"examples": [
{
"id": "groups",
"name": "Generated example for groups",
"code": "// Generated example for groups\ninsights.groups();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "InsightsGroupProperties",
"name": "groups"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "on",
"showDocs": true,
"title": "on",
"examples": [
{
"id": "on",
"name": "Generated example for on",
"code": "// Generated example for on\ninsights.on();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "event"
},
{
"description": "",
"isOptional": false,
"type": "(...args: any[]) => void",
"name": "cb"
}
],
"returnType": {
"id": "() => void",
"name": "() => void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "onFeatureFlag",
"showDocs": true,
"title": "onFeatureFlag",
"examples": [
{
"id": "onfeatureflag",
"name": "Generated example for onFeatureFlag",
"code": "// Generated example for onFeatureFlag\ninsights.onFeatureFlag();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "key"
},
{
"description": "",
"isOptional": false,
"type": "(value: FeatureFlagValue) => void",
"name": "cb"
}
],
"returnType": {
"id": "() => void",
"name": "() => void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "onFeatureFlags",
"showDocs": true,
"title": "onFeatureFlags",
"examples": [
{
"id": "onfeatureflags",
"name": "Generated example for onFeatureFlags",
"code": "// Generated example for onFeatureFlags\ninsights.onFeatureFlags();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "(flags: InsightsFlagsResponse['featureFlags']) => void",
"name": "cb"
}
],
"returnType": {
"id": "() => void",
"name": "() => void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "overrideFeatureFlag",
"showDocs": true,
"title": "overrideFeatureFlag",
"examples": [
{
"id": "overridefeatureflag",
"name": "Generated example for overrideFeatureFlag",
"code": "// Generated example for overrideFeatureFlag\ninsights.overrideFeatureFlag();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "InsightsFlagsResponse['featureFlags'] | null",
"name": "flags"
}
],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "registerForSession",
"showDocs": true,
"title": "registerForSession",
"examples": [
{
"id": "registerforsession",
"name": "Generated example for registerForSession",
"code": "// Generated example for registerForSession\ninsights.registerForSession();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "InsightsEventProperties",
"name": "properties"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "reloadRemoteConfigAsync",
"showDocs": true,
"title": "reloadRemoteConfigAsync",
"examples": [
{
"id": "reloadremoteconfigasync",
"name": "Generated example for reloadRemoteConfigAsync",
"code": "// Generated example for reloadRemoteConfigAsync\ninsights.reloadRemoteConfigAsync();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<InsightsRemoteConfig | undefined>",
"name": "Promise<InsightsRemoteConfig | undefined>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"details": null,
"id": "unregisterForSession",
"showDocs": true,
"title": "unregisterForSession",
"examples": [
{
"id": "unregisterforsession",
"name": "Generated example for unregisterForSession",
"code": "// Generated example for unregisterForSession\ninsights.unregisterForSession();"
}
],
"releaseTag": "public",
"params": [
{
"description": "",
"isOptional": false,
"type": "string",
"name": "property"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Initialization",
"description": "Enables or disables debug mode for detailed logging.",
"details": "Debug mode logs all Insights calls to the console for troubleshooting. This is useful during development to understand what data is being sent.",
"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": "",
"isOptional": true,
"type": "boolean",
"name": "enabled"
}
],
"returnType": {
"id": "void",
"name": "void"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "",
"description": "* ** SURVEYS *",
"details": null,
"id": "getSurveysStateless",
"showDocs": true,
"title": "getSurveysStateless",
"examples": [
{
"id": "getsurveysstateless",
"name": "Generated example for getSurveysStateless",
"code": "// Generated example for getSurveysStateless\ninsights.getSurveysStateless();"
}
],
"releaseTag": "public",
"params": [],
"returnType": {
"id": "Promise<SurveyResponse['surveys']>",
"name": "Promise<SurveyResponse['surveys']>"
},
"path": "dist/insights-rn.d.ts"
},
{
"category": "Initialization",
"description": "Shuts down the Insights instance and ensures all events are sent.\nCall shutdown() once before the process exits to ensure that all events have been sent and all promises have resolved. Do not use this function if you intend to keep using this Insights instance after calling it. Use flush() for per-request cleanup instead.",
"details": null,
"id": "shutdown",
"showDocs": true,
"title": "shutdown",
"examples": [
{
"id": "shutdown_before_process_exit",
"name": "shutdown before process exit",
"code": "\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n await insights.shutdown()\n process.exit(0)\n})\n\n\n\n"
}
],
"releaseTag": "public",
"params": [
{
"description": "Maximum time to wait for shutdown in milliseconds",
"isOptional": true,
"type": "number",
"name": "shutdownTimeoutMs"
}
],
"returnType": {
"id": "Promise<void>",
"name": "Promise<void>"
},
"path": "dist/insights-rn.d.ts"
}
]
}
],
"types": [
{
"id": "ActionStepStringMatching",
"name": "ActionStepStringMatching",
"properties": [
{
"type": "\"contains\"",
"name": "Contains"
},
{
"type": "\"exact\"",
"name": "Exact"
},
{
"type": "\"regex\"",
"name": "Regex"
}
],
"path": "../core/src/types.ts"
},
{
"id": "ActionStepType",
"name": "ActionStepType",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n event?: string;\n selector?: string;\n text?: string;\n text_matching?: ActionStepStringMatching;\n href?: string;\n href_matching?: ActionStepStringMatching;\n url?: string;\n url_matching?: ActionStepStringMatching;\n}"
},
{
"id": "AutocaptureOptions",
"name": "AutocaptureOptions",
"properties": [
{
"type": "boolean | LogLevel[]",
"name": "console"
},
{
"type": "boolean",
"name": "uncaughtExceptions"
},
{
"type": "boolean",
"name": "unhandledRejections"
}
],
"path": "dist/error-tracking/index.d.ts"
},
{
"id": "BasicSurveyQuestion",
"name": "BasicSurveyQuestion",
"properties": [],
"path": "../core/src/types.ts",
"example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Open;\n}"
},
{
"id": "BeforeSendFn",
"name": "BeforeSendFn",
"properties": [],
"path": "../core/src/types.ts",
"example": "(event: CaptureEvent | null) => CaptureEvent | null"
},
{
"id": "BeforeSendLogFn",
"name": "BeforeSendLogFn",
"properties": [],
"path": "../core/src/logs/types.ts",
"example": "(record: CaptureLogOptions) => CaptureLogOptions | null"
},
{
"id": "CaptureEvent",
"name": "CaptureEvent",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n uuid?: string;\n event: string;\n properties?: InsightsEventProperties;\n $set?: InsightsEventProperties;\n $set_once?: InsightsEventProperties;\n timestamp?: Date;\n}"
},
{
"id": "CaptureLogger",
"name": "CaptureLogger",
"properties": [],
"path": "../core/src/logs/types.ts"
},
{
"id": "Compression",
"name": "Compression",
"properties": [
{
"type": "\"base64\"",
"name": "Base64"
},
{
"type": "\"gzip-js\"",
"name": "GZipJS"
}
],
"path": "../core/src/types.ts"
},
{
"id": "EndBranching",
"name": "EndBranching",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n type: SurveyQuestionBranchingType.End;\n}"
},
{
"id": "ErrorTrackingOptions",
"name": "ErrorTrackingOptions",
"properties": [
{
"type": "AutocaptureOptions | boolean",
"name": "autocapture"
}
],
"path": "dist/error-tracking/index.d.ts"
},
{
"id": "EvaluationReason",
"name": "EvaluationReason",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n code: string | undefined;\n condition_index: number | undefined;\n description: string | undefined;\n}"
},
{
"id": "FeatureFlagDetail",
"name": "FeatureFlagDetail",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n key: string;\n enabled: boolean;\n variant: string | undefined;\n reason: EvaluationReason | undefined;\n metadata: FeatureFlagMetadata | undefined;\n failed?: boolean;\n}"
},
{
"id": "FeatureFlagMetadata",
"name": "FeatureFlagMetadata",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n id: number | undefined;\n version: number | undefined;\n description: string | undefined;\n payload: string | undefined;\n}"
},
{
"id": "FeatureFlagRequestError",
"name": "FeatureFlagRequestError",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n type: 'timeout' | 'connection_error' | 'api_error' | 'unknown_error';\n statusCode?: number;\n}"
},
{
"id": "FeatureFlagResult",
"name": "FeatureFlagResult",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n readonly key: string;\n readonly enabled: boolean;\n readonly variant?: string;\n readonly payload?: JsonType;\n}"
},
{
"id": "FeatureFlagResultOptions",
"name": "FeatureFlagResultOptions",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n sendEvent?: boolean;\n}"
},
{
"id": "FeatureFlagValue",
"name": "FeatureFlagValue",
"properties": [],
"path": "../core/src/types.ts",
"example": "string | boolean"
},
{
"id": "FeatureFlagWithPayload",
"name": "FeatureFlagWithPayload",
"properties": [],
"path": "dist/hooks/useFeatureFlag.d.ts",
"example": "[FeatureFlagValue | undefined, JsonType | undefined]"
},
{
"id": "FlagsAsyncOptions",
"name": "FlagsAsyncOptions",
"properties": [
{
"type": "boolean",
"name": "fetchConfig"
},
{
"type": "boolean",
"name": "sendAnonDistinctId"
},
{
"type": "boolean",
"name": "triggerOnRemoteConfig"
}
],
"path": "../core/src/insights-core.ts"
},
{
"id": "GetFlagsResult",
"name": "GetFlagsResult",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n success: true;\n response: InsightsFeatureFlagsResponse;\n} | {\n success: false;\n error: FeatureFlagRequestError;\n}"
},
{
"id": "JsonType",
"name": "JsonType",
"properties": [],
"path": "../core/src/types.ts",
"example": "string | number | boolean | null | {\n [key: string]: JsonType;\n} | Array<JsonType> | JsonType[]"
},
{
"id": "LinkSurveyQuestion",
"name": "LinkSurveyQuestion",
"properties": [],
"path": "../core/src/types.ts",
"example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Link;\n link?: string | null;\n}"
},
{
"id": "Logger",
"name": "Logger",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n debug: (...args: any[]) => void;\n info: (...args: any[]) => void;\n warn: (...args: any[]) => void;\n error: (...args: any[]) => void;\n critical: (...args: any[]) => void;\n createLogger: (prefix: string) => Logger;\n}"
},
{
"id": "LogLevel",
"name": "LogLevel",
"properties": [],
"path": "dist/error-tracking/index.d.ts",
"example": "\"debug\" | \"log\" | \"info\" | \"warn\" | \"error\""
},
{
"id": "MultipleSurveyQuestion",
"name": "MultipleSurveyQuestion",
"properties": [],
"path": "../core/src/types.ts",
"example": "SurveyQuestionBase & {\n type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n choices: string[];\n hasOpenChoice?: boolean;\n shuffleOptions?: boolean;\n skipSubmitButton?: boolean;\n}"
},
{
"id": "NextQuestionBranching",
"name": "NextQuestionBranching",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n type: SurveyQuestionBranchingType.NextQuestion;\n}"
},
{
"id": "PartialWithRequired",
"name": "PartialWithRequired",
"properties": [],
"path": "../core/src/types.ts",
"example": "keyof T> = {\n [P in K]: T[P];\n} & {\n [P in Exclude<keyof T, K>]?: T[P];\n}"
},
{
"id": "InsightsAutocaptureElement",
"name": "InsightsAutocaptureElement",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n $el_text?: string;\n tag_name: string;\n href?: string;\n nth_child?: number;\n nth_of_type?: number;\n order?: number;\n} & InsightsEventProperties"
},
{
"id": "InsightsAutocaptureNavigationTrackerOptions",
"name": "InsightsAutocaptureNavigationTrackerOptions",
"properties": [],
"path": "dist/types.d.ts",
"example": "{\n routeToName?: (name: string, params: any) => string;\n routeToProperties?: (name: string, params: any) => Record<string, any>;\n}"
},
{
"id": "InsightsAutocaptureOptions",
"name": "InsightsAutocaptureOptions",
"properties": [],
"path": "dist/types.d.ts",
"example": "{\n captureTouches?: boolean;\n customLabelProp?: string;\n noCaptureProp?: string;\n maxElementsCaptured?: number;\n ignoreLabels?: string[];\n propsToCapture?: string[];\n captureScreens?: boolean;\n navigation?: InsightsAutocaptureNavigationTrackerOptions;\n navigationRef?: InsightsNavigationRef;\n}"
},
{
"id": "InsightsCaptureOptions",
"name": "InsightsCaptureOptions",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n uuid?: string;\n timestamp?: Date;\n disableGeoip?: boolean;\n _originatedFromCaptureException?: boolean;\n}"
},
{
"id": "InsightsCoreOptions",
"name": "InsightsCoreOptions",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n host?: string;\n flushAt?: number;\n flushInterval?: number;\n maxBatchSize?: number;\n maxQueueSize?: number;\n disabled?: boolean;\n defaultOptIn?: boolean;\n sendFeatureFlagEvent?: boolean;\n preloadFeatureFlags?: boolean;\n disableRemoteConfig?: boolean;\n disableSurveys?: boolean;\n bootstrap?: {\n distinctId?: string;\n isIdentifiedId?: boolean;\n featureFlags?: Record<string, FeatureFlagValue>;\n featureFlagPayloads?: Record<string, JsonType>;\n };\n fetchRetryCount?: number;\n fetchRetryDelay?: number;\n requestTimeout?: number;\n featureFlagsRequestTimeoutMs?: number;\n remoteConfigRequestTimeoutMs?: number;\n sessionExpirationTimeSeconds?: number;\n disableCompression?: boolean;\n disableGeoip?: boolean;\n historicalMigration?: boolean;\n evaluationContexts?: readonly string[];\n evaluationEnvironments?: readonly string[];\n personProfiles?: 'always' | 'identified_only' | 'never';\n before_send?: BeforeSendFn | BeforeSendFn[];\n addTracingHeaders?: string[];\n}"
},
{
"id": "InsightsCustomAppProperties",
"name": "InsightsCustomAppProperties",
"properties": [
{
"description": "Build number like \"1.2.2\" or \"122\"",
"type": "string | null",
"name": "$app_build"
},
{
"description": "Name of the app as displayed below the icon like \"Insights\"",
"type": "string | null",
"name": "$app_name"
},
{
"description": "Namespace of the app usually like \"com.insights.app\"",
"type": "string | null",
"name": "$app_namespace"
},
{
"description": "Human friendly app version like what a user would see in the app store like \"1.2.2\"",
"type": "string | null",
"name": "$app_version"
},
{
"description": "Manufacturer like \"Apple\", \"Samsung\" or \"Android\"",
"type": "string | null",
"name": "$device_manufacturer"
},
{
"description": "Model identifier like \"iPhone13,2\" or \"SM-S921B\"",
"type": "string | null",
"name": "$device_model"
},
{
"description": "Readable model name like \"iPhone 12\" or \"Samsung Galaxy S24\"",
"type": "string | null",
"name": "$device_name"
},
{
"description": "Device type (\"Mobile\" | \"Desktop\")",
"type": "string | null",
"name": "$device_type"
},
{
"description": "Whether the app is running on an emulator/simulator",
"type": "boolean | null",
"name": "$is_emulator"
},
{
"description": "Locale (language) of the device like \"en-US\"",
"type": "string | null",
"name": "$locale"
},
{
"description": "Operating system name like iOS or Android",
"type": "string | null",
"name": "$os_name"
},
{
"description": "Operating system version \"14.0\"",
"type": "string | null",
"name": "$os_version"
},
{
"description": "Timezone of the device like \"Europe/Berlin\"",
"type": "string | null",
"name": "$timezone"
}
],
"path": "dist/types.d.ts"
},
{
"id": "InsightsCustomStorage",
"name": "InsightsCustomStorage",
"properties": [
{
"type": "(key: string) => string | null | Promise<string | null>",
"name": "getItem"
},
{
"type": "(key: string, value: string) => void | Promise<void>",
"name": "setItem"
}
],
"path": "dist/types.d.ts"
},
{
"id": "InsightsErrorBoundaryFallbackProps",
"name": "InsightsErrorBoundaryFallbackProps",
"properties": [],
"path": "dist/InsightsErrorBoundary.d.ts",
"example": "{\n error: unknown;\n componentStack: string;\n}"
},
{
"id": "InsightsErrorBoundaryProps",
"name": "InsightsErrorBoundaryProps",
"properties": [],
"path": "dist/InsightsErrorBoundary.d.ts",
"example": "{\n children?: React.ReactNode | (() => React.ReactNode);\n fallback?: React.ReactNode | FunctionComponent<InsightsErrorBoundaryFallbackProps>;\n additionalProperties?: Properties | ((error: unknown) => Properties);\n}"
},
{
"id": "InsightsErrorBoundaryState",
"name": "InsightsErrorBoundaryState",
"properties": [],
"path": "dist/InsightsErrorBoundary.d.ts",
"example": "{\n componentStack: string | null;\n error: unknown;\n}"
},
{
"id": "InsightsEventProperties",
"name": "InsightsEventProperties",
"properties": [],
"path": "../core/src/types.ts",
"example": "// Properties for React Native events\n{\n event: 'user_signed_up',\n userId: 'user123',\n timestamp: new Date().toISOString(),\n distinct_id: 'user123',\n $set: {\n email: '[email protected]',\n name: 'John Doe'\n }\n}"
},
{
"id": "InsightsFeatureFlagDetails",
"name": "InsightsFeatureFlagDetails",
"properties": [],
"path": "../core/src/types.ts",
"example": "\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\""
},
{
"id": "InsightsFeatureFlagsResponse",
"name": "InsightsFeatureFlagsResponse",
"properties": [],
"path": "../core/src/types.ts",
"example": "\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\""
},
{
"id": "InsightsFetchOptions",
"name": "InsightsFetchOptions",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n method: 'GET' | 'POST' | 'PUT' | 'PATCH';\n mode?: 'no-cors';\n credentials?: 'omit';\n headers: {\n [key: string]: string;\n };\n body?: string | Blob;\n signal?: AbortSignal;\n}"
},
{
"id": "InsightsFetchResponse",
"name": "InsightsFetchResponse",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n status: number;\n text: () => Promise<string>;\n json: () => Promise<any>;\n headers?: {\n get(name: string): string | null;\n };\n body?: ReadableStream<Uint8Array> | null;\n}"
},
{
"id": "InsightsFlagsResponse",
"name": "InsightsFlagsResponse",
"properties": [],
"path": "../core/src/types.ts",
"example": "Omit<InsightsRemoteConfig, 'hasFeatureFlags'> & {\n featureFlags: {\n [key: string]: FeatureFlagValue;\n };\n featureFlagPayloads: {\n [key: string]: JsonType;\n };\n flags: {\n [key: string]: FeatureFlagDetail;\n };\n errorsWhileComputingFlags: boolean;\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n quotaLimited?: string[];\n requestId?: string;\n evaluatedAt?: number;\n}"
},
{
"id": "InsightsGroupProperties",
"name": "InsightsGroupProperties",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n [type: string]: string | number;\n}"
},
{
"id": "InsightsLogsConfig",
"name": "InsightsLogsConfig",
"properties": [
{
"description": "Pre-send filter. See for shape and examples. Configure as a single function or a chain.",
"type": "BeforeSendLogFn | BeforeSendLogFn[]",
"name": "beforeSend"
},
{
"description": "Deployment environment attached as OTLP `deployment.environment` (e.g. `'production'`, `'staging'`, `'dev'`).",
"type": "string",
"name": "environment"
},
{
"description": "How often the periodic background flush fires (ms). Records also flush eagerly when the buffer fills, on AppState changes (RN), and on `shutdown()`. Lower values trade battery/bandwidth for fresher data. Default: 10000 (RN) / 3000 (browser).",
"type": "number",
"name": "flushIntervalMs"
},
{
"description": "Max records per outbound POST. Keeps each request under the server's 2 MB cap. On a 413 response, the SDK halves this value, retries the same records, then ramps back up by 1 per healthy send. A 413 on a single-record batch drops the record (it's larger than the server can accept regardless of batch size). Default: 50 (RN) / 100 (browser).",
"type": "number",
"name": "maxBatchRecordsPerPost"
},
{
"description": "Max records held in memory before the queue evicts the oldest on push (FIFO). Bounds memory footprint and on-disk-queue size. When the buffer hits this size, an immediate flush is triggered to reclaim space; if the flush hasn't completed before the next capture, the oldest record is shifted out. Default: 100.",
"type": "number",
"name": "maxBufferSize"
},
{
"description": "Tumbling-window rate cap. Bounds how many records can be captured within a sliding (technically tumbling) time window. Records exceeding the cap are dropped synchronously at `captureLog()` (they never enter the buffer or consume bandwidth). A single warn line is logged per window when the cap is hit.\nDefaults are per-SDK; on RN the default is `{ maxLogs: 500, windowMs: 10000 }` (≈50 logs/sec ceiling, tuned for cellular bandwidth).",
"type": "{\n maxLogs?: number;\n windowMs?: number;\n }",
"name": "rateCap"
},
{
"description": "Extra OTLP resource attributes attached to every record. Spread first; SDK-controlled keys (`service.name`, `telemetry.sdk.*`, RN's `os.*`) are layered on top so users cannot accidentally clobber them. Use the dedicated `serviceName` / `environment` / `serviceVersion` fields to override those keys.",
"type": "Record<string, LogAttributeValue>",
"name": "resourceAttributes"
},
{
"description": "Service name attached to every record as the OTLP `service.name` resource attribute. Used by the Logs UI for filtering / grouping. Default: `'unknown_service'`.",
"type": "string",
"name": "serviceName"
},
{
"description": "Service version attached as OTLP `service.version`. Useful for correlating regressions to specific app releases.",
"type": "string",
"name": "serviceVersion"
}
],
"path": "../core/src/logs/types.ts"
},
{
"id": "InsightsMaskViewProps",
"name": "InsightsMaskViewProps",
"properties": [
{
"description": "The child components to mask from Insights capture",
"type": "React.ReactNode",
"name": "children"
}
],
"path": "dist/InsightsMaskView.d.ts"
},
{
"id": "InsightsNavigationRef",
"name": "InsightsNavigationRef",
"properties": [],
"path": "dist/types.d.ts",
"example": "{\n getCurrentRoute(): any | undefined;\n isReady: () => boolean;\n current?: InsightsNavigationRef | any | undefined;\n}"
},
{
"id": "InsightsOptions",
"name": "InsightsOptions",
"properties": [
{
"description": "Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded. Application Installed and Application Updated events are not supported with persistence set to 'memory'.\ntrue",
"type": "boolean",
"name": "captureAppLifecycleEvents"
},
{
"description": "Allows you to provide your own implementation of the common information about your App or a function to modify the default App properties generated",
"type": "InsightsCustomAppProperties | ((properties: InsightsCustomAppProperties) => InsightsCustomAppProperties)",
"name": "customAppProperties"
},
{
"description": "Allows you to provide a custom asynchronous storage such as async-storage, expo-file-system or a synchronous storage such as mmkv. If not provided, Insights will attempt to use the best available storage via optional peer dependencies (async-storage, expo-file-system). If `persistence` is set to 'memory', this option will be ignored.",
"type": "InsightsCustomStorage",
"name": "customStorage"
},
{
"description": "If enabled, the session id ($session_id) will be persisted across app restarts. This is an option for back compatibility, so your current data isn't skewed with the new version of the SDK. If this is false, the session id will be always reset on app restart.\nfalse",
"type": "boolean",
"name": "enablePersistSessionIdAcrossRestart"
},
{
"description": "Enable Recording of Session Replays for Android and iOS Requires Record user sessions to be enabled in the Insights Project Settings\nfalse",
"type": "boolean",
"name": "enableSessionReplay"
},
{
"description": "Error Tracking Configuration",
"type": "ErrorTrackingOptions",
"name": "errorTracking"
},
{
"description": "Logs feature configuration. Enables structured log capture via `insights.captureLog(...)` or `insights.logger.info(...)`. Records ship to Insights's logs product (`/i/v1/logs`) in OTLP format, batched on a timer, AppState change, buffer fill, or manual `flushLogs()`.\nCapture is **unconditional** — calling the API ships records as long as the SDK is initialized and the user hasn't opted out. The only blockers are `optedOut`, missing/empty `body`, and missing API key.\nAll fields below are optional; per-SDK defaults apply (mobile defaults are tuned for cellular bandwidth and battery, ~50 logs/sec ceiling).",
"type": "InsightsLogsConfig",
"name": "logs"
},
{
"description": "Overrides the language used when rendering translated survey copy. When unset, the SDK falls back to the persisted person property `language` and then the device locale.",
"type": "string | null",
"name": "overrideDisplayLanguage"
},
{
"description": "Allows you to provide the storage type. 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage.\n'file'",
"type": "'memory' | 'file'",
"name": "persistence"
},
{
"description": "Configuration for Session Replay",
"type": "InsightsSessionReplayConfig",
"name": "sessionReplayConfig"
},
{
"description": "Automatically include common device and app properties in feature flag evaluation.\nWhen enabled, the following properties are sent with every /flags request: - $app_version: App version - $app_build: App build number - $app_namespace: App bundle identifier / namespace - $os_name: Operating system name - $os_version: Operating system version - $device_type: Device type (Mobile, Desktop) - $lib: Name of the SDK library - $lib_version: Version of the SDK library\nThis ensures feature flags that rely on these properties work correctly without waiting for server-side processing of identify() calls.\ntrue",
"type": "boolean",
"name": "setDefaultPersonProperties"
}
],
"path": "dist/insights-rn.d.ts"
},
{
"id": "InsightsPersistedProperty",
"name": "InsightsPersistedProperty",
"properties": [
{
"type": "\"anonymous_id\"",
"name": "AnonymousId"
},
{
"type": "\"bootstrap_feature_flag_details\"",
"name": "BootstrapFeatureFlagDetails"
},
{
"type": "\"bootstrap_feature_flag_payloads\"",
"name": "BootstrapFeatureFlagPayloads"
},
{
"type": "\"bootstrap_feature_flags\"",
"name": "BootstrapFeatureFlags"
},
{
"type": "\"device_id\"",
"name": "DeviceId"
},
{
"type": "\"distinct_id\"",
"name": "DistinctId"
},
{
"type": "\"enable_person_processing\"",
"name": "EnablePersonProcessing"
},
{
"type": "\"feature_flag_details\"",
"name": "FeatureFlagDetails"
},
{
"type": "\"feature_flag_payloads\"",
"name": "FeatureFlagPayloads"
},
{
"type": "\"feature_flags\"",
"name": "FeatureFlags"
},
{
"type": "\"flags_endpoint_was_hit\"",
"name": "FlagsEndpointWasHit"
},
{
"type": "\"group_properties\"",
"name": "GroupProperties"
},
{
"type": "\"installed_app_build\"",
"name": "InstalledAppBuild"
},
{
"type": "\"installed_app_version\"",
"name": "InstalledAppVersion"
},
{
"type": "\"logs_queue\"",
"name": "LogsQueue"
},
{
"type": "\"opted_out\"",
"name": "OptedOut"
},
{
"type": "\"override_feature_flags\"",
"name": "OverrideFeatureFlags"
},
{
"type": "\"person_mode\"",
"name": "PersonMode"
},
{
"type": "\"person_properties\"",
"name": "PersonProperties"
},
{
"type": "\"props\"",
"name": "Props"
},
{
"type": "\"queue\"",
"name": "Queue"
},
{
"type": "\"remote_config\"",
"name": "RemoteConfig"
},
{
"type": "\"session_id\"",
"name": "SessionId"
},
{
"type": "\"session_timestamp\"",
"name": "SessionLastTimestamp"
},
{
"type": "\"session_replay\"",
"name": "SessionReplay"
},
{
"type": "\"session_start_timestamp\"",
"name": "SessionStartTimestamp"
},
{
"type": "\"survey_last_seen_date\"",
"name": "SurveyLastSeenDate"
},
{
"type": "\"surveys\"",
"name": "Surveys"
},
{
"type": "\"surveys_seen\"",
"name": "SurveysSeen"
}
],
"path": "../core/src/types.ts"
},
{
"id": "InsightsProviderProps",
"name": "InsightsProviderProps",
"properties": [
{
"description": "Your Insights API key",
"type": "string",
"name": "apiKey"
},
{
"description": "Autocapture configuration - can be a boolean or detailed options.\nWhen not set, the default behavior is: - `captureScreens`: true - `captureTouches`: false - `captureAppLifecycleEvents`: true\nSet to `true` to enable all autocapture features (including touches). Set to `false` to disable all autocapture features.",
"type": "boolean | InsightsAutocaptureOptions",
"name": "autocapture"
},
{
"description": "The child components to render within the Insights context",
"type": "React.ReactNode",
"name": "children"
},
{
"description": "An existing Insights client instance",
"type": "Insights",
"name": "client"
},
{
"description": "Enable debug mode for additional logging\nfalse",
"type": "boolean",
"name": "debug"
},
{
"description": "Insights configuration options",
"type": "InsightsOptions",
"name": "options"
},
{
"description": "Custom styles for the provider wrapper View",
"type": "StyleProp<ViewStyle>",
"name": "style"
}
],
"path": "dist/InsightsProvider.d.ts"
},
{
"id": "InsightsReactNativeSessionReplayExtended",
"name": "InsightsReactNativeSessionReplayExtended",
"properties": [],
"path": "dist/optional/OptionalSessionReplay.d.ts",
"example": "typeof InsightsReactNativeSessionReplay & {\n startRecording?: (resumeCurrent: boolean) => Promise<void>;\n stopRecording?: () => Promise<void>;\n}"
},
{
"id": "InsightsRemoteConfig",
"name": "InsightsRemoteConfig",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n sessionRecording?: boolean | {\n [key: string]: JsonType;\n };\n supportedCompression?: Compression[];\n surveys?: boolean | Survey[];\n hasFeatureFlags?: boolean;\n errorTracking?: boolean | {\n [key: string]: JsonType;\n };\n capturePerformance?: boolean | {\n [key: string]: JsonType;\n };\n logs?: boolean | {\n [key: string]: JsonType;\n };\n}"
},
{
"id": "InsightsSessionReplayConfig",
"name": "InsightsSessionReplayConfig",
"properties": [],
"path": "dist/types.d.ts",
"example": "{\n maskAllTextInputs?: boolean;\n maskAllImages?: boolean;\n maskAllSandboxedViews?: boolean;\n captureLog?: boolean;\n iOSdebouncerDelayMs?: number;\n androidDebouncerDelayMs?: number;\n throttleDelayMs?: number;\n captureNetworkTelemetry?: boolean;\n screenshotModeBackgroundCapture?: boolean;\n sampleRate?: number;\n}"
},
{
"id": "InsightsSurveyProviderProps",
"name": "InsightsSurveyProviderProps",
"properties": [],
"path": "dist/surveys/InsightsSurveyProvider.d.ts",
"example": "{\n defaultSurveyAppearance?: SurveyAppearance;\n overrideAppearanceWithDefault?: boolean;\n androidKeyboardBehavior?: 'padding' | 'height';\n client?: Insights;\n children: React.ReactNode;\n}"
},
{
"id": "Properties",
"name": "Properties",
"properties": [],
"path": "dist/InsightsErrorBoundary.d.ts",
"example": "Record<string, any>"
},
{
"id": "RatingSurveyQuestion",
"name": "RatingSurveyQuestion",
"properties": [],
"path": "../core/src/types.ts",
"example": "SurveyQuestionBase & {\n type: SurveyQuestionType.Rating;\n display: SurveyRatingDisplay;\n scale: 2 | 3 | 5 | 7 | 10;\n lowerBoundLabel: string;\n upperBoundLabel: string;\n skipSubmitButton?: boolean;\n}"
},
{
"id": "ResponseBasedBranching",
"name": "ResponseBasedBranching",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n type: SurveyQuestionBranchingType.ResponseBased;\n responseValues: Record<string, any>;\n}"
},
{
"id": "RetriableOptions",
"name": "RetriableOptions",
"properties": [
{
"type": "(err: unknown) => boolean",
"name": "retryCheck"
},
{
"type": "number",
"name": "retryCount"
},
{
"type": "number",
"name": "retryDelay"
}
],
"path": "../core/src/utils/index.ts"
},
{
"id": "SendLogsBatchOutcome",
"name": "SendLogsBatchOutcome",
"properties": [],
"path": "../core/src/insights-core-stateless.ts",
"example": "{\n kind: 'ok';\n} | {\n kind: 'too-large';\n} | {\n kind: 'retry-later';\n error: unknown;\n} | {\n kind: 'fatal';\n error: unknown;\n}"
},
{
"id": "SpecificQuestionBranching",
"name": "SpecificQuestionBranching",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n type: SurveyQuestionBranchingType.SpecificQuestion;\n index: number;\n}"
},
{
"id": "Survey",
"name": "Survey",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n id: string;\n name: string;\n description?: string;\n type: SurveyType;\n translations?: Record<string, SurveyTranslation>;\n feature_flag_keys?: {\n key: string;\n value?: string;\n }[];\n linked_flag_key?: string;\n targeting_flag_key?: string;\n internal_targeting_flag_key?: string;\n questions: SurveyQuestion[];\n appearance?: SurveyAppearance;\n conditions?: {\n url?: string;\n selector?: string;\n seenSurveyWaitPeriodInDays?: number;\n urlMatchType?: SurveyMatchType;\n events?: {\n repeatedActivation?: boolean;\n values?: {\n name: string;\n }[];\n };\n actions?: {\n values: SurveyActionType[];\n };\n deviceTypes?: string[];\n deviceTypesMatchType?: SurveyMatchType;\n linkedFlagVariant?: string;\n };\n start_date?: string;\n end_date?: string;\n current_iteration?: number;\n current_iteration_start_date?: string;\n schedule?: SurveySchedule;\n}"
},
{
"id": "SurveyActionType",
"name": "SurveyActionType",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n id: number;\n name?: string;\n steps?: ActionStepType[];\n}"
},
{
"id": "SurveyAppearance",
"name": "SurveyAppearance",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n backgroundColor?: string;\n textColor?: string;\n submitButtonColor?: string;\n submitButtonText?: string;\n submitButtonTextColor?: string;\n ratingButtonColor?: string;\n ratingButtonActiveColor?: string;\n inputBackground?: string;\n inputTextColor?: string;\n autoDisappear?: boolean;\n displayThankYouMessage?: boolean;\n thankYouMessageHeader?: string;\n thankYouMessageDescription?: string;\n thankYouMessageDescriptionContentType?: SurveyQuestionDescriptionContentType;\n thankYouMessageCloseButtonText?: string;\n borderColor?: string;\n position?: SurveyPosition;\n placeholder?: string;\n shuffleQuestions?: boolean;\n surveyPopupDelaySeconds?: number;\n widgetType?: SurveyWidgetType;\n widgetSelector?: string;\n widgetLabel?: string;\n widgetColor?: string;\n}"
},
{
"id": "SurveyAppearanceTheme",
"name": "SurveyAppearanceTheme",
"properties": [],
"path": "dist/surveys/surveys-utils.d.ts",
"example": "Omit<Required<SurveyAppearance>, 'widgetSelector' | 'widgetType' | 'widgetColor' | 'widgetLabel' | 'shuffleQuestions' | 'textColor' | 'inputTextColor'> & {\n textColor?: string;\n inputTextColor?: string;\n}"
},
{
"id": "SurveyMatchType",
"name": "SurveyMatchType",
"properties": [
{
"type": "\"exact\"",
"name": "Exact"
},
{
"type": "\"icontains\"",
"name": "Icontains"
},
{
"type": "\"is_not\"",
"name": "IsNot"
},
{
"type": "\"not_icontains\"",
"name": "NotIcontains"
},
{
"type": "\"not_regex\"",
"name": "NotRegex"
},
{
"type": "\"regex\"",
"name": "Regex"
}
],
"path": "../core/src/types.ts"
},
{
"id": "SurveyModalProps",
"name": "SurveyModalProps",
"properties": [],
"path": "dist/surveys/components/SurveyModal.d.ts",
"example": "{\n survey: Survey;\n surveyLanguage: string | null;\n appearance: SurveyAppearanceTheme;\n onShow: () => void;\n onClose: (submitted: boolean, responses: SurveyResponses) => void;\n androidKeyboardBehavior?: 'padding' | 'height';\n}"
},
{
"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": "\"right\"",
"name": "Right"
},
{
"type": "\"top_center\"",
"name": "TopCenter"
},
{
"type": "\"top_left\"",
"name": "TopLeft"
},
{
"type": "\"top_right\"",
"name": "TopRight"
}
],
"path": "../core/src/types.ts"
},
{
"id": "SurveyQuestion",
"name": "SurveyQuestion",
"properties": [],
"path": "../core/src/types.ts",
"example": "BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion"
},
{
"id": "SurveyQuestionBase",
"name": "SurveyQuestionBase",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n question: string;\n id: string;\n description?: string | null;\n descriptionContentType?: SurveyQuestionDescriptionContentType;\n optional?: boolean;\n buttonText?: string;\n originalQuestionIndex: number;\n branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n validation?: SurveyValidationRule[];\n translations?: Record<string, SurveyQuestionTranslation>;\n}"
},
{
"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": "../core/src/types.ts"
},
{
"id": "SurveyQuestionDescriptionContentType",
"name": "SurveyQuestionDescriptionContentType",
"properties": [
{
"type": "\"html\"",
"name": "Html"
},
{
"type": "\"text\"",
"name": "Text"
}
],
"path": "../core/src/types.ts"
},
{
"id": "SurveyQuestionTranslation",
"name": "SurveyQuestionTranslation",
"properties": [
{
"type": "string",
"name": "buttonText"
},
{
"type": "string[]",
"name": "choices"
},
{
"type": "string | null",
"name": "description"
},
{
"type": "string | null",
"name": "link"
},
{
"type": "string",
"name": "lowerBoundLabel"
},
{
"type": "string",
"name": "question"
},
{
"type": "string",
"name": "upperBoundLabel"
}
],
"path": "../core/src/types.ts"
},
{
"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": "../core/src/types.ts"
},
{
"id": "SurveyRatingDisplay",
"name": "SurveyRatingDisplay",
"properties": [
{
"type": "\"emoji\"",
"name": "Emoji"
},
{
"type": "\"number\"",
"name": "Number"
}
],
"path": "../core/src/types.ts"
},
{
"id": "SurveyResponse",
"name": "SurveyResponse",
"properties": [],
"path": "../core/src/types.ts",
"example": "{\n surveys: Survey[];\n}"
},
{
"id": "SurveyResponses",
"name": "SurveyResponses",
"properties": [],
"path": "../core/src/types.ts",
"example": "Record<string, SurveyResponseValue>"
},
{
"id": "SurveyResponseValue",
"name": "SurveyResponseValue",
"properties": [],
"path": "../core/src/types.ts",
"example": "string | number | string[] | null"
},
{
"id": "SurveySchedule",
"name": "SurveySchedule",
"properties": [
{
"type": "\"always\"",
"name": "Always"
},
{
"type": "\"once\"",
"name": "Once"
},
{
"type": "\"recurring\"",
"name": "Recurring"
}
],
"path": "../core/src/types.ts"
},
{
"id": "SurveyTranslation",
"name": "SurveyTranslation",
"properties": [
{
"type": "string",
"name": "name"
},
{
"type": "string",
"name": "thankYouMessageCloseButtonText"
},
{
"type": "string",
"name": "thankYouMessageDescription"
},
{
"type": "string",
"name": "thankYouMessageHeader"
}
],
"path": "../core/src/types.ts"
},
{
"id": "SurveyType",
"name": "SurveyType",
"properties": [
{
"type": "\"api\"",
"name": "API"
},
{
"type": "\"external_survey\"",
"name": "ExternalSurvey"
},
{
"type": "\"popover\"",
"name": "Popover"
},
{
"type": "\"widget\"",
"name": "Widget"
}
],
"path": "../core/src/types.ts"
},
{
"id": "SurveyValidationRule",
"name": "SurveyValidationRule",
"properties": [
{
"type": "string",
"name": "errorMessage"
},
{
"type": "SurveyValidationType",
"name": "type"
},
{
"type": "number",
"name": "value"
}
],
"path": "../core/src/types.ts"
},
{
"id": "SurveyValidationType",
"name": "SurveyValidationType",
"properties": [
{
"type": "\"max_length\"",
"name": "MaxLength"
},
{
"type": "\"min_length\"",
"name": "MinLength"
}
],
"path": "../core/src/types.ts"
},
{
"id": "SurveyWidgetType",
"name": "SurveyWidgetType",
"properties": [
{
"type": "\"button\"",
"name": "Button"
},
{
"type": "\"selector\"",
"name": "Selector"
},
{
"type": "\"tab\"",
"name": "Tab"
}
],
"path": "../core/src/types.ts"
}
],
"categories": [
"Initialization",
"Identification",
"Capture",
"Error tracking",
"Feature flags",
"Group analytics",
"Session Replay",
"Privacy",
"LLM analytics"
]
}