{"data":[{"id":1,"attributes":{"referenceId":"posthog-python","version":"6.7.10","data":{"id":"posthog-python-6.7.10","info":{"id":"posthog-python","title":"PostHog Python SDK","specUrl":"https://github.com/PostHog/posthog-python","version":"6.7.10","slugPrefix":"posthog-python","description":"Integrate PostHog into any python application."},"types":[{"id":"FeatureFlag","name":"FeatureFlag","path":"posthog.types.FeatureFlag","example":"","properties":[{"name":"key","type":"str","description":"Field: key"},{"name":"enabled","type":"bool","description":"Field: enabled"},{"name":"variant","type":"Optional[str]","description":"Field: variant"},{"name":"reason","type":"Optional[FlagReason]","description":"Field: reason"},{"name":"metadata","type":"Union[FlagMetadata, LegacyFlagMetadata]","description":"Field: metadata"}]},{"id":"FeatureFlagResult","name":"FeatureFlagResult","path":"posthog.types.FeatureFlagResult","example":"","properties":[{"name":"key","type":"str","description":"Field: key"},{"name":"enabled","type":"bool","description":"Field: enabled"},{"name":"variant","type":"Optional[str]","description":"Field: variant"},{"name":"payload","type":"Optional[Any]","description":"Field: payload"},{"name":"reason","type":"Optional[str]","description":"Field: reason"}]},{"id":"FlagMetadata","name":"FlagMetadata","path":"posthog.types.FlagMetadata","example":"","properties":[{"name":"id","type":"int","description":"Field: id"},{"name":"payload","type":"Optional[str]","description":"Field: payload"},{"name":"version","type":"int","description":"Field: version"},{"name":"description","type":"str","description":"Field: description"}]},{"id":"FlagReason","name":"FlagReason","path":"posthog.types.FlagReason","example":"","properties":[{"name":"code","type":"str","description":"Field: code"},{"name":"condition_index","type":"Optional[int]","description":"Field: condition_index"},{"name":"description","type":"str","description":"Field: description"}]},{"id":"FlagsAndPayloads","name":"FlagsAndPayloads","path":"posthog.types.FlagsAndPayloads","example":"","properties":[{"name":"featureFlags","type":"Optional[dict[str, Union[bool, str]]]","description":"Field: featureFlags"},{"name":"featureFlagPayloads","type":"Optional[dict[str, Any]]","description":"Field: featureFlagPayloads"}]},{"id":"FlagsResponse","name":"FlagsResponse","path":"posthog.types.FlagsResponse","example":"","properties":[{"name":"flags","type":"dict[str, FeatureFlag]","description":"Field: flags"},{"name":"errorsWhileComputingFlags","type":"bool","description":"Field: errorsWhileComputingFlags"},{"name":"requestId","type":"str","description":"Field: requestId"},{"name":"quotaLimit","type":"Optional[list[str]]","description":"Field: quotaLimit"}]},{"id":"LegacyFlagMetadata","name":"LegacyFlagMetadata","path":"posthog.types.LegacyFlagMetadata","example":"","properties":[{"name":"payload","type":"Any","description":"Field: payload"}]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"posthog.types.SendFeatureFlagsOptions","example":"","properties":[{"name":"should_send","type":"bool","description":"Field: should_send"},{"name":"only_evaluate_locally","type":"Optional[bool]","description":"Field: only_evaluate_locally"},{"name":"person_properties","type":"Optional[dict[str, Any]]","description":"Field: person_properties"},{"name":"group_properties","type":"Optional[dict[str, dict[str, Any]]]","description":"Field: group_properties"},{"name":"flag_keys_filter","type":"Optional[list[str]]","description":"Field: flag_keys_filter"}]},{"id":"OptionalCaptureArgs","name":"OptionalCaptureArgs","path":"posthog.args.OptionalCaptureArgs","example":"","properties":[{"name":"distinct_id","type":"NotRequired[Union[Number, str, UUID, int, any]]","description":"Field: distinct_id"},{"name":"properties","type":"NotRequired[Optional[dict[str, Any]]]","description":"Field: properties"},{"name":"timestamp","type":"NotRequired[Union[datetime, str, any]]","description":"Field: timestamp"},{"name":"uuid","type":"NotRequired[Optional[str]]","description":"Field: uuid"},{"name":"groups","type":"NotRequired[Optional[dict[str, str]]]","description":"Field: groups"},{"name":"send_feature_flags","type":"NotRequired[Union[bool, SendFeatureFlagsOptions, any]]","description":"Field: send_feature_flags"},{"name":"disable_geoip","type":"NotRequired[Optional[bool]]","description":"Field: disable_geoip"}]},{"id":"OptionalSetArgs","name":"OptionalSetArgs","path":"posthog.args.OptionalSetArgs","example":"","properties":[{"name":"distinct_id","type":"NotRequired[Union[Number, str, UUID, int, any]]","description":"Field: distinct_id"},{"name":"properties","type":"NotRequired[Optional[dict[str, Any]]]","description":"Field: properties"},{"name":"timestamp","type":"NotRequired[Union[datetime, str, any]]","description":"Field: timestamp"},{"name":"uuid","type":"NotRequired[Optional[str]]","description":"Field: uuid"},{"name":"disable_geoip","type":"NotRequired[Optional[bool]]","description":"Field: disable_geoip"}]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"posthog.types.SendFeatureFlagsOptions","example":"","properties":[{"name":"should_send","type":"bool","description":"Field: should_send"},{"name":"only_evaluate_locally","type":"Optional[bool]","description":"Field: only_evaluate_locally"},{"name":"person_properties","type":"Optional[dict[str, Any]]","description":"Field: person_properties"},{"name":"group_properties","type":"Optional[dict[str, dict[str, Any]]]","description":"Field: group_properties"},{"name":"flag_keys_filter","type":"Optional[list[str]]","description":"Field: flag_keys_filter"}]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"__init__","title":"Client","params":[{"name":"project_api_key","type":"str","isOptional":true,"description":"The project API key."},{"name":"host","type":"any","isOptional":false,"description":"The host to use for the client."},{"name":"debug","type":"bool","isOptional":false,"description":"Whether to enable debug mode."},{"name":"max_queue_size","type":"int","isOptional":false,"description":""},{"name":"send","type":"bool","isOptional":false,"description":""},{"name":"on_error","type":"any","isOptional":false,"description":""},{"name":"flush_at","type":"int","isOptional":false,"description":""},{"name":"flush_interval","type":"float","isOptional":false,"description":""},{"name":"gzip","type":"bool","isOptional":false,"description":""},{"name":"max_retries","type":"int","isOptional":false,"description":""},{"name":"sync_mode","type":"bool","isOptional":false,"description":""},{"name":"timeout","type":"int","isOptional":false,"description":""},{"name":"thread","type":"int","isOptional":false,"description":""},{"name":"poll_interval","type":"int","isOptional":false,"description":""},{"name":"personal_api_key","type":"any","isOptional":false,"description":""},{"name":"disabled","type":"bool","isOptional":false,"description":""},{"name":"disable_geoip","type":"bool","isOptional":false,"description":""},{"name":"historical_migration","type":"bool","isOptional":false,"description":""},{"name":"feature_flags_request_timeout_seconds","type":"int","isOptional":false,"description":""},{"name":"super_properties","type":"any","isOptional":false,"description":""},{"name":"enable_exception_autocapture","type":"bool","isOptional":false,"description":""},{"name":"log_captured_exceptions","type":"bool","isOptional":false,"description":""},{"name":"project_root","type":"any","isOptional":false,"description":""},{"name":"privacy_mode","type":"bool","isOptional":false,"description":""},{"name":"before_send","type":"any","isOptional":false,"description":""},{"name":"flag_fallback_cache_url","type":"any","isOptional":false,"description":""},{"name":"enable_local_evaluation","type":"bool","isOptional":false,"description":""}],"details":"","category":"Initialization","examples":[{"id":"example_1","code":"from posthog import Posthog\n\nposthog = Posthog('<ph_project_api_key>', host='<ph_app_host>')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Initialize a new PostHog client instance."},{"id":"alias","title":"alias","params":[{"name":"previous_id","type":"str","isOptional":true,"description":"The previous distinct ID."},{"name":"distinct_id","type":"str","isOptional":true,"description":"The new distinct ID to alias to."},{"name":"timestamp","type":"any","isOptional":false,"description":"The timestamp of the event."},{"name":"uuid","type":"any","isOptional":false,"description":"A unique identifier for the event."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this event."}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"posthog.alias(previous_id='distinct_id', distinct_id='alias_id')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Create an alias between two distinct IDs."},{"id":"capture","title":"capture","params":[{"name":"event","type":"str","isOptional":true,"description":"The event name to capture."},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"","category":"Capture","examples":[{"id":"example_1","code":"# Anonymous event\nposthog.capture('some-anon-event')","name":"Anonymous event"},{"id":"example_2","code":"# Context usage\nfrom posthog import identify_context, new_context\nwith new_context():\n    identify_context('distinct_id_of_the_user')\n    posthog.capture('user_signed_up')\n    posthog.capture('user_logged_in')\n    posthog.capture('some-custom-action', distinct_id='distinct_id_of_the_user')","name":"Context usage"},{"id":"example_3","code":"# Set event properties\nposthog.capture(\n    \"user_signed_up\",\n    distinct_id=\"distinct_id_of_the_user\",\n    properties={\n        \"login_type\": \"email\",\n        \"is_free_trial\": \"true\"\n    }\n)","name":"Set event properties"},{"id":"example_4","code":"# Page view event\nposthog.capture('$pageview', distinct_id=\"distinct_id_of_the_user\", properties={'$current_url': 'https://example.com'})","name":"Page view event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Captures an event manually. [Learn about capture best practices](https://posthog.com/docs/product-analytics/capture-events)"},{"id":"capture_exception","title":"capture_exception","params":[{"name":"exception","type":"BaseException","isOptional":true,"description":"The exception to capture."},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"","category":"Error Tracking","examples":[{"id":"example_1","code":"try:\n    # Some code that might fail\n    pass\nexcept Exception as e:\n    posthog.capture_exception(e, 'user_distinct_id', properties=additional_properties)","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Capture an exception for error tracking."},{"id":"feature_enabled","title":"feature_enabled","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"is_my_flag_enabled = posthog.feature_enabled('flag-key', 'distinct_id_of_your_user')\nif is_my_flag_enabled:\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = posthog.get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Check if a feature flag is enabled for a user."},{"id":"flush","title":"flush","params":[],"details":"","category":null,"examples":[{"id":"example_1","code":"posthog.capture('event_name')\nposthog.flush()  # Ensures the event is sent immediately","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Force a flush from the internal queue to the server. Do not use directly, call `shutdown()` instead."},{"id":"get_all_flags","title":"get_all_flags","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"posthog.get_all_flags('distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[dict[str, Union[bool, str]]]"},"description":"Get all feature flags for a user."},{"id":"get_all_flags_and_payloads","title":"get_all_flags_and_payloads","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"posthog.get_all_flags_and_payloads('distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"FlagsAndPayloads"},"description":"Get all feature flags and their payloads for a user."},{"id":"get_feature_flag","title":"get_feature_flag","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"enabled_variant = posthog.get_feature_flag('flag-key', 'distinct_id_of_your_user')\nif enabled_variant == 'variant-key': # replace 'variant-key' with the key of your variant\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = posthog.get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Union[bool, str, any]"},"description":"Get multivariate feature flag value for a user."},{"id":"get_feature_flag_payload","title":"get_feature_flag_payload","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"match_value","type":"bool","isOptional":false,"description":"The specific flag value to get payload for."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"is_my_flag_enabled = posthog.feature_enabled('flag-key', 'distinct_id_of_your_user')\n\nif is_my_flag_enabled:\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = posthog.get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Get the payload for a feature flag."},{"id":"get_feature_flag_result","title":"get_feature_flag_result","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":null,"examples":[{"id":"example_1","code":"flag_result = posthog.get_feature_flag_result('flag-key', 'distinct_id_of_your_user')\nif flag_result and flag_result.get_value() == 'variant-key':\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = flag_result.payload","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[FeatureFlagResult]"},"description":"Get a FeatureFlagResult object which contains the flag result and payload for a key by evaluating locally or remotely depending on whether local evaluation is enabled and the flag can be locally evaluated. This also captures the `$feature_flag_called` event unless `send_feature_flag_events` is `False`."},{"id":"get_feature_flags_and_payloads","title":"get_feature_flags_and_payloads","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"result = posthog.get_feature_flags_and_payloads('<distinct_id>')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"FlagsAndPayloads"},"description":"Get feature flags and payloads for a user by calling decide."},{"id":"get_feature_payloads","title":"get_feature_payloads","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"payloads = posthog.get_feature_payloads('<distinct_id>')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"dict[str, str]"},"description":"Get feature flag payloads for a user by calling decide."},{"id":"get_feature_variants","title":"get_feature_variants","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"dict[str, Union[bool, str]]"},"description":"Get feature flag variants for a user by calling decide."},{"id":"get_flags_decision","title":"get_flags_decision","params":[{"name":"distinct_id","type":"Number","isOptional":false,"description":"The distinct ID of the user."},{"name":"groups","type":"dict","isOptional":true,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"decision = posthog.get_flags_decision('user123')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"FlagsResponse"},"description":"Get feature flags decision."},{"id":"group_identify","title":"group_identify","params":[{"name":"group_type","type":"str","isOptional":true,"description":"The type of group (e.g., 'company', 'team')."},{"name":"group_key","type":"str","isOptional":true,"description":"The unique identifier for the group."},{"name":"properties","type":"dict[str, Any]","isOptional":true,"description":"A dictionary of properties to set on the group."},{"name":"timestamp","type":"datetime","isOptional":false,"description":"The timestamp of the event."},{"name":"uuid","type":"str","isOptional":true,"description":"A unique identifier for the event."},{"name":"disable_geoip","type":"bool","isOptional":true,"description":"Whether to disable GeoIP for this event."},{"name":"distinct_id","type":"Number","isOptional":false,"description":"The distinct ID of the user performing the action."}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"posthog.group_identify('company', 'company_id_in_your_db', {\n    'name': 'Awesome Inc.',\n    'employees': 11\n})","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Identify a group and set its properties."},{"id":"join","title":"join","params":[],"details":"","category":null,"examples":[{"id":"example_1","code":"posthog.join()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"End the consumer thread once the queue is empty. Do not use directly, call `shutdown()` instead."},{"id":"load_feature_flags","title":"load_feature_flags","params":[],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"posthog.load_feature_flags()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Load feature flags for local evaluation."},{"id":"new_context","title":"new_context","params":[{"name":"fresh","type":"bool","isOptional":false,"description":"Whether to create a fresh context that doesn't inherit from parent."},{"name":"capture_exceptions","type":"bool","isOptional":false,"description":"Whether to automatically capture exceptions in this context."}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"with posthog.new_context():\n    identify_context('<distinct_id>')\n    posthog.capture('event_name')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#contexts)."},{"id":"set","title":"set","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"# Set with distinct id\nposthog.capture(\n    'event_name',\n    distinct_id='user-distinct-id',\n    properties={\n        '$set': {'name': 'Max Hedgehog'},\n        '$set_once': {'initial_url': '/blog'}\n    }\n)","name":"Set with distinct id"},{"id":"example_2","code":"# Set using context\nfrom posthog import new_context, identify_context\nwith new_context():\n    identify_context('user-distinct-id')\n    posthog.capture('event_name')","name":"Set using context"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a person profile."},{"id":"set_once","title":"set_once","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"posthog.set_once(distinct_id='user123', properties={'initial_signup_date': '2024-01-01'})","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a person profile only if they haven't been set before."},{"id":"shutdown","title":"shutdown","params":[],"details":"","category":null,"examples":[{"id":"example_1","code":"posthog.shutdown()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Flush all messages and cleanly shutdown the client. Call this before the process ends in serverless environments to avoid data loss."}],"description":"This is the SDK reference for the PostHog Python SDK. You can learn more about example usage in the [Python SDK documentation](/docs/libraries/python). You can also follow [Flask](/docs/libraries/flask) and [Django](/docs/libraries/django) guides to integrate PostHog into your project."},{"id":"PostHogModule","title":"PostHog Module Functions","functions":[{"id":"alias","title":"alias","params":[{"name":"previous_id","type":"any","isOptional":true,"description":"The unique ID of the user before"},{"name":"distinct_id","type":"any","isOptional":true,"description":"The current unique id"},{"name":"timestamp","type":"any","isOptional":false,"description":"Optional timestamp for the event"},{"name":"uuid","type":"any","isOptional":false,"description":"Optional UUID for the event"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"To marry up whatever a user does before they sign up or log in with what they do after you need to make an alias call. This will allow you to answer questions like \"Which marketing channels leads to users churning after a month?\" or \"What do users do on our website before signing up?\". Particularly useful for associating user behaviour before and after they e.g. register, login, or perform some other identifying action.","category":"Identification","examples":[{"id":"example_1","code":"# Alias user\nfrom posthog import alias\nalias(previous_id='distinct_id', distinct_id='alias_id')","name":"Alias user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Associate user behaviour before and after they e.g. register, login, or perform some other identifying action."},{"id":"capture","title":"capture","params":[{"name":"event","type":"str","isOptional":true,"description":"The event name to specify the event     **kwargs: Optional arguments including:"},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"Capture allows you to capture anything a user does within your system, which you can later use in PostHog to find patterns in usage, work out which features to improve or where people are giving up. A capture call requires an event name to specify the event. We recommend using [verb] [noun], like `movie played` or `movie updated` to easily identify what your events mean later on. Capture takes a number of optional arguments, which are defined by the `OptionalCaptureArgs` type.","category":"Events","examples":[{"id":"example_1","code":"# Context and capture usage\nfrom posthog import new_context, identify_context, tag_context, capture\n# Enter a new context (e.g. a request/response cycle, an instance of a background job, etc)\nwith new_context():\n    # Associate this context with some user, by distinct_id\n    identify_context('some user')\n\n    # Capture an event, associated with the context-level distinct ID ('some user')\n    capture('movie started')\n\n    # Capture an event associated with some other user (overriding the context-level distinct ID)\n    capture('movie joined', distinct_id='some-other-user')\n\n    # Capture an event with some properties\n    capture('movie played', properties={'movie_id': '123', 'category': 'romcom'})\n\n    # Capture an event with some properties\n    capture('purchase', properties={'product_id': '123', 'category': 'romcom'})\n    # Capture an event with some associated group\n    capture('purchase', groups={'company': 'id:5'})\n\n    # Adding a tag to the current context will cause it to appear on all subsequent events\n    tag_context('some-tag', 'some-value')\n\n    capture('another-event') # Will be captured with `'some-tag': 'some-value'` in the properties dict","name":"Context and capture usage"},{"id":"example_2","code":"# Set event properties\nfrom posthog import capture\ncapture(\n    \"user_signed_up\",\n    distinct_id=\"distinct_id_of_the_user\",\n    properties={\n        \"login_type\": \"email\",\n        \"is_free_trial\": \"true\"\n    }\n)","name":"Set event properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Capture anything a user does within your system."},{"id":"capture_exception","title":"capture_exception","params":[{"name":"exception","type":"BaseException","isOptional":false,"description":"The exception to capture. If not provided, the current exception is captured via `sys.exc_info()`"},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"Capture exception is idempotent - if it is called twice with the same exception instance, only a occurrence will be tracked in posthog. This is because, generally, contexts will cause exceptions to be captured automatically. However, to ensure you track an exception, if you catch and do not re-raise it, capturing it manually is recommended, unless you are certain it will have crossed a context boundary (e.g. by existing a `with posthog.new_context():` block already). If the passed exception was raised and caught, the captured stack trace will consist of every frame between where the exception was raised and the point at which it is captured (the \"traceback\"). If the passed exception was never raised, e.g. if you call `posthog.capture_exception(ValueError(\"Some Error\"))`, the stack trace captured will be the full stack trace at the moment the exception was captured. Note that heavy use of contexts will lead to truncated stack traces, as the exception will be captured by the context entered most recently, which may not be the point you catch the exception for the final time in your code. It's recommended to use contexts sparingly, for this reason. `capture_exception` takes the same set of optional arguments as `capture`.","category":"Events","examples":[{"id":"example_1","code":"# Capture exception\nfrom posthog import capture_exception\ntry:\n    risky_operation()\nexcept Exception as e:\n    capture_exception(e)","name":"Capture exception"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Capture exceptions that happen in your code."},{"id":"feature_enabled","title":"feature_enabled","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key"},{"name":"distinct_id","type":"any","isOptional":true,"description":"The user's distinct ID"},{"name":"groups","type":"any","isOptional":false,"description":"Groups mapping"},{"name":"person_properties","type":"any","isOptional":false,"description":"Person properties"},{"name":"group_properties","type":"any","isOptional":false,"description":"Group properties"},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to evaluate only locally"},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"You can call `posthog.load_feature_flags()` before to make sure you're not doing unexpected requests.","category":"Feature flags","examples":[{"id":"example_1","code":"# Boolean feature flag\nfrom posthog import feature_enabled, get_feature_flag_payload\nis_my_flag_enabled = feature_enabled('flag-key', 'distinct_id_of_your_user')\nif is_my_flag_enabled:\n    matched_flag_payload = get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Boolean feature flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Use feature flags to enable or disable features for users."},{"id":"feature_flag_definitions","title":"feature_flag_definitions","params":[],"details":"Returns loaded feature flags, if any. Helpful for debugging what flag information you have loaded.","category":"Feature flags","examples":[{"id":"example_1","code":"from posthog import feature_flag_definitions\ndefinitions = feature_flag_definitions()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Returns loaded feature flags."},{"id":"flush","title":"flush","params":[],"details":"","category":"Client management","examples":[{"id":"example_1","code":"from posthog import flush\nflush()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Tell the client to flush all queued events."},{"id":"get_all_flags","title":"get_all_flags","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The user's distinct ID"},{"name":"groups","type":"any","isOptional":false,"description":"Groups mapping"},{"name":"person_properties","type":"any","isOptional":false,"description":"Person properties"},{"name":"group_properties","type":"any","isOptional":false,"description":"Group properties"},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to evaluate only locally"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"Flags are key-value pairs where the key is the flag key and the value is the flag variant, or True, or False.","category":"Feature flags","examples":[{"id":"example_1","code":"# All flags for user\nfrom posthog import get_all_flags\nget_all_flags('distinct_id_of_your_user')","name":"All flags for user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[dict[str, FeatureFlag]]"},"description":"Get all flags for a given user."},{"id":"get_feature_flag","title":"get_feature_flag","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key"},{"name":"distinct_id","type":"any","isOptional":true,"description":"The user's distinct ID"},{"name":"groups","type":"any","isOptional":false,"description":"Groups mapping from group type to group key"},{"name":"person_properties","type":"any","isOptional":false,"description":"Person properties"},{"name":"group_properties","type":"any","isOptional":false,"description":"Group properties in format { group_type_name: { group_properties } }"},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to evaluate only locally"},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"`groups` are a mapping from group type to group key. So, if you have a group type of \"organization\" and a group key of \"5\", you would pass groups={\"organization\": \"5\"}. `group_properties` take the format: { group_type_name: { group_properties } }. So, for example, if you have the group type \"organization\" and the group key \"5\", with the properties name, and employee count, you'll send these as: group_properties={\"organization\": {\"name\": \"PostHog\", \"employees\": 11}}.","category":"Feature flags","examples":[{"id":"example_1","code":"# Multivariate feature flag\nfrom posthog import get_feature_flag, get_feature_flag_payload\nenabled_variant = get_feature_flag('flag-key', 'distinct_id_of_your_user')\nif enabled_variant == 'variant-key':\n    matched_flag_payload = get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Multivariate feature flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[FeatureFlag]"},"description":"Get feature flag variant for users. Used with experiments."},{"id":"get_feature_flag_result","title":"get_feature_flag_result","params":[{"name":"key","type":"any","isOptional":true,"description":""},{"name":"distinct_id","type":"any","isOptional":true,"description":""},{"name":"groups","type":"any","isOptional":false,"description":""},{"name":"person_properties","type":"any","isOptional":false,"description":""},{"name":"group_properties","type":"any","isOptional":false,"description":""},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":""},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":""},{"name":"disable_geoip","type":"any","isOptional":false,"description":""}],"details":"","category":null,"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Get a FeatureFlagResult object which contains the flag result and payload.  This method evaluates a feature flag and returns a FeatureFlagResult object containing: - enabled: Whether the flag is enabled - variant: The variant value if the flag has variants - payload: The payload associated with the flag (automatically deserialized from JSON) - key: The flag key - reason: Why the flag was enabled/disabled  Example: ```python result = posthog.get_feature_flag_result('beta-feature', 'distinct_id') if result and result.enabled:     # Use the variant and payload     print(f\"Variant: {result.variant}\")     print(f\"Payload: {result.payload}\") ```"},{"id":"get_remote_config_payload","title":"get_remote_config_payload","params":[{"name":"key","type":"any","isOptional":true,"description":"The key of the feature flag"}],"details":"","category":null,"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Get the payload for a remote config feature flag."},{"id":"group_identify","title":"group_identify","params":[{"name":"group_type","type":"any","isOptional":true,"description":"Type of your group"},{"name":"group_key","type":"any","isOptional":true,"description":"Unique identifier of the group"},{"name":"properties","type":"any","isOptional":false,"description":"Properties to set on the group"},{"name":"timestamp","type":"any","isOptional":false,"description":"Optional timestamp for the event"},{"name":"uuid","type":"any","isOptional":false,"description":"Optional UUID for the event"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"# Group identify\nfrom posthog import group_identify\ngroup_identify('company', 'company_id_in_your_db', {\n    'name': 'Awesome Inc.',\n    'employees': 11\n})","name":"Group identify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Set properties on a group."},{"id":"identify_context","title":"identify_context","params":[{"name":"distinct_id","type":"str","isOptional":true,"description":"The distinct ID to associate with the current context and its children"}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"from posthog import identify_context\nidentify_context(\"user_123\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Identify the current context with a distinct ID."},{"id":"join","title":"join","params":[],"details":"","category":"Client management","examples":[{"id":"example_1","code":"from posthog import join\njoin()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Block program until the client clears the queue. Used during program shutdown. You should use `shutdown()` directly in most cases."},{"id":"load_feature_flags","title":"load_feature_flags","params":[],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"from posthog import load_feature_flags\nload_feature_flags()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Load feature flag definitions from PostHog."},{"id":"new_context","title":"new_context","params":[{"name":"fresh","type":"bool","isOptional":false,"description":"Whether to start with a fresh context (default: False)"},{"name":"capture_exceptions","type":"bool","isOptional":false,"description":"Whether to capture exceptions raised within the context (default: True)"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import new_context, tag, capture\nwith new_context():\n    tag(\"request_id\", \"123\")\n    capture(\"event_name\", properties={\"property\": \"value\"})","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Create a new context scope that will be active for the duration of the with block."},{"id":"scoped","title":"scoped","params":[{"name":"fresh","type":"bool","isOptional":false,"description":"Whether to start with a fresh context (default: False)"},{"name":"capture_exceptions","type":"bool","isOptional":false,"description":"Whether to capture and track exceptions with posthog error tracking (default: True)"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import scoped, tag, capture\n@scoped()\ndef process_payment(payment_id):\n    tag(\"payment_id\", payment_id)\n    capture(\"payment_started\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Decorator that creates a new context for the function."},{"id":"set","title":"set","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"This will overwrite previous people property values. Generally operates similar to `capture`, with distinct_id being an optional argument, defaulting to the current context's distinct ID. If there is no context-level distinct ID, and no override distinct_id is passed, this function will do nothing. Context tags are folded into $set properties, so tagging the current context and then calling `set` will cause those tags to be set on the user (unlike capture, which causes them to just be set on the event).","category":"Identification","examples":[{"id":"example_1","code":"# Set person properties\nfrom posthog import capture\ncapture(\n    'distinct_id',\n    event='event_name',\n    properties={\n        '$set': {'name': 'Max Hedgehog'},\n        '$set_once': {'initial_url': '/blog'}\n    }\n)","name":"Set person properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a user record."},{"id":"set_context_session","title":"set_context_session","params":[{"name":"session_id","type":"str","isOptional":true,"description":"The session ID to associate with the current context and its children"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import set_context_session\nset_context_session(\"session_123\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Set the session ID for the current context."},{"id":"set_once","title":"set_once","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"This will not overwrite previous people property values, unlike `set`. Otherwise, operates in an identical manner to `set`.","category":"Identification","examples":[{"id":"example_1","code":"# Set property once\nfrom posthog import capture\ncapture(\n    'distinct_id',\n    event='event_name',\n    properties={\n        '$set': {'name': 'Max Hedgehog'},\n        '$set_once': {'initial_url': '/blog'}\n    }\n)","name":"Set property once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a user record, only if they do not yet exist."},{"id":"shutdown","title":"shutdown","params":[],"details":"","category":"Client management","examples":[{"id":"example_1","code":"from posthog import shutdown\nshutdown()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Flush all messages and cleanly shutdown the client."},{"id":"tag","title":"tag","params":[{"name":"name","type":"str","isOptional":true,"description":"The tag key"},{"name":"value","type":"Any","isOptional":true,"description":"The tag value"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import tag\ntag(\"user_id\", \"123\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Add a tag to the current context."}],"description":"Global functions available in the PostHog module"}],"version":"6.7.10","categories":["Initialization","Identification","Capture","Error Tracking","Feature flags","Contexts","Events","Client management"],"referenceId":"posthog-python"},"createdAt":"2025-10-25T22:45:01.230Z","updatedAt":"2025-10-25T22:45:01.230Z","publishedAt":"2025-10-25T22:45:01.221Z"}},{"id":2,"attributes":{"referenceId":"posthog-python","version":"6.7.7","data":{"id":"posthog-python-6.7.7","info":{"id":"posthog-python","title":"PostHog Python SDK","specUrl":"https://github.com/PostHog/posthog-python","version":"6.7.7","slugPrefix":"posthog-python","description":"Integrate PostHog into any python application."},"types":[{"id":"FeatureFlag","name":"FeatureFlag","path":"posthog.types.FeatureFlag","example":"","properties":[{"name":"key","type":"str","description":"Field: key"},{"name":"enabled","type":"bool","description":"Field: enabled"},{"name":"variant","type":"Optional[str]","description":"Field: variant"},{"name":"reason","type":"Optional[FlagReason]","description":"Field: reason"},{"name":"metadata","type":"Union[FlagMetadata, LegacyFlagMetadata]","description":"Field: metadata"}]},{"id":"FeatureFlagResult","name":"FeatureFlagResult","path":"posthog.types.FeatureFlagResult","example":"","properties":[{"name":"key","type":"str","description":"Field: key"},{"name":"enabled","type":"bool","description":"Field: enabled"},{"name":"variant","type":"Optional[str]","description":"Field: variant"},{"name":"payload","type":"Optional[Any]","description":"Field: payload"},{"name":"reason","type":"Optional[str]","description":"Field: reason"}]},{"id":"FlagMetadata","name":"FlagMetadata","path":"posthog.types.FlagMetadata","example":"","properties":[{"name":"id","type":"int","description":"Field: id"},{"name":"payload","type":"Optional[str]","description":"Field: payload"},{"name":"version","type":"int","description":"Field: version"},{"name":"description","type":"str","description":"Field: description"}]},{"id":"FlagReason","name":"FlagReason","path":"posthog.types.FlagReason","example":"","properties":[{"name":"code","type":"str","description":"Field: code"},{"name":"condition_index","type":"Optional[int]","description":"Field: condition_index"},{"name":"description","type":"str","description":"Field: description"}]},{"id":"FlagsAndPayloads","name":"FlagsAndPayloads","path":"posthog.types.FlagsAndPayloads","example":"","properties":[{"name":"featureFlags","type":"Optional[dict[str, Union[bool, str]]]","description":"Field: featureFlags"},{"name":"featureFlagPayloads","type":"Optional[dict[str, Any]]","description":"Field: featureFlagPayloads"}]},{"id":"FlagsResponse","name":"FlagsResponse","path":"posthog.types.FlagsResponse","example":"","properties":[{"name":"flags","type":"dict[str, FeatureFlag]","description":"Field: flags"},{"name":"errorsWhileComputingFlags","type":"bool","description":"Field: errorsWhileComputingFlags"},{"name":"requestId","type":"str","description":"Field: requestId"},{"name":"quotaLimit","type":"Optional[list[str]]","description":"Field: quotaLimit"}]},{"id":"LegacyFlagMetadata","name":"LegacyFlagMetadata","path":"posthog.types.LegacyFlagMetadata","example":"","properties":[{"name":"payload","type":"Any","description":"Field: payload"}]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"posthog.types.SendFeatureFlagsOptions","example":"","properties":[{"name":"should_send","type":"bool","description":"Field: should_send"},{"name":"only_evaluate_locally","type":"Optional[bool]","description":"Field: only_evaluate_locally"},{"name":"person_properties","type":"Optional[dict[str, Any]]","description":"Field: person_properties"},{"name":"group_properties","type":"Optional[dict[str, dict[str, Any]]]","description":"Field: group_properties"},{"name":"flag_keys_filter","type":"Optional[list[str]]","description":"Field: flag_keys_filter"}]},{"id":"OptionalCaptureArgs","name":"OptionalCaptureArgs","path":"posthog.args.OptionalCaptureArgs","example":"","properties":[{"name":"distinct_id","type":"NotRequired[Union[Number, str, UUID, int, any]]","description":"Field: distinct_id"},{"name":"properties","type":"NotRequired[Optional[dict[str, Any]]]","description":"Field: properties"},{"name":"timestamp","type":"NotRequired[Union[datetime, str, any]]","description":"Field: timestamp"},{"name":"uuid","type":"NotRequired[Optional[str]]","description":"Field: uuid"},{"name":"groups","type":"NotRequired[Optional[dict[str, str]]]","description":"Field: groups"},{"name":"send_feature_flags","type":"NotRequired[Union[bool, SendFeatureFlagsOptions, any]]","description":"Field: send_feature_flags"},{"name":"disable_geoip","type":"NotRequired[Optional[bool]]","description":"Field: disable_geoip"}]},{"id":"OptionalSetArgs","name":"OptionalSetArgs","path":"posthog.args.OptionalSetArgs","example":"","properties":[{"name":"distinct_id","type":"NotRequired[Union[Number, str, UUID, int, any]]","description":"Field: distinct_id"},{"name":"properties","type":"NotRequired[Optional[dict[str, Any]]]","description":"Field: properties"},{"name":"timestamp","type":"NotRequired[Union[datetime, str, any]]","description":"Field: timestamp"},{"name":"uuid","type":"NotRequired[Optional[str]]","description":"Field: uuid"},{"name":"disable_geoip","type":"NotRequired[Optional[bool]]","description":"Field: disable_geoip"}]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"posthog.types.SendFeatureFlagsOptions","example":"","properties":[{"name":"should_send","type":"bool","description":"Field: should_send"},{"name":"only_evaluate_locally","type":"Optional[bool]","description":"Field: only_evaluate_locally"},{"name":"person_properties","type":"Optional[dict[str, Any]]","description":"Field: person_properties"},{"name":"group_properties","type":"Optional[dict[str, dict[str, Any]]]","description":"Field: group_properties"},{"name":"flag_keys_filter","type":"Optional[list[str]]","description":"Field: flag_keys_filter"}]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"__init__","title":"Client","params":[{"name":"project_api_key","type":"str","isOptional":true,"description":"The project API key."},{"name":"host","type":"any","isOptional":false,"description":"The host to use for the client."},{"name":"debug","type":"bool","isOptional":false,"description":"Whether to enable debug mode."},{"name":"max_queue_size","type":"int","isOptional":false,"description":""},{"name":"send","type":"bool","isOptional":false,"description":""},{"name":"on_error","type":"any","isOptional":false,"description":""},{"name":"flush_at","type":"int","isOptional":false,"description":""},{"name":"flush_interval","type":"float","isOptional":false,"description":""},{"name":"gzip","type":"bool","isOptional":false,"description":""},{"name":"max_retries","type":"int","isOptional":false,"description":""},{"name":"sync_mode","type":"bool","isOptional":false,"description":""},{"name":"timeout","type":"int","isOptional":false,"description":""},{"name":"thread","type":"int","isOptional":false,"description":""},{"name":"poll_interval","type":"int","isOptional":false,"description":""},{"name":"personal_api_key","type":"any","isOptional":false,"description":""},{"name":"disabled","type":"bool","isOptional":false,"description":""},{"name":"disable_geoip","type":"bool","isOptional":false,"description":""},{"name":"historical_migration","type":"bool","isOptional":false,"description":""},{"name":"feature_flags_request_timeout_seconds","type":"int","isOptional":false,"description":""},{"name":"super_properties","type":"any","isOptional":false,"description":""},{"name":"enable_exception_autocapture","type":"bool","isOptional":false,"description":""},{"name":"log_captured_exceptions","type":"bool","isOptional":false,"description":""},{"name":"project_root","type":"any","isOptional":false,"description":""},{"name":"privacy_mode","type":"bool","isOptional":false,"description":""},{"name":"before_send","type":"any","isOptional":false,"description":""},{"name":"flag_fallback_cache_url","type":"any","isOptional":false,"description":""},{"name":"enable_local_evaluation","type":"bool","isOptional":false,"description":""}],"details":"","category":"Initialization","examples":[{"id":"example_1","code":"from posthog import Posthog\n\nposthog = Posthog('<ph_project_api_key>', host='<ph_app_host>')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Initialize a new PostHog client instance."},{"id":"alias","title":"alias","params":[{"name":"previous_id","type":"str","isOptional":true,"description":"The previous distinct ID."},{"name":"distinct_id","type":"str","isOptional":true,"description":"The new distinct ID to alias to."},{"name":"timestamp","type":"any","isOptional":false,"description":"The timestamp of the event."},{"name":"uuid","type":"any","isOptional":false,"description":"A unique identifier for the event."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this event."}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"posthog.alias(previous_id='distinct_id', distinct_id='alias_id')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Create an alias between two distinct IDs."},{"id":"capture","title":"capture","params":[{"name":"event","type":"str","isOptional":true,"description":"The event name to capture."},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"","category":"Capture","examples":[{"id":"example_1","code":"# Anonymous event\nposthog.capture('some-anon-event')","name":"Anonymous event"},{"id":"example_2","code":"# Context usage\nfrom posthog import identify_context, new_context\nwith new_context():\n    identify_context('distinct_id_of_the_user')\n    posthog.capture('user_signed_up')\n    posthog.capture('user_logged_in')\n    posthog.capture('some-custom-action', distinct_id='distinct_id_of_the_user')","name":"Context usage"},{"id":"example_3","code":"# Set event properties\nposthog.capture(\n    \"user_signed_up\",\n    distinct_id=\"distinct_id_of_the_user\",\n    properties={\n        \"login_type\": \"email\",\n        \"is_free_trial\": \"true\"\n    }\n)","name":"Set event properties"},{"id":"example_4","code":"# Page view event\nposthog.capture('$pageview', distinct_id=\"distinct_id_of_the_user\", properties={'$current_url': 'https://example.com'})","name":"Page view event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Captures an event manually. [Learn about capture best practices](https://posthog.com/docs/product-analytics/capture-events)"},{"id":"capture_exception","title":"capture_exception","params":[{"name":"exception","type":"BaseException","isOptional":true,"description":"The exception to capture."},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"","category":"Error Tracking","examples":[{"id":"example_1","code":"try:\n    # Some code that might fail\n    pass\nexcept Exception as e:\n    posthog.capture_exception(e, 'user_distinct_id', properties=additional_properties)","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Capture an exception for error tracking."},{"id":"feature_enabled","title":"feature_enabled","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"is_my_flag_enabled = posthog.feature_enabled('flag-key', 'distinct_id_of_your_user')\nif is_my_flag_enabled:\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = posthog.get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Check if a feature flag is enabled for a user."},{"id":"flush","title":"flush","params":[],"details":"","category":null,"examples":[{"id":"example_1","code":"posthog.capture('event_name')\nposthog.flush()  # Ensures the event is sent immediately","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Force a flush from the internal queue to the server. Do not use directly, call `shutdown()` instead."},{"id":"get_all_flags","title":"get_all_flags","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"posthog.get_all_flags('distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[dict[str, Union[bool, str]]]"},"description":"Get all feature flags for a user."},{"id":"get_all_flags_and_payloads","title":"get_all_flags_and_payloads","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"posthog.get_all_flags_and_payloads('distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"FlagsAndPayloads"},"description":"Get all feature flags and their payloads for a user."},{"id":"get_feature_flag","title":"get_feature_flag","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"enabled_variant = posthog.get_feature_flag('flag-key', 'distinct_id_of_your_user')\nif enabled_variant == 'variant-key': # replace 'variant-key' with the key of your variant\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = posthog.get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Union[bool, str, any]"},"description":"Get multivariate feature flag value for a user."},{"id":"get_feature_flag_payload","title":"get_feature_flag_payload","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"match_value","type":"bool","isOptional":false,"description":"The specific flag value to get payload for."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"is_my_flag_enabled = posthog.feature_enabled('flag-key', 'distinct_id_of_your_user')\n\nif is_my_flag_enabled:\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = posthog.get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Get the payload for a feature flag."},{"id":"get_feature_flag_result","title":"get_feature_flag_result","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":null,"examples":[{"id":"example_1","code":"flag_result = posthog.get_feature_flag_result('flag-key', 'distinct_id_of_your_user')\nif flag_result and flag_result.get_value() == 'variant-key':\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = flag_result.payload","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[FeatureFlagResult]"},"description":"Get a FeatureFlagResult object which contains the flag result and payload for a key by evaluating locally or remotely depending on whether local evaluation is enabled and the flag can be locally evaluated. This also captures the `$feature_flag_called` event unless `send_feature_flag_events` is `False`."},{"id":"get_feature_flags_and_payloads","title":"get_feature_flags_and_payloads","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"result = posthog.get_feature_flags_and_payloads('<distinct_id>')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"FlagsAndPayloads"},"description":"Get feature flags and payloads for a user by calling decide."},{"id":"get_feature_payloads","title":"get_feature_payloads","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"payloads = posthog.get_feature_payloads('<distinct_id>')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"dict[str, str]"},"description":"Get feature flag payloads for a user by calling decide."},{"id":"get_feature_variants","title":"get_feature_variants","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"dict[str, Union[bool, str]]"},"description":"Get feature flag variants for a user by calling decide."},{"id":"get_flags_decision","title":"get_flags_decision","params":[{"name":"distinct_id","type":"Number","isOptional":false,"description":"The distinct ID of the user."},{"name":"groups","type":"dict","isOptional":true,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"decision = posthog.get_flags_decision('user123')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"FlagsResponse"},"description":"Get feature flags decision."},{"id":"group_identify","title":"group_identify","params":[{"name":"group_type","type":"str","isOptional":true,"description":"The type of group (e.g., 'company', 'team')."},{"name":"group_key","type":"str","isOptional":true,"description":"The unique identifier for the group."},{"name":"properties","type":"dict[str, Any]","isOptional":true,"description":"A dictionary of properties to set on the group."},{"name":"timestamp","type":"datetime","isOptional":false,"description":"The timestamp of the event."},{"name":"uuid","type":"str","isOptional":true,"description":"A unique identifier for the event."},{"name":"disable_geoip","type":"bool","isOptional":true,"description":"Whether to disable GeoIP for this event."},{"name":"distinct_id","type":"Number","isOptional":false,"description":"The distinct ID of the user performing the action."}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"posthog.group_identify('company', 'company_id_in_your_db', {\n    'name': 'Awesome Inc.',\n    'employees': 11\n})","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Identify a group and set its properties."},{"id":"join","title":"join","params":[],"details":"","category":null,"examples":[{"id":"example_1","code":"posthog.join()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"End the consumer thread once the queue is empty. Do not use directly, call `shutdown()` instead."},{"id":"load_feature_flags","title":"load_feature_flags","params":[],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"posthog.load_feature_flags()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Load feature flags for local evaluation."},{"id":"new_context","title":"new_context","params":[{"name":"fresh","type":"bool","isOptional":false,"description":"Whether to create a fresh context that doesn't inherit from parent."},{"name":"capture_exceptions","type":"bool","isOptional":false,"description":"Whether to automatically capture exceptions in this context."}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"with posthog.new_context():\n    identify_context('<distinct_id>')\n    posthog.capture('event_name')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#contexts)."},{"id":"set","title":"set","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"# Set with distinct id\nposthog.capture(\n    'event_name',\n    distinct_id='user-distinct-id',\n    properties={\n        '$set': {'name': 'Max Hedgehog'},\n        '$set_once': {'initial_url': '/blog'}\n    }\n)","name":"Set with distinct id"},{"id":"example_2","code":"# Set using context\nfrom posthog import new_context, identify_context\nwith new_context():\n    identify_context('user-distinct-id')\n    posthog.capture('event_name')","name":"Set using context"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a person profile."},{"id":"set_once","title":"set_once","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"posthog.set_once(distinct_id='user123', properties={'initial_signup_date': '2024-01-01'})","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a person profile only if they haven't been set before."},{"id":"shutdown","title":"shutdown","params":[],"details":"","category":null,"examples":[{"id":"example_1","code":"posthog.shutdown()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Flush all messages and cleanly shutdown the client. Call this before the process ends in serverless environments to avoid data loss."}],"description":"This is the SDK reference for the PostHog Python SDK. You can learn more about example usage in the [Python SDK documentation](/docs/libraries/python). You can also follow [Flask](/docs/libraries/flask) and [Django](/docs/libraries/django) guides to integrate PostHog into your project."},{"id":"PostHogModule","title":"PostHog Module Functions","functions":[{"id":"alias","title":"alias","params":[{"name":"previous_id","type":"any","isOptional":true,"description":"The unique ID of the user before"},{"name":"distinct_id","type":"any","isOptional":true,"description":"The current unique id"},{"name":"timestamp","type":"any","isOptional":false,"description":"Optional timestamp for the event"},{"name":"uuid","type":"any","isOptional":false,"description":"Optional UUID for the event"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"To marry up whatever a user does before they sign up or log in with what they do after you need to make an alias call. This will allow you to answer questions like \"Which marketing channels leads to users churning after a month?\" or \"What do users do on our website before signing up?\". Particularly useful for associating user behaviour before and after they e.g. register, login, or perform some other identifying action.","category":"Identification","examples":[{"id":"example_1","code":"# Alias user\nfrom posthog import alias\nalias(previous_id='distinct_id', distinct_id='alias_id')","name":"Alias user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Associate user behaviour before and after they e.g. register, login, or perform some other identifying action."},{"id":"capture","title":"capture","params":[{"name":"event","type":"str","isOptional":true,"description":"The event name to specify the event     **kwargs: Optional arguments including:"},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"Capture allows you to capture anything a user does within your system, which you can later use in PostHog to find patterns in usage, work out which features to improve or where people are giving up. A capture call requires an event name to specify the event. We recommend using [verb] [noun], like `movie played` or `movie updated` to easily identify what your events mean later on. Capture takes a number of optional arguments, which are defined by the `OptionalCaptureArgs` type.","category":"Events","examples":[{"id":"example_1","code":"# Context and capture usage\nfrom posthog import new_context, identify_context, tag_context, capture\n# Enter a new context (e.g. a request/response cycle, an instance of a background job, etc)\nwith new_context():\n    # Associate this context with some user, by distinct_id\n    identify_context('some user')\n\n    # Capture an event, associated with the context-level distinct ID ('some user')\n    capture('movie started')\n\n    # Capture an event associated with some other user (overriding the context-level distinct ID)\n    capture('movie joined', distinct_id='some-other-user')\n\n    # Capture an event with some properties\n    capture('movie played', properties={'movie_id': '123', 'category': 'romcom'})\n\n    # Capture an event with some properties\n    capture('purchase', properties={'product_id': '123', 'category': 'romcom'})\n    # Capture an event with some associated group\n    capture('purchase', groups={'company': 'id:5'})\n\n    # Adding a tag to the current context will cause it to appear on all subsequent events\n    tag_context('some-tag', 'some-value')\n\n    capture('another-event') # Will be captured with `'some-tag': 'some-value'` in the properties dict","name":"Context and capture usage"},{"id":"example_2","code":"# Set event properties\nfrom posthog import capture\ncapture(\n    \"user_signed_up\",\n    distinct_id=\"distinct_id_of_the_user\",\n    properties={\n        \"login_type\": \"email\",\n        \"is_free_trial\": \"true\"\n    }\n)","name":"Set event properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Capture anything a user does within your system."},{"id":"capture_exception","title":"capture_exception","params":[{"name":"exception","type":"BaseException","isOptional":false,"description":"The exception to capture. If not provided, the current exception is captured via `sys.exc_info()`"},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"Capture exception is idempotent - if it is called twice with the same exception instance, only a occurrence will be tracked in posthog. This is because, generally, contexts will cause exceptions to be captured automatically. However, to ensure you track an exception, if you catch and do not re-raise it, capturing it manually is recommended, unless you are certain it will have crossed a context boundary (e.g. by existing a `with posthog.new_context():` block already). If the passed exception was raised and caught, the captured stack trace will consist of every frame between where the exception was raised and the point at which it is captured (the \"traceback\"). If the passed exception was never raised, e.g. if you call `posthog.capture_exception(ValueError(\"Some Error\"))`, the stack trace captured will be the full stack trace at the moment the exception was captured. Note that heavy use of contexts will lead to truncated stack traces, as the exception will be captured by the context entered most recently, which may not be the point you catch the exception for the final time in your code. It's recommended to use contexts sparingly, for this reason. `capture_exception` takes the same set of optional arguments as `capture`.","category":"Events","examples":[{"id":"example_1","code":"# Capture exception\nfrom posthog import capture_exception\ntry:\n    risky_operation()\nexcept Exception as e:\n    capture_exception(e)","name":"Capture exception"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Capture exceptions that happen in your code."},{"id":"feature_enabled","title":"feature_enabled","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key"},{"name":"distinct_id","type":"any","isOptional":true,"description":"The user's distinct ID"},{"name":"groups","type":"any","isOptional":false,"description":"Groups mapping"},{"name":"person_properties","type":"any","isOptional":false,"description":"Person properties"},{"name":"group_properties","type":"any","isOptional":false,"description":"Group properties"},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to evaluate only locally"},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"You can call `posthog.load_feature_flags()` before to make sure you're not doing unexpected requests.","category":"Feature flags","examples":[{"id":"example_1","code":"# Boolean feature flag\nfrom posthog import feature_enabled, get_feature_flag_payload\nis_my_flag_enabled = feature_enabled('flag-key', 'distinct_id_of_your_user')\nif is_my_flag_enabled:\n    matched_flag_payload = get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Boolean feature flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Use feature flags to enable or disable features for users."},{"id":"feature_flag_definitions","title":"feature_flag_definitions","params":[],"details":"Returns loaded feature flags, if any. Helpful for debugging what flag information you have loaded.","category":"Feature flags","examples":[{"id":"example_1","code":"from posthog import feature_flag_definitions\ndefinitions = feature_flag_definitions()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Returns loaded feature flags."},{"id":"flush","title":"flush","params":[],"details":"","category":"Client management","examples":[{"id":"example_1","code":"from posthog import flush\nflush()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Tell the client to flush all queued events."},{"id":"get_all_flags","title":"get_all_flags","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The user's distinct ID"},{"name":"groups","type":"any","isOptional":false,"description":"Groups mapping"},{"name":"person_properties","type":"any","isOptional":false,"description":"Person properties"},{"name":"group_properties","type":"any","isOptional":false,"description":"Group properties"},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to evaluate only locally"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"Flags are key-value pairs where the key is the flag key and the value is the flag variant, or True, or False.","category":"Feature flags","examples":[{"id":"example_1","code":"# All flags for user\nfrom posthog import get_all_flags\nget_all_flags('distinct_id_of_your_user')","name":"All flags for user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[dict[str, FeatureFlag]]"},"description":"Get all flags for a given user."},{"id":"get_feature_flag","title":"get_feature_flag","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key"},{"name":"distinct_id","type":"any","isOptional":true,"description":"The user's distinct ID"},{"name":"groups","type":"any","isOptional":false,"description":"Groups mapping from group type to group key"},{"name":"person_properties","type":"any","isOptional":false,"description":"Person properties"},{"name":"group_properties","type":"any","isOptional":false,"description":"Group properties in format { group_type_name: { group_properties } }"},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to evaluate only locally"},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"`groups` are a mapping from group type to group key. So, if you have a group type of \"organization\" and a group key of \"5\", you would pass groups={\"organization\": \"5\"}. `group_properties` take the format: { group_type_name: { group_properties } }. So, for example, if you have the group type \"organization\" and the group key \"5\", with the properties name, and employee count, you'll send these as: group_properties={\"organization\": {\"name\": \"PostHog\", \"employees\": 11}}.","category":"Feature flags","examples":[{"id":"example_1","code":"# Multivariate feature flag\nfrom posthog import get_feature_flag, get_feature_flag_payload\nenabled_variant = get_feature_flag('flag-key', 'distinct_id_of_your_user')\nif enabled_variant == 'variant-key':\n    matched_flag_payload = get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Multivariate feature flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[FeatureFlag]"},"description":"Get feature flag variant for users. Used with experiments."},{"id":"get_feature_flag_result","title":"get_feature_flag_result","params":[{"name":"key","type":"any","isOptional":true,"description":""},{"name":"distinct_id","type":"any","isOptional":true,"description":""},{"name":"groups","type":"any","isOptional":false,"description":""},{"name":"person_properties","type":"any","isOptional":false,"description":""},{"name":"group_properties","type":"any","isOptional":false,"description":""},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":""},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":""},{"name":"disable_geoip","type":"any","isOptional":false,"description":""}],"details":"","category":null,"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Get a FeatureFlagResult object which contains the flag result and payload.  This method evaluates a feature flag and returns a FeatureFlagResult object containing: - enabled: Whether the flag is enabled - variant: The variant value if the flag has variants - payload: The payload associated with the flag (automatically deserialized from JSON) - key: The flag key - reason: Why the flag was enabled/disabled  Example: ```python result = posthog.get_feature_flag_result('beta-feature', 'distinct_id') if result and result.enabled:     # Use the variant and payload     print(f\"Variant: {result.variant}\")     print(f\"Payload: {result.payload}\") ```"},{"id":"get_remote_config_payload","title":"get_remote_config_payload","params":[{"name":"key","type":"any","isOptional":true,"description":"The key of the feature flag"}],"details":"","category":null,"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Get the payload for a remote config feature flag."},{"id":"group_identify","title":"group_identify","params":[{"name":"group_type","type":"any","isOptional":true,"description":"Type of your group"},{"name":"group_key","type":"any","isOptional":true,"description":"Unique identifier of the group"},{"name":"properties","type":"any","isOptional":false,"description":"Properties to set on the group"},{"name":"timestamp","type":"any","isOptional":false,"description":"Optional timestamp for the event"},{"name":"uuid","type":"any","isOptional":false,"description":"Optional UUID for the event"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"# Group identify\nfrom posthog import group_identify\ngroup_identify('company', 'company_id_in_your_db', {\n    'name': 'Awesome Inc.',\n    'employees': 11\n})","name":"Group identify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Set properties on a group."},{"id":"identify_context","title":"identify_context","params":[{"name":"distinct_id","type":"str","isOptional":true,"description":"The distinct ID to associate with the current context and its children"}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"from posthog import identify_context\nidentify_context(\"user_123\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Identify the current context with a distinct ID."},{"id":"join","title":"join","params":[],"details":"","category":"Client management","examples":[{"id":"example_1","code":"from posthog import join\njoin()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Block program until the client clears the queue. Used during program shutdown. You should use `shutdown()` directly in most cases."},{"id":"load_feature_flags","title":"load_feature_flags","params":[],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"from posthog import load_feature_flags\nload_feature_flags()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Load feature flag definitions from PostHog."},{"id":"new_context","title":"new_context","params":[{"name":"fresh","type":"bool","isOptional":false,"description":"Whether to start with a fresh context (default: False)"},{"name":"capture_exceptions","type":"bool","isOptional":false,"description":"Whether to capture exceptions raised within the context (default: True)"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import new_context, tag, capture\nwith new_context():\n    tag(\"request_id\", \"123\")\n    capture(\"event_name\", properties={\"property\": \"value\"})","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Create a new context scope that will be active for the duration of the with block."},{"id":"scoped","title":"scoped","params":[{"name":"fresh","type":"bool","isOptional":false,"description":"Whether to start with a fresh context (default: False)"},{"name":"capture_exceptions","type":"bool","isOptional":false,"description":"Whether to capture and track exceptions with posthog error tracking (default: True)"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import scoped, tag, capture\n@scoped()\ndef process_payment(payment_id):\n    tag(\"payment_id\", payment_id)\n    capture(\"payment_started\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Decorator that creates a new context for the function."},{"id":"set","title":"set","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"This will overwrite previous people property values. Generally operates similar to `capture`, with distinct_id being an optional argument, defaulting to the current context's distinct ID. If there is no context-level distinct ID, and no override distinct_id is passed, this function will do nothing. Context tags are folded into $set properties, so tagging the current context and then calling `set` will cause those tags to be set on the user (unlike capture, which causes them to just be set on the event).","category":"Identification","examples":[{"id":"example_1","code":"# Set person properties\nfrom posthog import capture\ncapture(\n    'distinct_id',\n    event='event_name',\n    properties={\n        '$set': {'name': 'Max Hedgehog'},\n        '$set_once': {'initial_url': '/blog'}\n    }\n)","name":"Set person properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a user record."},{"id":"set_context_session","title":"set_context_session","params":[{"name":"session_id","type":"str","isOptional":true,"description":"The session ID to associate with the current context and its children"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import set_context_session\nset_context_session(\"session_123\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Set the session ID for the current context."},{"id":"set_once","title":"set_once","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"This will not overwrite previous people property values, unlike `set`. Otherwise, operates in an identical manner to `set`.","category":"Identification","examples":[{"id":"example_1","code":"# Set property once\nfrom posthog import capture\ncapture(\n    'distinct_id',\n    event='event_name',\n    properties={\n        '$set': {'name': 'Max Hedgehog'},\n        '$set_once': {'initial_url': '/blog'}\n    }\n)","name":"Set property once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a user record, only if they do not yet exist."},{"id":"shutdown","title":"shutdown","params":[],"details":"","category":"Client management","examples":[{"id":"example_1","code":"from posthog import shutdown\nshutdown()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Flush all messages and cleanly shutdown the client."},{"id":"tag","title":"tag","params":[{"name":"name","type":"str","isOptional":true,"description":"The tag key"},{"name":"value","type":"Any","isOptional":true,"description":"The tag value"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import tag\ntag(\"user_id\", \"123\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Add a tag to the current context."}],"description":"Global functions available in the PostHog module"}],"version":"6.7.7","categories":["Initialization","Identification","Capture","Error Tracking","Feature flags","Contexts","Events","Client management"],"referenceId":"posthog-python"},"createdAt":"2025-10-25T22:45:01.254Z","updatedAt":"2025-10-25T22:45:01.254Z","publishedAt":"2025-10-25T22:45:01.249Z"}},{"id":247,"attributes":{"referenceId":"posthog-node","version":"5.25.0","data":{"id":"posthog-node-5.25.0","info":{"id":"posthog-node","title":"PostHog Node.js SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"5.25.0","slugPrefix":"posthog-node","description":"PostHog Node.js SDK allows you to capture events and send them to PostHog from your Node.js applications."},"types":[{"id":"_SentryEvent","name":"_SentryEvent","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryEventProcessor","name":"_SentryEventProcessor","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryHub","name":"_SentryHub","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryIntegration","name":"_SentryIntegration","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"_SentryIntegrationClass","name":"_SentryIntegrationClass","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"src/types.ts","example":"(event: EventMessage | null) => EventMessage | null","properties":[]},{"id":"ContextData","name":"ContextData","path":"src/extensions/context/types.ts","properties":[{"name":"distinctId","type":"string"},{"name":"properties","type":"Record<string, any>"},{"name":"sessionId","type":"string"}]},{"id":"ContextOptions","name":"ContextOptions","path":"src/extensions/context/types.ts","properties":[{"name":"fresh","type":"boolean","description":"If true, replaces the current context entirely. If false, merges with the existing context (new values override existing ones).   false"}]},{"id":"EventMessage","name":"EventMessage","path":"src/types.ts","example":"Omit<IdentifyMessage, 'distinctId'> & {\n    distinctId?: string;\n    event: string;\n    groups?: Record<string, string | number>;\n    sendFeatureFlags?: boolean | SendFeatureFlagsOptions;\n    timestamp?: Date;\n    uuid?: string;\n    _originatedFromCaptureException?: boolean;\n}","properties":[]},{"id":"ExpressErrorMiddleware","name":"ExpressErrorMiddleware","path":"src/extensions/express.ts","example":"(error: MiddlewareError, req: Request, res: Response, next: (error: MiddlewareError) => void) => void","properties":[]},{"id":"ExpressMiddleware","name":"ExpressMiddleware","path":"src/extensions/express.ts","example":"(req: Request, res: Response, next: () => void) => void","properties":[]},{"id":"FeatureFlagBucketingIdentifier","name":"FeatureFlagBucketingIdentifier","path":"src/types.ts","example":"\"distinct_id\" | \"device_id\"","properties":[]},{"id":"FeatureFlagCondition","name":"FeatureFlagCondition","path":"src/types.ts","example":"{\n    properties: FlagProperty[];\n    rollout_percentage?: number;\n    variant?: string;\n}","properties":[]},{"id":"FeatureFlagOverrideOptions","name":"FeatureFlagOverrideOptions","path":"src/types.ts","example":"{\n    flags?: false | string[] | Record<string, FeatureFlagValue>;\n    payloads?: false | Record<string, JsonType>;\n}","properties":[]},{"id":"FeatureFlagResult","name":"FeatureFlagResult","path":"src/types.ts","example":"{\n    key: string;\n    enabled: boolean;\n    variant: string | undefined;\n    payload: JsonType | undefined;\n}","properties":[]},{"id":"FlagDefinitionCacheData","name":"FlagDefinitionCacheData","path":"src/extensions/feature-flags/cache.ts","properties":[{"name":"cohorts","type":"Record<string, PropertyGroup>","description":"Cohort property groups for local evaluation"},{"name":"flags","type":"PostHogFeatureFlag[]","description":"Array of feature flag definitions"},{"name":"groupTypeMapping","type":"Record<string, string>","description":"Mapping of group type index to group name"}]},{"id":"FlagDefinitionCacheProvider","name":"FlagDefinitionCacheProvider","path":"src/extensions/feature-flags/cache.ts","properties":[]},{"id":"FlagProperty","name":"FlagProperty","path":"src/types.ts","example":"{\n    key: string;\n    type?: string;\n    value: FlagPropertyValue;\n    operator?: string;\n    negation?: boolean;\n    dependency_chain?: string[];\n}","properties":[]},{"id":"FlagPropertyValue","name":"FlagPropertyValue","path":"src/types.ts","example":"string | number | (string | number)[] | boolean","properties":[]},{"id":"GroupIdentifyMessage","name":"GroupIdentifyMessage","path":"src/types.ts","example":"{\n    groupType: string;\n    groupKey: string;\n    properties?: Record<string | number, any>;\n    distinctId?: string;\n    disableGeoip?: boolean;\n}","properties":[]},{"id":"IdentifyMessage","name":"IdentifyMessage","path":"src/types.ts","example":"{\n    distinctId: string;\n    properties?: Record<string | number, any>;\n    disableGeoip?: boolean;\n}","properties":[]},{"id":"IPostHog","name":"IPostHog","path":"src/types.ts","properties":[]},{"id":"IPostHogContext","name":"IPostHogContext","path":"src/extensions/context/types.ts","properties":[]},{"id":"MiddlewareError","name":"MiddlewareError","path":"src/extensions/express.ts","properties":[{"name":"output","type":"{\n        statusCode?: number | string;\n    }"},{"name":"status_code","type":"number | string"},{"name":"status","type":"number | string"},{"name":"statusCode","type":"number | string"}]},{"id":"OverrideFeatureFlagsOptions","name":"OverrideFeatureFlagsOptions","path":"src/types.ts","example":"false | string[] | Record<string, FeatureFlagValue> | FeatureFlagOverrideOptions","properties":[]},{"id":"PostHogFeatureFlag","name":"PostHogFeatureFlag","path":"src/types.ts","example":"{\n    id: number;\n    name: string;\n    key: string;\n    bucketing_identifier?: FeatureFlagBucketingIdentifier;\n    filters?: {\n        aggregation_group_type_index?: number;\n        groups?: FeatureFlagCondition[];\n        multivariate?: {\n            variants: {\n                key: string;\n                rollout_percentage: number;\n            }[];\n        };\n        payloads?: Record<string, string>;\n    };\n    deleted: boolean;\n    active: boolean;\n    rollout_percentage: null | number;\n    ensure_experience_continuity: boolean;\n    experiment_set: number[];\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"src/types.ts","example":"Omit<PostHogCoreOptions, 'before_send'> & {\n    persistence?: 'memory';\n    personalApiKey?: string;\n    privacyMode?: boolean;\n    enableExceptionAutocapture?: boolean;\n    featureFlagsPollingInterval?: number;\n    maxCacheSize?: number;\n    fetch?: (url: string, options: PostHogFetchOptions) => Promise<PostHogFetchResponse>;\n    enableLocalEvaluation?: boolean;\n    flagDefinitionCacheProvider?: FlagDefinitionCacheProvider;\n    before_send?: BeforeSendFn | BeforeSendFn[];\n    evaluationContexts?: readonly string[];\n    evaluationEnvironments?: readonly string[];\n    custom_blocked_useragents?: string[];\n    __preview_capture_bot_pageviews?: boolean;\n    strictLocalEvaluation?: boolean;\n}","properties":[]},{"id":"PropertyGroup","name":"PropertyGroup","path":"src/types.ts","example":"{\n    type: 'AND' | 'OR';\n    values: PropertyGroup[] | FlagProperty[];\n}","properties":[]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"src/types.ts","example":"{\n    onlyEvaluateLocally?: boolean;\n    personProperties?: Record<string, any>;\n    groupProperties?: Record<string, Record<string, any>>;\n    flagKeys?: string[];\n}","properties":[]},{"id":"SentryIntegrationOptions","name":"SentryIntegrationOptions","path":"src/extensions/sentry-integration.ts","example":"{\n    organization?: string;\n    projectId?: number;\n    prefix?: string;\n    severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n    sendExceptionsToPostHog?: boolean;\n}","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"getLibraryId","path":"src/entrypoints/index.node.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"initializeContext","path":"src/entrypoints/index.node.ts","title":"initializeContext","params":[],"details":null,"category":"","examples":[{"id":"initializecontext","code":"// Generated example for initializeContext\nposthog.initializeContext();","name":"Generated example for initializeContext"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogContext","name":"PostHogContext"}},{"id":"PostHog","path":"src/entrypoints/index.node.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog project API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"Configuration options for the client"}],"details":null,"category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// Basic initialization\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  { host: 'https://app.posthog.com' }\n)\n\n\n","name":"Basic initialization"},{"id":"with_personal_api_key","code":"\n\n// With personal API key\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  {\n    host: 'https://app.posthog.com',\n    personalApiKey: 'your-personal-api-key'\n  }\n)\n\n\n\n","name":"With personal API key"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Initialize a new PostHog client instance."},{"id":"alias","path":"src/entrypoints/index.node.ts","title":"alias","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user","code":"\n\n// Link an anonymous user to an identified user\nclient.alias({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create an alias to link two distinct IDs together."},{"id":"aliasImmediate","path":"src/entrypoints/index.node.ts","title":"aliasImmediate","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user_immediately","code":"\n\n// Link an anonymous user to an identified user immediately\nawait client.aliasImmediate({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user immediately"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Create an alias to link two distinct IDs together immediately (synchronously)."},{"id":"capture","path":"src/entrypoints/index.node.ts","title":"capture","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_capture","code":"\n\n// Basic capture\nclient.capture({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n\n","name":"Basic capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an event manually."},{"id":"captureException","path":"src/entrypoints/index.node.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"},{"name":"uuid","type":"EventMessage['uuid']","isOptional":true,"description":""}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_with_user_id","code":"\n\n// Capture an error with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  client.captureException(error, 'user_123')\n}\n\n\n","name":"Capture an error with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  client.captureException(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an error exception as an event."},{"id":"captureExceptionImmediate","path":"src/entrypoints/index.node.ts","title":"captureExceptionImmediate","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_immediately_with_user_id","code":"\n\n// Capture an error immediately with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123')\n}\n\n\n","name":"Capture an error immediately with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an error exception as an event immediately (synchronously)."},{"id":"captureImmediate","path":"src/entrypoints/index.node.ts","title":"captureImmediate","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_immediate_capture","code":"\n\n// Basic immediate capture\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n","name":"Basic immediate capture"},{"id":"with_feature_flags","code":"\n\n// With feature flags\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: true\n})\n\n\n","name":"With feature flags"},{"id":"with_custom_feature_flags_options","code":"\n\n// With custom feature flags options\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: {\n    onlyEvaluateLocally: true,\n    personProperties: { plan: 'premium' },\n    groupProperties: { org: { tier: 'enterprise' } }\n    flagKeys: ['flag1', 'flag2']\n  }\n})\n\n\n\n","name":"With custom feature flags options"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an event immediately (synchronously)."},{"id":"debug","path":"src/entrypoints/index.node.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":"Whether to enable debug logging"}],"details":null,"category":"Initialization","examples":[{"id":"enable_debug_logging","code":"\n\n// Enable debug logging\nclient.debug(true)\n\n\n","name":"Enable debug logging"},{"id":"disable_debug_logging","code":"\n\n// Disable debug logging\nclient.debug(false)\n\n\n\n","name":"Disable debug logging"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enable or disable debug logging."},{"id":"disable","path":"src/entrypoints/index.node.ts","title":"disable","params":[],"details":null,"category":"Privacy","examples":[{"id":"disable_client","code":"\n\n// Disable client\nawait client.disable()\n// Client is now disabled and will not capture events\n\n\n\n","name":"Disable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Disable the PostHog client (opt-out)."},{"id":"enable","path":"src/entrypoints/index.node.ts","title":"enable","params":[],"details":null,"category":"Privacy","examples":[{"id":"enable_client","code":"\n\n// Enable client\nawait client.enable()\n// Client is now enabled and will capture events\n\n\n\n","name":"Enable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Enable the PostHog client (opt-in)."},{"id":"getAllFlags","path":"src/entrypoints/index.node.ts","title":"getAllFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_for_a_user","code":"\n\n// Get all flags for a user\nconst allFlags = await client.getAllFlags('user_123')\nconsole.log('User flags:', allFlags)\n// Output: { 'flag-1': 'variant-a', 'flag-2': false, 'flag-3': 'variant-b' }\n\n\n","name":"Get all flags for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst specificFlags = await client.getAllFlags('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst orgFlags = await client.getAllFlags('user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, FeatureFlagValue>>","name":"Promise<Record<string, FeatureFlagValue>>"},"description":"Get all feature flag values for a specific user."},{"id":"getAllFlagsAndPayloads","path":"src/entrypoints/index.node.ts","title":"getAllFlagsAndPayloads","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_and_payloads_for_a_user","code":"\n\n// Get all flags and payloads for a user\nconst result = await client.getAllFlagsAndPayloads('user_123')\nconsole.log('Flags:', result.featureFlags)\nconsole.log('Payloads:', result.featureFlagPayloads)\n\n\n","name":"Get all flags and payloads for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsAndPayloadsResponse>","name":"Promise<PostHogFlagsAndPayloadsResponse>"},"description":"Get all feature flag values and payloads for a specific user."},{"id":"getContext","path":"src/entrypoints/index.node.ts","title":"getContext","params":[],"details":null,"category":"Context","examples":[{"id":"get_current_context_within_a_withcontext_block","code":"\n\n// Get current context within a withContext block\nposthog.withContext({ distinctId: 'user_123' }, () => {\n  const context = posthog.getContext()\n  console.log(context?.distinctId) // 'user_123'\n})\n\n\n\n","name":"Get current context within a withContext block"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"ContextData | undefined","name":"ContextData | undefined"},"description":"Get the current context data."},{"id":"getCustomUserAgent","path":"src/entrypoints/index.node.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"Identification","examples":[{"id":"get_user_agent","code":"\n\n// Get user agent\nconst userAgent = client.getCustomUserAgent()\n// Returns: \"posthog-node/5.7.0\"\n\n\n\n","name":"Get user agent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the custom user agent string for this client."},{"id":"getFeatureFlag","path":"src/entrypoints/index.node.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst flagValue = await client.getFeatureFlag('new-feature', 'user_123')\nif (flagValue === 'variant-a') {\n  // Show variant A\n} else if (flagValue === 'variant-b') {\n  // Show variant B\n} else {\n  // Flag is disabled or not found\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst flagValue = await client.getFeatureFlag('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' },\n  groupProperties: { organization: { tier: 'premium' } }\n})\n\n\n","name":"With groups and properties"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst flagValue = await client.getFeatureFlag('local-flag', 'user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<FeatureFlagValue | undefined>","name":"Promise<FeatureFlagValue | undefined>"},"description":"Get the value of a feature flag for a specific user."},{"id":"getFeatureFlagPayload","path":"src/entrypoints/index.node.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"matchValue","type":"FeatureFlagValue","isOptional":true,"description":"Optional match value to get payload for"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_payload_for_a_feature_flag","code":"\n\n// Get payload for a feature flag\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123')\nif (payload) {\n  console.log('Flag payload:', payload)\n}\n\n\n","name":"Get payload for a feature flag"},{"id":"get_payload_with_specific_match_value","code":"\n\n// Get payload with specific match value\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123', 'variant-a')\n\n\n","name":"Get payload with specific match value"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst payload = await client.getFeatureFlagPayload('org-flag', 'user_123', undefined, {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the payload for a feature flag."},{"id":"getFeatureFlagResult","path":"src/entrypoints/index.node.ts","title":"getFeatureFlagResult","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_flag_result","code":"\n\n// Get flag result\nconst result = await client.getFeatureFlagResult('my-flag', 'user_123')\nif (result) {\n  console.log('Flag enabled:', result.enabled)\n  console.log('Variant:', result.variant)\n  console.log('Payload:', result.payload)\n}\n\n\n","name":"Get flag result"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst result = await client.getFeatureFlagResult('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<FeatureFlagResult | undefined>","name":"Promise<FeatureFlagResult | undefined>"},"description":"Get the result of evaluating a feature flag, including its value and payload. This is more efficient than calling getFeatureFlag and getFeatureFlagPayload separately when you need both."},{"id":"getLibraryVersion","path":"src/entrypoints/index.node.ts","title":"getLibraryVersion","params":[],"details":null,"category":"Initialization","examples":[{"id":"get_version","code":"\n\n// Get version\nconst version = client.getLibraryVersion()\nconsole.log(`Using PostHog SDK version: ${version}`)\n\n\n\n","name":"Get version"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the library version from package.json."},{"id":"getPersistedProperty","path":"src/entrypoints/index.node.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to retrieve"}],"details":null,"category":"Initialization","examples":[{"id":"get_user_id","code":"\n\n// Get user ID\nconst userId = client.getPersistedProperty('userId')\n\n\n","name":"Get user ID"},{"id":"get_session_id","code":"\n\n// Get session ID\nconst sessionId = client.getPersistedProperty('sessionId')\n\n\n\n","name":"Get session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any | undefined","name":"any | undefined"},"description":"Get a persisted property value from memory storage."},{"id":"getRemoteConfigPayload","path":"src/entrypoints/index.node.ts","title":"getRemoteConfigPayload","params":[{"name":"flagKey","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_remote_config_payload","code":"\n\n// Get remote config payload\nconst payload = await client.getRemoteConfigPayload('flag-key')\nif (payload) {\n  console.log('Remote config payload:', payload)\n}\n\n\n\n\n","name":"Get remote config payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the remote config payload for a feature flag."},{"id":"groupIdentify","path":"src/entrypoints/index.node.ts","title":"groupIdentify","params":[{"name":"{ groupType, groupKey, properties, distinctId, disableGeoip }","type":"GroupIdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"create_a_company_group","code":"\n\n// Create a company group\nclient.groupIdentify({\n  groupType: 'company',\n  groupKey: 'acme-corp',\n  properties: {\n    name: 'Acme Corporation',\n    industry: 'Technology',\n    employee_count: 500\n  },\n  distinctId: 'user_123'\n})\n\n\n","name":"Create a company group"},{"id":"update_organization_properties","code":"\n\n// Update organization properties\nclient.groupIdentify({\n  groupType: 'organization',\n  groupKey: 'org-456',\n  properties: {\n    plan: 'enterprise',\n    region: 'US-West'\n  }\n})\n\n\n\n","name":"Update organization properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create or update a group and its properties."},{"id":"identify","path":"src/entrypoints/index.node.ts","title":"identify","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_identify_with_properties","code":"\n\n// Basic identify with properties\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com',\n    plan: 'premium'\n  }\n})\n\n\n","name":"Basic identify with properties"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    $set: { name: 'John Doe', email: 'john@example.com' },\n    $set_once: { first_login: new Date().toISOString() }\n    $anon_distinct_id: 'anonymous_user_456'\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Identify a user and set their properties."},{"id":"identifyImmediate","path":"src/entrypoints/index.node.ts","title":"identifyImmediate","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_immediate_identify","code":"\n\n// Basic immediate identify\nawait client.identifyImmediate({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com'\n  }\n})\n\n\n\n","name":"Basic immediate identify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Identify a user and set their properties immediately (synchronously)."},{"id":"isFeatureEnabled","path":"src/entrypoints/index.node.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst isEnabled = await client.isFeatureEnabled('new-feature', 'user_123')\nif (isEnabled) {\n  // Feature is enabled\n  console.log('New feature is active')\n} else {\n  // Feature is disabled\n  console.log('New feature is not active')\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst isEnabled = await client.isFeatureEnabled('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean | undefined>","name":"Promise<boolean | undefined>"},"description":"Check if a feature flag is enabled for a specific user."},{"id":"isLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"isLocalEvaluationReady","params":[],"details":null,"category":"Feature flags","examples":[{"id":"check_if_ready","code":"\n\n// Check if ready\nif (client.isLocalEvaluationReady()) {\n  // Local evaluation is ready, can evaluate flags locally\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n} else {\n  // Local evaluation not ready, will use remote evaluation\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n}\n\n\n\n","name":"Check if ready"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Check if local evaluation of feature flags is ready."},{"id":"overrideFeatureFlags","path":"src/entrypoints/index.node.ts","title":"overrideFeatureFlags","params":[{"name":"overrides","type":"OverrideFeatureFlagsOptions","isOptional":false,"description":"Flag overrides configuration"}],"details":null,"category":"Feature flags","examples":[{"id":"clear_all_overrides","code":"\n\n// Clear all overrides\nclient.overrideFeatureFlags(false)\n\n// Enable a list of flags (sets them to true)\nclient.overrideFeatureFlags(['flag-a', 'flag-b'])\n\n// Set specific flag values/variants\nclient.overrideFeatureFlags({ 'my-flag': 'variant-a', 'other-flag': true })\n\n// Set both flags and payloads\nclient.overrideFeatureFlags({\n  flags: { 'my-flag': 'variant-a' },\n  payloads: { 'my-flag': { discount: 20 } }\n})\n\n\n\n","name":"Clear all overrides"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Override feature flags locally. Useful for testing and local development. Overridden flags take precedence over both local evaluation and remote evaluation."},{"id":"prepareEventMessage","path":"src/entrypoints/index.node.ts","title":"prepareEventMessage","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"prepareeventmessage","code":"// Generated example for prepareEventMessage\nposthog.prepareEventMessage();","name":"Generated example for prepareEventMessage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>","name":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>"}},{"id":"reloadFeatureFlags","path":"src/entrypoints/index.node.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"force_reload_of_feature_flags","code":"\n\n// Force reload of feature flags\nawait client.reloadFeatureFlags()\nconsole.log('Feature flags reloaded')\n\n\n","name":"Force reload of feature flags"},{"id":"reload_before_checking_a_specific_flag","code":"\n\n// Reload before checking a specific flag\nawait client.reloadFeatureFlags()\nconst flag = await client.getFeatureFlag('flag-key', 'user_123')\n\n\n\n","name":"Reload before checking a specific flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Reload feature flag definitions from the server for local evaluation."},{"id":"setPersistedProperty","path":"src/entrypoints/index.node.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to set"},{"name":"value","type":"any | null","isOptional":false,"description":"The value to store (null to remove)"}],"details":null,"category":"Initialization","examples":[{"id":"set_user_id","code":"\n\n// Set user ID\nclient.setPersistedProperty('userId', 'user_123')\n\n\n","name":"Set user ID"},{"id":"set_session_id","code":"\n\n// Set session ID\nclient.setPersistedProperty('sessionId', 'session_456')\n\n\n\n","name":"Set session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Set a persisted property value in memory storage."},{"id":"waitForLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"waitForLocalEvaluationReady","params":[{"name":"timeoutMs","type":"number","isOptional":true,"description":"Timeout in milliseconds (default: 30000)"}],"details":null,"category":"Feature flags","examples":[{"id":"wait_for_local_evaluation","code":"\n\n// Wait for local evaluation\nconst isReady = await client.waitForLocalEvaluationReady()\nif (isReady) {\n  console.log('Local evaluation is ready')\n} else {\n  console.log('Local evaluation timed out')\n}\n\n\n","name":"Wait for local evaluation"},{"id":"wait_with_custom_timeout","code":"\n\n// Wait with custom timeout\nconst isReady = await client.waitForLocalEvaluationReady(10000) // 10 seconds\n\n\n\n","name":"Wait with custom timeout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean>","name":"Promise<boolean>"},"description":"Wait for local evaluation of feature flags to be ready."},{"id":"withContext","path":"src/entrypoints/index.node.ts","title":"withContext","params":[{"name":"data","type":"Partial<ContextData>","isOptional":false,"description":"Context data to apply (sessionId, distinctId, properties, enableExceptionAutocapture)"},{"name":"fn","type":"() => T","isOptional":false,"description":"Function to run with the context"},{"name":"options","type":"ContextOptions","isOptional":true,"description":"Context options (fresh: true to start with clean context instead of inheriting)"}],"details":null,"category":"Context","examples":[{"id":"","code":"\n\nposthog.withContext({ distinctId: 'user_123' }, () => {\n  posthog.capture({ event: 'button clicked' })\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"T","name":"T"},"description":"Run a function with specific context that will be applied to all events captured within that context. It propagates the context to all subsequent calls down the call stack. Context properties like tags and sessionId will be automatically attached to all events. By default, nested contexts inherit from parent contexts. Use `{ fresh: true }` to start with a clean context."}]}],"version":"5.25.0","categories":["Initialization","Identification","Capture","Error tracking","Privacy","Feature flags","Context"],"referenceId":"posthog-node"},"createdAt":"2026-02-23T20:15:12.200Z","updatedAt":"2026-02-23T20:15:12.200Z","publishedAt":"2026-02-23T20:15:12.195Z"}},{"id":4,"attributes":{"referenceId":"posthog-js","version":"1.275.3","data":{"id":"posthog-js-1.275.3","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.275.3","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.275.3","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.308Z","updatedAt":"2025-10-25T22:45:01.308Z","publishedAt":"2025-10-25T22:45:01.302Z"}},{"id":5,"attributes":{"referenceId":"posthog-js","version":"1.276.0","data":{"id":"posthog-js-1.276.0","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.276.0","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.276.0","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.330Z","updatedAt":"2025-10-25T22:45:01.330Z","publishedAt":"2025-10-25T22:45:01.325Z"}},{"id":6,"attributes":{"referenceId":"posthog-js","version":"1.277.0","data":{"id":"posthog-js-1.277.0","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.277.0","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.277.0","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.353Z","updatedAt":"2025-10-25T22:45:01.353Z","publishedAt":"2025-10-25T22:45:01.348Z"}},{"id":7,"attributes":{"referenceId":"posthog-js","version":"1.278.0","data":{"id":"posthog-js-1.278.0","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.278.0","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nWARNING: Disabling this will also prevent remote configuration from loading, which could mean features like web vitals, surveys, and other features configured in PostHog settings are disabled unless explicitly enabled via client-side config. When setting this to true, make sure to explicitly configure any features you want to use (e.g., capture_performance, autocapture, etc.) in your SDK's init config.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.278.0","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.391Z","updatedAt":"2025-10-25T22:45:01.391Z","publishedAt":"2025-10-25T22:45:01.387Z"}},{"id":8,"attributes":{"referenceId":"posthog-js","version":"1.279.0","data":{"id":"posthog-js-1.279.0","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.279.0","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nWARNING: Disabling this will also prevent remote configuration from loading, which could mean features like web vitals, surveys, and other features configured in PostHog settings are disabled unless explicitly enabled via client-side config. When setting this to true, make sure to explicitly configure any features you want to use (e.g., capture_performance, autocapture, etc.) in your SDK's init config.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.279.0","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.515Z","updatedAt":"2025-10-25T22:45:01.515Z","publishedAt":"2025-10-25T22:45:01.419Z"}},{"id":9,"attributes":{"referenceId":"posthog-js","version":"1.279.1","data":{"id":"posthog-js-1.279.1","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.279.1","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nWARNING: Disabling this will also prevent remote configuration from loading, which could mean features like web vitals, surveys, and other features configured in PostHog settings are disabled unless explicitly enabled via client-side config. When setting this to true, make sure to explicitly configure any features you want to use (e.g., capture_performance, autocapture, etc.) in your SDK's init config.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.279.1","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.657Z","updatedAt":"2025-10-25T22:45:01.657Z","publishedAt":"2025-10-25T22:45:01.642Z"}},{"id":10,"attributes":{"referenceId":"posthog-js","version":"1.279.2","data":{"id":"posthog-js-1.279.2","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.279.2","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nWARNING: Disabling this will also prevent remote configuration from loading, which could mean features like web vitals, surveys, and other features configured in PostHog settings are disabled unless explicitly enabled via client-side config. When setting this to true, make sure to explicitly configure any features you want to use (e.g., capture_performance, autocapture, etc.) in your SDK's init config.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.279.2","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.709Z","updatedAt":"2025-10-25T22:45:01.709Z","publishedAt":"2025-10-25T22:45:01.705Z"}},{"id":11,"attributes":{"referenceId":"posthog-js","version":"1.279.3","data":{"id":"posthog-js-1.279.3","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.279.3","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nWARNING: Disabling this will also prevent remote configuration from loading, which could mean features like web vitals, surveys, and other features configured in PostHog settings are disabled unless explicitly enabled via client-side config. When setting this to true, make sure to explicitly configure any features you want to use (e.g., capture_performance, autocapture, etc.) in your SDK's init config.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.279.3","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.738Z","updatedAt":"2025-10-25T22:45:01.738Z","publishedAt":"2025-10-25T22:45:01.732Z"}},{"id":12,"attributes":{"referenceId":"posthog-js","version":"1.280.0","data":{"id":"posthog-js-1.280.0","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.280.0","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__capturePostHogExceptions","type":"boolean","description":"UNSTABLE: determines whether exception caused by the PostHog SDK will be captured\nfalse"},{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nWARNING: Disabling this will also prevent remote configuration from loading, which could mean features like web vitals, surveys, and other features configured in PostHog settings are disabled unless explicitly enabled via client-side config. When setting this to true, make sure to explicitly configure any features you want to use (e.g., capture_performance, autocapture, etc.) in your SDK's init config.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.280.0","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.829Z","updatedAt":"2025-10-25T22:45:01.829Z","publishedAt":"2025-10-25T22:45:01.825Z"}},{"id":13,"attributes":{"referenceId":"posthog-js","version":"1.280.1","data":{"id":"posthog-js-1.280.1","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.280.1","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"AutocaptureCompatibleElement","name":"AutocaptureCompatibleElement","path":"lib/src/types.d.ts","example":"\"a\" | \"button\" | \"form\" | \"input\" | \"select\" | \"textarea\" | \"label\"","properties":[]},{"id":"AutocaptureConfig","name":"AutocaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"capture_copied_text","type":"boolean","description":"When set to true, autocapture will capture the text of any element that is cut or copied."},{"name":"css_selector_allowlist","type":"string[]","description":"List of CSS selectors to allow autocapture on e.g. ['[ph-capture]'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and allow list config `['[id]']` we will capture the click if the click-target or its parents has any id\nEverything is allowed when there's no allowlist"},{"name":"dom_event_allowlist","type":"DomAutocaptureEvents[]","description":"List of DOM events to allow autocapture on e.g. ['click', 'change', 'submit']"},{"name":"element_allowlist","type":"AutocaptureCompatibleElement[]","description":"List of DOM elements to allow autocapture on e.g. ['a', 'button', 'form', 'input', 'select', 'textarea', 'label']\nWe consider the tree of elements from the root to the target element of the click event so for the tree `div > div > button > svg` if the allowlist has `button` then we allow the capture when the `button` or the `svg` is the click target but not if either of the `div`s are detected as the click target"},{"name":"element_attribute_ignorelist","type":"string[]","description":"Exclude certain element attributes from autocapture E.g. ['aria-label'] or [data-attr-pii]"},{"name":"url_allowlist","type":"(string | RegExp)[]","description":"List of URLs to allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on specific pages only\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"},{"name":"url_ignorelist","type":"(string | RegExp)[]","description":"List of URLs to not allow autocapture on, can be strings to match or regexes e.g. ['https://example.com', 'test.com/.*'] this is useful when you want to autocapture on most pages but not some specific ones\nif you set both url_allowlist and url_ignorelist, we check the allowlist first and then the ignorelist. the ignorelist can override the allowlist"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"lib/src/types.d.ts","example":"(cr: CaptureResult | null) => CaptureResult | null","properties":[]},{"id":"BootstrapConfig","name":"BootstrapConfig","path":"lib/src/types.d.ts","properties":[{"name":"distinctID","type":"string"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, boolean | string>"},{"name":"isIdentifiedID","type":"boolean"},{"name":"sessionID","type":"string","description":"Optionally provide a sessionID, this is so that you can provide an existing sessionID here to continue a user's session across a domain or device. It MUST be: - unique to this user - a valid UUID v7 - the timestamp part must be = the timestamp of the first event in the session - the timestamp of the last event in the session must be  the timestamp part + 24 hours *"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"CapturedNetworkRequest","name":"CapturedNetworkRequest","path":"lib/src/types.d.ts","example":"Writable<Omit<PerformanceEntry, 'toJSON'>> & {\n    method?: string;\n    initiatorType?: InitiatorType;\n    status?: number;\n    timeOrigin?: number;\n    timestamp?: number;\n    startTime?: number;\n    endTime?: number;\n    requestHeaders?: Headers;\n    requestBody?: string | null;\n    responseHeaders?: Headers;\n    responseBody?: string | null;\n    isInitial?: boolean;\n}","properties":[]},{"id":"CaptureOptions","name":"CaptureOptions","path":"lib/src/types.d.ts","properties":[{"name":"_batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"},{"name":"_noTruncate","type":"boolean","description":"If set, overrides and disables config.properties_string_max_length"},{"name":"_url","type":"string","description":"Used to override the desired endpoint for the captured event"},{"name":"$set_once","type":"Properties","description":"Used when `$identify` is called Will set person properties but only once, it will NOT override previous values"},{"name":"$set","type":"Properties","description":"Used when `$identify` is called Will set person properties overriding previous values"},{"name":"send_instantly","type":"boolean","description":"If set, skips the batched queue"},{"name":"skip_client_rate_limiting","type":"boolean","description":"If set, skips the client side rate limiting"},{"name":"timestamp","type":"Date","description":"If set, overrides the current timestamp"},{"name":"transport","type":"RequestWithOptions['transport']","description":"If set, overrides the desired transport method"}]},{"id":"CaptureResult","name":"CaptureResult","path":"lib/src/types.d.ts","properties":[{"name":"$set_once","type":"Properties"},{"name":"$set","type":"Properties"},{"name":"event","type":"EventName"},{"name":"properties","type":"Properties"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConfigDefaults","name":"ConfigDefaults","path":"lib/src/types.d.ts","example":"\"2025-05-24\" | \"unset\"","properties":[]},{"id":"DeadClickCandidate","name":"DeadClickCandidate","path":"lib/src/types.d.ts","properties":[{"name":"absoluteDelayMs","type":"number"},{"name":"mutationDelayMs","type":"number"},{"name":"node","type":"Element"},{"name":"originalEvent","type":"MouseEvent"},{"name":"scrollDelayMs","type":"number"},{"name":"selectionChangedDelayMs","type":"number"},{"name":"timestamp","type":"number"}]},{"id":"DeadClicksAutoCaptureConfig","name":"DeadClicksAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    scroll_threshold_ms?: number;\n    selection_change_threshold_ms?: number;\n    mutation_threshold_ms?: number;\n    __onCapture?: ((click: DeadClickCandidate, properties: Properties) => void) | undefined;\n} & Pick<AutocaptureConfig, 'element_attribute_ignorelist'>","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"DomAutocaptureEvents","name":"DomAutocaptureEvents","path":"lib/src/types.d.ts","example":"\"click\" | \"change\" | \"submit\"","properties":[]},{"id":"EarlyAccessFeature","name":"EarlyAccessFeature","path":"lib/src/types.d.ts","properties":[{"name":"description","type":"string"},{"name":"documentationUrl","type":"string | null"},{"name":"flagKey","type":"string | null"},{"name":"name","type":"string"},{"name":"stage","type":"'concept' | 'alpha' | 'beta'"}]},{"id":"EarlyAccessFeatureCallback","name":"EarlyAccessFeatureCallback","path":"lib/src/types.d.ts","example":"(earlyAccessFeatures: EarlyAccessFeature[]) => void","properties":[]},{"id":"EarlyAccessFeatureResponse","name":"EarlyAccessFeatureResponse","path":"lib/src/types.d.ts","properties":[{"name":"earlyAccessFeatures","type":"EarlyAccessFeature[]"}]},{"id":"EarlyAccessFeatureStage","name":"EarlyAccessFeatureStage","path":"lib/src/types.d.ts","example":"\"concept\" | \"alpha\" | \"beta\" | \"general-availability\"","properties":[]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__capturePostHogExceptions","type":"boolean","description":"UNSTABLE: determines whether exception caused by the PostHog SDK will be captured\nfalse"},{"name":"__exceptionRateLimiterBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"__exceptionRateLimiterRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n1"},{"name":"captureExtensionExceptions","type":"boolean","description":"Decide whether exceptions thrown by browser extensions should be captured\nfalse"}]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"lib/src/types.d.ts","example":"{\n    code: string;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"EventName","name":"EventName","path":"lib/src/types.d.ts","example":"\"$pageview\" | \"$identify\" | \"custom_event\" | string","properties":[]},{"id":"ExceptionAutoCaptureConfig","name":"ExceptionAutoCaptureConfig","path":"lib/src/types.d.ts","example":"{\n    capture_unhandled_errors: boolean;\n    capture_unhandled_rejections: boolean;\n    capture_console_errors: boolean;\n}","properties":[]},{"id":"ExternalIntegrationKind","name":"ExternalIntegrationKind","path":"lib/src/types.d.ts","example":"\"intercom\" | \"crispChat\"","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","path":"lib/src/types.d.ts","example":"{\n    key: string;\n    enabled: boolean;\n    original_enabled?: boolean | undefined;\n    variant: string | undefined;\n    original_variant?: string | undefined;\n    reason: EvaluationReason | undefined;\n    metadata: FeatureFlagMetadata | undefined;\n}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"lib/src/types.d.ts","example":"{\n    id: number;\n    version: number | undefined;\n    description: string | undefined;\n    payload: JsonType | undefined;\n    original_payload?: JsonType | undefined;\n}","properties":[]},{"id":"FeatureFlagsCallback","name":"FeatureFlagsCallback","path":"lib/src/types.d.ts","example":"(flags: string[], variants: Record<string, string | boolean>, context?: {\n    errorsLoading?: boolean;\n}) => void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"Headers_2","name":"Headers_2","path":"lib/src/types.d.ts","example":"Record<string, string>","properties":[]},{"id":"HeatmapConfig","name":"HeatmapConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_milliseconds","type":"number","description":"How often to send batched data in `$heatmap_data` events If set to 0 or not set, sends using the default interval of 1 second\n1000"}]},{"id":"InitiatorType","name":"InitiatorType","path":"lib/src/types.d.ts","example":"\"audio\" | \"beacon\" | \"body\" | \"css\" | \"early-hint\" | \"embed\" | \"fetch\" | \"frame\" | \"iframe\" | \"icon\" | \"image\" | \"img\" | \"input\" | \"link\" | \"navigation\" | \"object\" | \"ping\" | \"script\" | \"track\" | \"video\" | \"xmlhttprequest\"","properties":[]},{"id":"JsonRecord","name":"JsonRecord","path":"lib/src/types.d.ts","example":"{\n    [key: string]: JsonType;\n}","properties":[]},{"id":"JsonType","name":"JsonType","path":"lib/src/types.d.ts","example":"string | number | boolean | null | undefined | JsonRecord | Array<JsonType>","properties":[]},{"id":"KnownEventName","name":"KnownEventName","path":"lib/src/types.d.ts","example":"\"$heatmaps_data\" | \"$opt_in\" | \"$exception\" | \"$$heatmap\" | \"$web_vitals\" | \"$dead_click\" | \"$autocapture\" | \"$rageclick\"","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"NetworkRequest","name":"NetworkRequest","path":"lib/src/types.d.ts","example":"{\n    url: string;\n}","properties":[]},{"id":"PerformanceCaptureConfig","name":"PerformanceCaptureConfig","path":"lib/src/types.d.ts","properties":[{"name":"__web_vitals_max_value","type":"number","description":"We observe very large values reported by the Chrome web vitals library These outliers are likely not real, useful values, and we exclude them You can set this to 0 in order to include all values, NB this is not recommended\n15 * 60 * 1000 (15 minutes)"},{"name":"network_timing","type":"boolean","description":"Works with session replay to use the browser's native performance observer to capture performance metrics"},{"name":"web_vitals_allowed_metrics","type":"SupportedWebVitalsMetrics[]","description":"By default all 4 metrics are captured You can set this config to restrict which metrics are captured e.g. ['CLS', 'FCP'] to only capture those two metrics NB setting this does not override whether the capture is enabled\n['LCP', 'CLS', 'FCP', 'INP']"},{"name":"web_vitals_delayed_flush_ms","type":"number","description":"We delay flushing web vitals metrics to reduce the number of events we send This is the maximum time we will wait before sending the metrics\n5000"},{"name":"web_vitals","type":"boolean","description":"Use chrome's web vitals library to wrap fetch and capture web vitals"}]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","properties":[{"name":"__add_tracing_headers","type":"string[]","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION A list of hostnames for which to inject PostHog tracing headers to all requests (X-POSTHOG-DISTINCT-ID, X-POSTHOG-SESSION-ID, X-POSTHOG-WINDOW-ID)"},{"name":"__preview_disable_beacon","type":"boolean","description":"Prevents posthog-js from using the `navigator.sendBeacon` API to send events. Enabling this option may hurt the reliability of sending $pageleave events"},{"name":"__preview_disable_xhr_credentials","type":"boolean","description":"Disables sending credentials when using XHR requests."},{"name":"__preview_eager_load_replay","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - ONLY USE WHEN TALKING TO POSTHOG SUPPORT Enables deprecated eager loading of session recording code, not just rrweb and network plugin we are switching the default to lazy loading because the bundle will ultimately be 18% smaller then keeping this around for a few days in case there are unexpected consequences that testing did not uncover"},{"name":"__preview_flags_v2","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Whether to use the new /flags/ endpoint"},{"name":"__preview_lazy_load_replay","type":"boolean","description":""},{"name":"__preview_remote_config","type":"boolean","description":"PREVIEW - MAY CHANGE WITHOUT WARNING - DO NOT USE IN PRODUCTION Enables the new RemoteConfig approach to loading config instead of /flags?v=2&config=true"},{"name":"_onCapture","type":"(eventName: string, eventData: CaptureResult) => void","description":""},{"name":"advanced_disable_decide","type":"boolean","description":""},{"name":"advanced_disable_feature_flags_on_first_load","type":"boolean","description":"Stops from firing feature flag requests on first page load. Only requests feature flags when user identity or properties are updated, or you manually request for flags to be loaded.\nfalse"},{"name":"advanced_disable_feature_flags","type":"boolean","description":"Will keep /flags running, but without evaluating any feature flags. Useful for when you need to load the config data associated with the flags endpoint (e.g. /flags?v=2&config=true) without evaluating any feature flags. Most folks use this to save money on feature flag evaluation (by bootstrapping feature flags on the server side).\nfalse"},{"name":"advanced_disable_flags","type":"boolean","description":"One of the very first things the PostHog library does when init() is called is make a request to the /flags endpoint on PostHog's backend. This endpoint contains information on how to run the PostHog library so events are properly received in the backend, and it also contains feature flag evaluation information for the current user.\nThis endpoint is required to run most features of this library. However, if you're not using any of the described features, you may wish to turn off the call completely to avoid an extra request and reduce resource usage on both the client and the server.\nWARNING: Disabling this will also prevent remote configuration from loading, which could mean features like web vitals, surveys, and other features configured in PostHog settings are disabled unless explicitly enabled via client-side config. When setting this to true, make sure to explicitly configure any features you want to use (e.g., capture_performance, autocapture, etc.) in your SDK's init config.\nfalse"},{"name":"advanced_disable_toolbar_metrics","type":"boolean","description":"Determines whether PostHog should disable toolbar metrics. This is our internal instrumentation for our toolbar in your website.\nfalse"},{"name":"advanced_enable_surveys","type":"boolean","description":"When this is enabled, surveys will always be initialized, regardless of the /flags response or remote config settings. This is useful if you want to use surveys but disable all other flag-dependent functionality. Used internally for displaying external surveys without making a /flags request.\nfalse"},{"name":"advanced_only_evaluate_survey_feature_flags","type":"boolean","description":"Determines whether PostHog should only evaluate feature flags for surveys. Useful for when you want to use this library to evaluate feature flags for surveys only but you have additional feature flags that you evaluate on the server side.\nfalse"},{"name":"api_host","type":"string","description":"URL of your PostHog instance.\n'https://us.i.posthog.com'"},{"name":"api_method","type":"string","description":""},{"name":"api_transport","type":"'XHR' | 'fetch'","description":"The transport method to use for API requests.\n'fetch'"},{"name":"autocapture","type":"boolean | AutocaptureConfig","description":"Determines whether PostHog should autocapture events. This setting does not affect capturing pageview events (see `capture_pageview`).\nby default autocapture is ignored on elements that match a `ph-no-capture` css class on the element or a parent   true"},{"name":"before_send","type":"BeforeSendFn | BeforeSendFn[]","description":"This function or array of functions - if provided - are called immediately before sending data to the server. It allows you to edit data before it is sent, or choose not to send it all. if provided as an array the functions are called in the order they are provided any one function returning null means the event will not be sent"},{"name":"bootstrap","type":"BootstrapConfig","description":"An object containing the `distinctID`, `isIdentifiedID`, and `featureFlags` keys, where `distinctID` is a string, and `featureFlags` is an object of key-value pairs.\nSince there is a delay between initializing PostHog and fetching feature flags, feature flags are not always available immediately. This makes them unusable if you want to do something like redirecting a user to a different page based on a feature flag.\nYou can, therefore, fetch the feature flags in your server and pre-fill them here, allowing PostHog to know the feature flag values immediately.\nAfter the SDK fetches feature flags from PostHog, it will use those flag values instead of bootstrapped ones."},{"name":"capture_dead_clicks","type":"boolean | DeadClicksAutoCaptureConfig","description":"Determines whether to capture dead clicks."},{"name":"capture_exceptions","type":"boolean | ExceptionAutoCaptureConfig","description":"Determines whether to capture exceptions."},{"name":"capture_heatmaps","type":"boolean | HeatmapConfig","description":"Determines whether to capture heatmaps."},{"name":"capture_pageleave","type":"boolean | 'if_capture_pageview'","description":"Determines whether PostHog should capture pageleave events. If set to `true`, it will capture pageleave events for all pages. If set to `'if_capture_pageview'`, it will only capture pageleave events if `capture_pageview` is also set to `true` or `'history_change'`.\n'if_capture_pageview'"},{"name":"capture_pageview","type":"boolean | 'history_change'","description":"Determines whether PostHog should capture pageview events automatically. Can be: - `true`: Capture regular pageviews (default) - `false`: Don't capture any pageviews - `'history_change'`: Only capture pageviews on history API changes (pushState, replaceState, popstate)\ntrue"},{"name":"capture_performance","type":"boolean | PerformanceCaptureConfig","description":"Determines whether to capture performance metrics. These include Network Timing and Web Vitals.\nWhen `undefined`, fallback to the remote configuration. If `false`, neither network timing nor web vitals will work. If an object, that will override the remote configuration."},{"name":"consent_persistence_name","type":"string | null","description":"Determines the key for the cookie / local storage used to store the information about whether users are opted in/out of capturing. When `null`, we used a key based on your token.\nnull"},{"name":"cookie_expiration","type":"number","description":"Determines the number of days to store cookies for.\n365"},{"name":"cookie_name","type":"string","description":""},{"name":"cookieless_mode","type":"'always' | 'on_reject'","description":"Enables cookieless mode. In this mode, PostHog will not set any cookies, or use session or local storage. User identity is handled by generating a privacy-preserving hash on PostHog's servers. - 'always' - enable cookieless mode immediately on startup, use this if you do not intend to show a cookie banner - 'on_reject' - enable cookieless mode only if the user rejects cookies, use this if you want to show a cookie banner. If the user accepts cookies, cookieless mode will not be used, and PostHog will use cookies and local storage as usual.\nNote that you MUST enable cookieless mode in your PostHog project's settings, otherwise all your cookieless events will be ignored. We plan to remove this requirement in the future."},{"name":"cross_subdomain_cookie","type":"boolean","description":"Determines if cookie should be set on the top level domain (example.com). If PostHog-js is loaded on a subdomain (test.example.com), and `cross_subdomain_cookie` is set to false, it'll set the cookie on the subdomain only (test.example.com).\nNOTE: It will be set to `false` if we detect that the domain is a subdomain of a platform that is excluded from cross-subdomain cookie setting. The current list of excluded platforms is `herokuapp.com`, `vercel.app`, and `netlify.app`."},{"name":"custom_blocked_useragents","type":"string[]","description":"Used to extend the list of user agents that are blocked by default."},{"name":"custom_campaign_params","type":"string[]","description":"Used to extend the list of campaign parameters that are saved by default."},{"name":"custom_personal_data_properties","type":"string[]","description":"Custom list of personal data properties to mask.\nE.g. if you added `email` to this list, then any `email` property in the URL will be masked. https://www.example.com/login?email=john.doe%40example.com = https://www.example.com/login?email=\n[]"},{"name":"debug","type":"boolean","description":"Determines whether PostHog should be in debug mode. You can enable this to get more detailed logging.\nYou can also enable this on your website by appending `?__posthog_debug=true` at the end of your URL You can also call `posthog.debug()` in your code to enable debug mode\nfalse"},{"name":"defaults","type":"ConfigDefaults","description":"Configuration defaults for breaking changes. When set to a specific date, enables new default behaviors that were introduced on that date.\n- `'unset'`: Use legacy default behaviors - `'2025-05-24'`: Use updated default behaviors (e.g. capture_pageview defaults to 'history_change')\n'unset'"},{"name":"disable_compression","type":"boolean","description":"Determines whether to disable compression when sending events to the server. WARNING: Should only be used for testing. Could negatively impact performance.\nfalse"},{"name":"disable_cookie","type":"boolean","description":""},{"name":"disable_external_dependency_loading","type":"boolean","description":"Determines whether PostHog should disable any external dependency loading. This will prevent PostHog from requesting any external scripts such as those needed for Session Replay, Surveys or Site Apps.\nfalse"},{"name":"disable_persistence","type":"boolean","description":"Determines whether PostHog should disable persistence. If set to `true`, the library will not save any data to the browser. It will also delete any data previously saved to the browser.\nfalse"},{"name":"disable_scroll_properties","type":"boolean","description":"Determines whether to disable scroll properties. These allow you to keep track of how far down someone scrolled in your website.\nfalse"},{"name":"disable_session_recording","type":"boolean","description":"Determines whether PostHog should disable session recording.\nfalse"},{"name":"disable_surveys_automatic_display","type":"boolean","description":"Determines whether PostHog should disable automatic display of surveys. If this is true, popup or widget surveys will not be shown when display conditions are met.\nfalse"},{"name":"disable_surveys","type":"boolean","description":"Determines whether PostHog should disable all surveys functionality.\nfalse"},{"name":"disable_web_experiments","type":"boolean","description":"Determines whether PostHog should disable web experiments.\nCurrently disabled while we're in BETA. It will be toggled to `true` in a future release.\ntrue"},{"name":"enable_heatmaps","type":"boolean"},{"name":"enable_recording_console_log","type":"boolean","description":"Determines whether PostHog should enable recording console logs. When undefined, it falls back to the remote config setting.\nundefined"},{"name":"error_tracking","type":"ErrorTrackingOptions","description":"Determines the error tracking options."},{"name":"evaluation_environments","type":"readonly string[]","description":"Evaluation environments for feature flags. When set, only feature flags that have at least one matching evaluation tag will be evaluated for this SDK instance. Feature flags with no evaluation tags will always be evaluated.\nExamples: ['production', 'web', 'checkout']\nundefined"},{"name":"feature_flag_request_timeout_ms","type":"number","description":"Sets timeout for fetching feature flags\n3000"},{"name":"fetch_options","type":"{\n        cache?: RequestInit['cache'];\n        next_options?: NextOptions;\n    }","description":"Used when sending data via `fetch`, use with care. This is intentionally meant to be used with NextJS `fetch`\nIncorrect `cache` usage may cause out-of-date data for feature flags, actions tracking, etc. See https://nextjs.org/docs/app/api-reference/functions/fetch#fetchurl-options"},{"name":"get_device_id","type":"(uuid: string) => string","description":"Function to get the device ID. This doesn't usually need to be set, but can be useful if you want to use a custom device ID."},{"name":"inapp_link_new_window","type":"boolean","description":""},{"name":"inapp_protocol","type":"string","description":""},{"name":"integrations","type":"Record<ExternalIntegrationKind, boolean>","description":"Used to set-up external integrations with PostHog data - such as session replays, distinct id, etc."},{"name":"ip","type":"boolean","description":""},{"name":"loaded","type":"(posthog_instance: PostHog) => void","description":"A function to be called once the PostHog scripts have loaded successfully."},{"name":"mask_all_element_attributes","type":"boolean","description":"Prevent autocapture from capturing any attribute names on elements.\nfalse"},{"name":"mask_all_text","type":"boolean","description":"Prevent autocapture from capturing `textContent` on elements.\nfalse"},{"name":"mask_personal_data_properties","type":"boolean","description":"Mask personal data properties from the current URL. This will mask personal data properties such as advertising IDs (gclid, fbclid, etc.), and you can also add custom properties to mask with `custom_personal_data_properties`.   false"},{"name":"name","type":"string","description":"The name this instance will be identified by. You don't need to set this most of the time, but can be useful if you have several Posthog instances running at the same time.\n'posthog'"},{"name":"on_request_error","type":"(error: RequestResponse) => void","description":"A function that is called when a request to the PostHog API fails."},{"name":"on_xhr_error","type":"(failedRequest: XMLHttpRequest) => void","description":""},{"name":"opt_in_site_apps","type":"boolean","description":"Determines if users should be opted in to site apps.\nfalse"},{"name":"opt_out_capturing_by_default","type":"boolean","description":"Determines if users should be opted out of PostHog tracking by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_capturing_cookie_prefix","type":"string | null","description":""},{"name":"opt_out_capturing_persistence_type","type":"'localStorage' | 'cookie'","description":"Determines where we'll save the information about whether users are opted out of capturing.\n'localStorage'"},{"name":"opt_out_persistence_by_default","type":"boolean","description":"Determines if users should be opted out of browser data storage by this PostHog instance by default, requiring additional logic to opt them into capturing by calling `posthog.opt_in_capturing()`.\nfalse"},{"name":"opt_out_useragent_filter","type":"boolean","description":"Determines if users should be opted out of user agent filtering such as googlebot or other bots. If this is set to `true`, PostHog will set `$browser_type` to either `bot` or `browser` for all events, but will process all events as if they were from a browser.\nfalse"},{"name":"persistence_name","type":"string","description":"The name for the super properties persistent store\n''"},{"name":"persistence","type":"'localStorage' | 'cookie' | 'memory' | 'localStorage+cookie' | 'sessionStorage'","description":"Determines how PostHog stores information about the user. See [persistence](https://posthog.com/docs/libraries/js#persistence) for details.\n'localStorage+cookie'"},{"name":"person_profiles","type":"'always' | 'never' | 'identified_only'","description":"You can control whether events from PostHog-js have person processing enabled with the `person_profiles` config setting. There are three options: - `person_profiles: 'always'` - we will process persons data for all events - `person_profiles: 'never'` - we won't process persons for any event. This means that anonymous users will not be merged once they sign up or login, so you lose the ability to create funnels that track users from anonymous to identified. All events (including `$identify`) will be sent with `$process_person_profile: False`. - `person_profiles: 'identified_only'` _(default)_ - we will only process persons when you call `posthog.identify`, `posthog.alias`, `posthog.setPersonProperties`, `posthog.group`, `posthog.setPersonPropertiesForFlags` or `posthog.setGroupPropertiesForFlags` Anonymous users won't get person profiles.\n'identified_only'"},{"name":"prepare_external_dependency_script","type":"(script: HTMLScriptElement) => HTMLScriptElement | null","description":"A function to be called when a script is being loaded. This can be used to modify the script before it is loaded. This is useful for adding a nonce to the script, for example."},{"name":"prepare_external_dependency_stylesheet","type":"(stylesheet: HTMLStyleElement) => HTMLStyleElement | null","description":"A function to be called when a stylesheet is being loaded. This can be used to modify the stylesheet before it is loaded. This is useful for adding a nonce to the stylesheet, for example."},{"name":"process_person","type":"'always' | 'never' | 'identified_only'","description":""},{"name":"properties_string_max_length","type":"number","description":"Determines the maximum length of the properties string that can be sent with capture calls.\n65535"},{"name":"property_blacklist","type":"string[]","description":""},{"name":"property_denylist","type":"string[]","description":"A list of properties that should never be sent with capture calls.\n[]"},{"name":"rageclick","type":"boolean | RageclickConfig","description":"Determines whether PostHog should capture rage clicks.\nby default rageclicks are ignored on elements that match a `ph-no-capture` or `ph-no-rageclick` css class on the element or a parent   true"},{"name":"rate_limiting","type":"{\n        events_per_second?: number;\n        events_burst_limit?: number;\n    }","description":"Client side rate limiting"},{"name":"request_batching","type":"boolean","description":"Determines whether PostHog should batch requests to the PostHog API.\ntrue"},{"name":"request_headers","type":"{\n        [header_name: string]: string;\n    }","description":"A list of headers that should be sent with requests to the PostHog API."},{"name":"request_queue_config","type":"RequestQueueConfig","description":"Used to change the behavior of the request queue. This is an advanced feature and should be used with caution."},{"name":"respect_dnt","type":"boolean","description":"Determines whether PostHog should respect the Do Not Track header when computing consent in `ConsentManager`."},{"name":"sanitize_properties","type":"((properties: Properties, event_name: string) => Properties) | null","description":""},{"name":"save_campaign_params","type":"boolean","description":"Determines whether PostHog should save marketing parameters. These are `utm_*` paramaters and friends."},{"name":"save_referrer","type":"boolean","description":"Determines whether PostHog should save referrer information.\ntrue"},{"name":"scroll_root_selector","type":"string | string[]","description":"Let the pageview scroll stats use a custom css selector for the root element, e.g. `main` It will use `window.document.documentElement` if not specified."},{"name":"secure_cookie","type":"boolean","description":"Determines whether PostHog should use secure cookies. If this is `true`, PostHog cookies will be marked as secure, meaning they will only be transmitted over HTTPS.\nwindow.location.protocol === 'https:'"},{"name":"segment","type":"SegmentAnalytics","description":"The segment analytics object."},{"name":"session_idle_timeout_seconds","type":"number","description":"Determines the session idle timeout in seconds. Any new event that's happened after this timeout will create a new session.\n30 * 60 -- 30 minutes"},{"name":"session_recording","type":"SessionRecordingOptions","description":"Determines the session recording options."},{"name":"store_google","type":"boolean","description":""},{"name":"surveys_request_timeout_ms","type":"number","description":"Sets timeout for fetching surveys\n10000"},{"name":"token","type":"string","description":"The token for your PostHog project. It should NOT be provided manually in the config, but rather passed as the first parameter to `posthog.init()`."},{"name":"ui_host","type":"string | null","description":"If using a reverse proxy for `api_host` then this should be the actual PostHog app URL (e.g. https://us.posthog.com). This ensures that links to PostHog point to the correct host.\nnull"},{"name":"upgrade","type":"boolean","description":"Determines whether PostHog should upgrade old cookies. If set to `true`, the library will check for a cookie from our old js library and import super properties from it, then the old cookie is deleted. This option only works in the initialization, so make sure you set it when you create the library.\nfalse"},{"name":"verbose","type":"boolean","description":""},{"name":"xhr_headers","type":"{\n        [header_name: string]: string;\n    }","description":""}]},{"id":"Properties","name":"Properties","path":"lib/src/types.d.ts","example":"// Properties is a Record<string, Property> \n// Below are PostHog's default properties, you can add your own properties during capture\n{\n    $timestamp: '2024-05-29T17:32:07.202Z',\n    $os: 'Mac OS X',\n    $os_version: '10.15.7',\n    $browser: 'Chrome',\n    $browser_version: '125',\n    $device_type: 'Desktop',\n    $current_url: 'https://example.com/page',\n    $host: 'example.com',\n    $pathname: '/page',\n    $screen_height: 1080,\n    $screen_width: 1920,\n    $viewport_height: 950,\n    $viewport_width: 1903,\n    $lib: 'web',\n    $lib_version: '1.31.0',\n    $search_engine: 'google',\n    $referrer: 'https://google.com',\n    $referring_domain: 'www.google.com',\n    $active_feature_flags: ['beta_feature'],\n    $event_type: 'click',\n    $utm_source: 'newsletter',\n    $utm_medium: 'email',\n    $utm_campaign: 'product_launch',\n    $utm_term: 'new+product',\n    $utm_content: 'logolink',\n    $gclid: 'TeSter-123',\n    $gad_source: 'google_ads',\n    $gclsrc: 'dsa',\n    $dclid: 'testDclid123',\n    $wbraid: 'testWbraid123',\n    $gbraid: 'testGbraid123',\n    $fbclid: 'testFbclid123',\n    $msclkid: 'testMsclkid123',\n    $twclid: 'testTwclid123',\n    $li_fat_id: 'testLiFatId123',\n    $mc_cid: 'testMcCid123',\n    $igshid: 'testIgshid123',\n    $ttclid: 'testTtclid123',\n    $plugins_succeeded: ['GeoIP (56578)'],\n    $plugins_failed: ['plugin3'],\n    $plugins_deferred: ['plugin4'],\n    $ip: '192.168.1.1'\n}","properties":[]},{"id":"Property","name":"Property","path":"lib/src/types.d.ts","example":"// It can be a string\n\"max@example.com\"\n// It can be an object like field\n{\n    firstName: 'Max',\n    lastName: 'Hog',\n    isAdmin: true,\n}\n","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RageclickConfig","name":"RageclickConfig","path":"lib/src/types.d.ts","properties":[{"name":"css_selector_ignorelist","type":"string[]","description":"List of CSS selectors to ignore rageclicks on e.g. ['.my-calendar-button'] we consider the tree of elements from the root to the target element of the click event so for the tree div  div  button  svg and ignore list config `['[id]']` we will ignore the rageclick if the click-target or its parents has any id\nNothing is ignored when there's an empty ignorelist, e.g. [] If no ignorelist is set, we default to ignoring .ph-no-rageclick If an element has .ph-no-capture, it will always be ignored by rageclick and autocapture"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RemoteConfigFeatureFlagCallback","name":"RemoteConfigFeatureFlagCallback","path":"lib/src/types.d.ts","example":"(payload: JsonType) => void","properties":[]},{"id":"RequestCallback","name":"RequestCallback","path":"lib/src/types.d.ts","example":"(response: RequestResponse) => void","properties":[]},{"id":"RequestQueueConfig","name":"RequestQueueConfig","path":"lib/src/types.d.ts","properties":[{"name":"flush_interval_ms","type":"number","description":"ADVANCED - alters the frequency which PostHog sends events to the server. generally speaking this is only set when apps have automatic page refreshes, or very short visits. Defaults to 3 seconds when not set Allowed values between 250 and 5000"}]},{"id":"RequestResponse","name":"RequestResponse","path":"lib/src/types.d.ts","properties":[{"name":"json","type":"any"},{"name":"statusCode","type":"number"},{"name":"text","type":"string"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"RequestCallback"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SessionIdChangedCallback","name":"SessionIdChangedCallback","path":"lib/src/types.d.ts","example":"(sessionId: string, windowId: string | null | undefined, changeReason?: {\n    noSessionId: boolean;\n    activityTimeout: boolean;\n    sessionPastMaximumLength: boolean;\n}) => void","properties":[]},{"id":"SessionRecordingCanvasOptions","name":"SessionRecordingCanvasOptions","path":"lib/src/types.d.ts","example":"{\n    recordCanvas?: boolean | null;\n    canvasFps?: number | null;\n    canvasQuality?: string | null;\n}","properties":[]},{"id":"SessionRecordingOptions","name":"SessionRecordingOptions","path":"lib/src/types.d.ts","properties":[{"name":"__mutationThrottlerBucketSize","type":"number","description":"ADVANCED: alters the bucket size for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n100"},{"name":"__mutationThrottlerRefillRate","type":"number","description":"ADVANCED: alters the refill rate for the token bucket mutation throttling Normally only altered alongside posthog support guidance. Accepts values between 0 and 100\n10"},{"name":"blockClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"blockSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"captureCanvas","type":"SessionRecordingCanvasOptions","description":"Allows local config to override remote canvas recording settings from the flags response"},{"name":"collectFonts","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"compress_events","type":"boolean","description":"ADVANCED: whether to partially compress rrweb events before sending them to the server, defaults to true, can be set to false to disable partial compression NB requests are still compressed when sent to the server regardless of this setting\ntrue"},{"name":"full_snapshot_interval_millis","type":"number","description":"ADVANCED: while a user is active we take a full snapshot of the browser every interval. For very few sites playback performance might be better with different interval. Set to 0 to disable\n1000 * 60 * 5 (5 minutes)"},{"name":"ignoreClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"inlineStylesheet","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskAllInputs","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"maskCapturedNetworkRequestFn","type":"((data: CapturedNetworkRequest) => CapturedNetworkRequest | null | undefined) | null","description":"Modify the network request before it is captured. Returning null or undefined stops it being captured"},{"name":"maskInputFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskInputOptions","type":"recordOptions['maskInputOptions']","description":"Derived from `rrweb.record` options"},{"name":"maskNetworkRequestFn","type":"((data: NetworkRequest) => NetworkRequest | null | undefined) | null","description":""},{"name":"maskTextClass","type":"string | RegExp","description":"Derived from `rrweb.record` options"},{"name":"maskTextFn","type":"((text: string, element?: HTMLElement) => string) | null","description":"Derived from `rrweb.record` options"},{"name":"maskTextSelector","type":"string | null","description":"Derived from `rrweb.record` options"},{"name":"recordBody","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordCrossOriginIframes","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"recordHeaders","type":"boolean","description":"Derived from `rrweb.record` options"},{"name":"session_idle_threshold_ms","type":"number","description":"ADVANCED: alters the threshold before a recording considers a user has become idle. Normally only altered alongside changes to session_idle_timeout_ms.\n1000 * 60 * 5 (5 minutes)"},{"name":"slimDOMOptions","type":"recordOptions['slimDOMOptions']","description":"Derived from `rrweb.record` options"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"SeverityLevel","name":"SeverityLevel","path":"lib/src/types.d.ts","example":"(typeof severityLevels)[number]","properties":[]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"SupportedWebVitalsMetrics","name":"SupportedWebVitalsMetrics","path":"lib/src/types.d.ts","example":"\"LCP\" | \"CLS\" | \"FCP\" | \"INP\"","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","type":"{\n        url?: string;\n        selector?: string;\n        seenSurveyWaitPeriodInDays?: number;\n        urlMatchType?: PropertyMatchType;\n        events: {\n            repeatedActivation?: boolean;\n            values: {\n                name: string;\n                propertyFilters?: {\n                    [propertyName: string]: {\n                        values: string[];\n                        operator: PropertyMatchType;\n                    };\n                };\n            }[];\n        } | null;\n        actions: {\n            values: SurveyActionType[];\n        } | null;\n        deviceTypes?: string[];\n        deviceTypesMatchType?: PropertyMatchType;\n        linkedFlagVariant?: string;\n    } | null"},{"name":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoDisappear","type":"boolean"},{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string"},{"name":"disabledButtonOpacity","type":"string"},{"name":"displayThankYouMessage","type":"boolean"},{"name":"fontFamily","type":"string"},{"name":"maxWidth","type":"string"},{"name":"placeholder","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonActiveColor","type":"string"},{"name":"ratingButtonColor","type":"string"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"shuffleQuestions","type":"boolean"},{"name":"submitButtonColor","type":"string"},{"name":"submitButtonText","type":"string"},{"name":"submitButtonTextColor","type":"string"},{"name":"surveyPopupDelaySeconds","type":"number"},{"name":"textColor","type":"string"},{"name":"thankYouMessageCloseButtonText","type":"string"},{"name":"thankYouMessageDescription","type":"string"},{"name":"thankYouMessageDescriptionContentType","type":"SurveyQuestionDescriptionContentType"},{"name":"thankYouMessageHeader","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"widgetColor","type":"string"},{"name":"widgetLabel","type":"string"},{"name":"widgetSelector","type":"string"},{"name":"widgetType","type":"SurveyWidgetType"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRenderReason","name":"SurveyRenderReason","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"disabledReason","type":"string"},{"name":"visible","type":"boolean"}]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"ToolbarParams","name":"ToolbarParams","path":"lib/src/types.d.ts","properties":[{"name":"actionId","type":"number"},{"name":"dataAttributes","type":"string[]"},{"name":"distinctId","type":"string"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"instrument","type":"boolean"},{"name":"source","type":"ToolbarSource"},{"name":"temporaryToken","type":"string"},{"name":"token","type":"string"},{"name":"toolbarVersion","type":"ToolbarVersion"},{"name":"userEmail","type":"string"},{"name":"userIntent","type":"ToolbarUserIntent"}]},{"id":"ToolbarSource","name":"ToolbarSource","path":"lib/src/types.d.ts","example":"\"url\" | \"localstorage\"","properties":[]},{"id":"ToolbarUserIntent","name":"ToolbarUserIntent","path":"lib/src/types.d.ts","example":"\"add-action\" | \"edit-action\"","properties":[]},{"id":"ToolbarVersion","name":"ToolbarVersion","path":"lib/src/types.d.ts","example":"\"toolbar\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event?: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"{\n        send_event: boolean;\n    }","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.280.1","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2025-10-25T22:45:01.932Z","updatedAt":"2025-10-25T22:45:01.932Z","publishedAt":"2025-10-25T22:45:01.925Z"}},{"id":246,"attributes":{"referenceId":"posthog-js","version":"1.352.1","data":{"id":"posthog-js-1.352.1","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.352.1","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"properties","type":"{\n        key: string;\n        value?: string | number | boolean | (string | number | boolean)[] | null;\n        operator?: PropertyMatchType;\n        type?: string;\n    }[]","description":"Property filters for action step matching"},{"name":"selector_regex","type":"string | null","description":"pre-compiled regex pattern for matching selector against $elements_chain"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConversationsRemoteConfig","name":"ConversationsRemoteConfig","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"collectName","type":"boolean","description":"Whether to show the name field in the identification form   true (when requireEmail is true)"},{"name":"color","type":"string","description":"Primary color for the widget UI"},{"name":"domains","type":"string[]","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."},{"name":"enabled","type":"boolean","description":"Whether conversations are enabled for this team When true, the conversations API is available (posthog.conversations.*)"},{"name":"greetingText","type":"string","description":"Greeting text to show when widget is first opened"},{"name":"identificationFormDescription","type":"string","description":"Description for the identification form   \"Please provide your details so we can help you better.\""},{"name":"identificationFormTitle","type":"string","description":"Title for the identification form   \"Before we start...\""},{"name":"placeholderText","type":"string","description":"Placeholder text for the message input"},{"name":"requireEmail","type":"boolean","description":"Whether to require email before starting a conversation   false"},{"name":"token","type":"string","description":"Public token for authenticating conversations API requests This token is team-scoped and meant to be embedded in client code"},{"name":"widgetEnabled","type":"boolean","description":"Whether the widget UI (button + chat panel) should be shown Only takes effect when enabled is true   false"},{"name":"widgetPosition","type":"WidgetPosition","description":"Position of the widget on the screen   'bottom_right'"}]},{"id":"ConversationsTraits","name":"ConversationsTraits","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"email","type":"string | null"},{"name":"name","type":"string | null"}]},{"id":"ConversationsWidgetState","name":"ConversationsWidgetState","path":"lib/src/posthog-conversations-types.d.ts","example":"\"open\" | \"closed\"","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyPopoverOptions","name":"DisplaySurveyPopoverOptions","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"displayType","type":"DisplaySurveyType.Popover"},{"name":"position","type":"SurveyPosition","description":"Override the survey's configured position"},{"name":"selector","type":"string","description":"CSS selector for the element to position the survey next to (when position is NextToTrigger)"},{"name":"skipShownEvent","type":"boolean","description":"When true, `survey shown` events will not be emitted automatically"}]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"evaluatedAt","type":"number"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"GetMessagesResponse","name":"GetMessagesResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"has_more","type":"boolean","description":"Whether there are more messages to fetch"},{"name":"messages","type":"Message[]","description":"Array of messages"},{"name":"ticket_id","type":"string","description":"ID of the ticket"},{"name":"ticket_status","type":"TicketStatus","description":"Current status of the ticket"},{"name":"unread_count","type":"number","description":"Number of unread messages from the team"}]},{"id":"GetTicketsOptions","name":"GetTicketsOptions","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"limit","type":"number","description":"Number of tickets to return (default: 20)"},{"name":"offset","type":"number","description":"Pagination offset (default: 0)"},{"name":"status","type":"string","description":"Filter by ticket status (e.g., 'open', 'closed')"}]},{"id":"GetTicketsResponse","name":"GetTicketsResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"count","type":"number","description":"Total count of tickets"},{"name":"results","type":"Ticket[]","description":"Array of tickets"}]},{"id":"JSONContent","name":"JSONContent","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"attrs","type":"Record<string, any>"},{"name":"content","type":"JSONContent[]"},{"name":"marks","type":"{\n        type: string;\n        attrs?: Record<string, any>;\n    }[]"},{"name":"text","type":"string"},{"name":"type","type":"string"}]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MarkAsReadResponse","name":"MarkAsReadResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"success","type":"boolean","description":"Whether the operation was successful"},{"name":"unread_count","type":"number","description":"Number of unread messages (should be 0 after marking as read)"}]},{"id":"Message","name":"Message","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"author_name","type":"string","description":"Display name of the message author"},{"name":"author_type","type":"MessageAuthorType","description":"Type of the message author"},{"name":"content","type":"string","description":"The message content as plain text (fallback)"},{"name":"created_at","type":"string","description":"ISO timestamp when the message was created"},{"name":"id","type":"string","description":"Unique identifier for the message"},{"name":"is_private","type":"boolean","description":"Whether this is an internal note (not shown to customer)"},{"name":"rich_content","type":"TipTapDoc","description":"Rich content in TipTap JSON format (preferred for rendering) Falls back to `content` if missing or invalid"}]},{"id":"MessageAuthorType","name":"MessageAuthorType","path":"lib/src/posthog-conversations-types.d.ts","example":"\"customer\" | \"AI\" | \"human\"","properties":[]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"OverrideConfig","name":"OverrideConfig","path":"lib/src/types.d.ts","example":"{\n    sampling: boolean;\n    linked_flag: boolean;\n    url_trigger: boolean;\n    event_trigger: boolean;\n}","properties":[]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","example":"Omit<BasePostHogConfig, 'loaded'> & {\n    loaded: (posthog: PostHogInterface) => void;\n}","properties":[]},{"id":"PostHogInterface","name":"PostHogInterface","path":"lib/src/types.d.ts","example":"\"config\" | \"init\"","properties":[]},{"id":"ProductTour","name":"ProductTour","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"appearance","type":"ProductTourAppearance"},{"name":"auto_launch","type":"boolean"},{"name":"conditions","type":"ProductTourConditions"},{"name":"current_iteration","type":"number"},{"name":"description","type":"string"},{"name":"disable_image_preload","type":"boolean"},{"name":"display_frequency","type":"ProductTourDisplayFrequency"},{"name":"end_date","type":"string | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string"},{"name":"linked_flag_key","type":"string"},{"name":"name","type":"string"},{"name":"start_date","type":"string | null"},{"name":"steps","type":"ProductTourStep[]"},{"name":"type","type":"'product_tour'"}]},{"id":"ProductTourAppearance","name":"ProductTourAppearance","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"borderRadius","type":"number"},{"name":"boxShadow","type":"string"},{"name":"buttonBorderRadius","type":"number"},{"name":"buttonColor","type":"string"},{"name":"dismissOnClickOutside","type":"boolean","description":"defaults to true, auto-set to false for announcements/banners"},{"name":"fontFamily","type":"string"},{"name":"showOverlay","type":"boolean"},{"name":"textColor","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"zIndex","type":"number"}]},{"id":"ProductTourBannerConfig","name":"ProductTourBannerConfig","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"action","type":"{\n        type: 'none' | 'link' | 'trigger_tour';\n        link?: string;\n        tourId?: string;\n    }"},{"name":"animation","type":"{\n        duration?: number;\n    }"},{"name":"behavior","type":"'sticky' | 'static' | 'custom'"},{"name":"selector","type":"string"}]},{"id":"ProductTourButtonAction","name":"ProductTourButtonAction","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"dismiss\" | \"link\" | \"next_step\" | \"previous_step\" | \"trigger_tour\"","properties":[]},{"id":"ProductTourCallback","name":"ProductTourCallback","path":"lib/src/posthog-product-tours-types.d.ts","example":"(tours: ProductTour[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"ProductTourConditions","name":"ProductTourConditions","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"actions","type":"{\n        values: SurveyActionType[];\n    } | null"},{"name":"autoShowDelaySeconds","type":"number"},{"name":"cancelEvents","type":"{\n        values: SurveyEventWithFilters[];\n    } | null"},{"name":"events","type":"{\n        values: SurveyEventWithFilters[];\n    } | null"},{"name":"linkedFlagVariant","type":"string"},{"name":"selector","type":"string"},{"name":"url","type":"string"},{"name":"urlMatchType","type":"PropertyMatchType"}]},{"id":"ProductTourDismissReason","name":"ProductTourDismissReason","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"user_clicked_skip\" | \"user_clicked_outside\" | \"escape_key\" | \"element_unavailable\" | \"container_unavailable\"","properties":[]},{"id":"ProductTourDisplayFrequency","name":"ProductTourDisplayFrequency","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"show_once\" | \"until_interacted\" | \"always\"","properties":[]},{"id":"ProductTourEventName","name":"ProductTourEventName","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"BANNER_ACTION_CLICKED","type":"\"product tour banner action clicked\""},{"name":"BANNER_CONTAINER_SELECTOR_FAILED","type":"\"product tour banner container selector failed\""},{"name":"BUTTON_CLICKED","type":"\"product tour button clicked\""},{"name":"COMPLETED","type":"\"product tour completed\""},{"name":"DISMISSED","type":"\"product tour dismissed\""},{"name":"SHOWN","type":"\"product tour shown\""},{"name":"STEP_COMPLETED","type":"\"product tour step completed\""},{"name":"STEP_SELECTOR_FAILED","type":"\"product tour step selector failed\""},{"name":"STEP_SHOWN","type":"\"product tour step shown\""}]},{"id":"ProductTourEventProperties","name":"ProductTourEventProperties","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"INFERENCE_DATA_PRESENT","type":"\"$inference_data_present\""},{"name":"TOUR_BANNER_SELECTOR","type":"\"$product_tour_banner_selector\""},{"name":"TOUR_BUTTON_ACTION","type":"\"$product_tour_button_action\""},{"name":"TOUR_BUTTON_LINK","type":"\"$product_tour_button_link\""},{"name":"TOUR_BUTTON_TEXT","type":"\"$product_tour_button_text\""},{"name":"TOUR_BUTTON_TOUR_ID","type":"\"$product_tour_button_tour_id\""},{"name":"TOUR_DISMISS_REASON","type":"\"$product_tour_dismiss_reason\""},{"name":"TOUR_ERROR","type":"\"$product_tour_error\""},{"name":"TOUR_FAILURE_PHASE","type":"\"$product_tour_failure_phase\""},{"name":"TOUR_ID","type":"\"$product_tour_id\""},{"name":"TOUR_ITERATION","type":"\"$product_tour_iteration\""},{"name":"TOUR_LINKED_SURVEY_ID","type":"\"$product_tour_linked_survey_id\""},{"name":"TOUR_MATCHES_COUNT","type":"\"$product_tour_matches_count\""},{"name":"TOUR_NAME","type":"\"$product_tour_name\""},{"name":"TOUR_RENDER_REASON","type":"\"$product_tour_render_reason\""},{"name":"TOUR_STEP_ELEMENT_CLASSES","type":"\"$product_tour_step_element_classes\""},{"name":"TOUR_STEP_ELEMENT_ID","type":"\"$product_tour_step_element_id\""},{"name":"TOUR_STEP_ELEMENT_TAG","type":"\"$product_tour_step_element_tag\""},{"name":"TOUR_STEP_ELEMENT_TEXT","type":"\"$product_tour_step_element_text\""},{"name":"TOUR_STEP_ID","type":"\"$product_tour_step_id\""},{"name":"TOUR_STEP_ORDER","type":"\"$product_tour_step_order\""},{"name":"TOUR_STEP_SELECTOR","type":"\"$product_tour_step_selector\""},{"name":"TOUR_STEP_SELECTOR_FOUND","type":"\"$product_tour_step_selector_found\""},{"name":"TOUR_STEP_TYPE","type":"\"$product_tour_step_type\""},{"name":"TOUR_STEPS_COUNT","type":"\"$product_tour_steps_count\""},{"name":"TOUR_WAIT_DURATION_MS","type":"\"$product_tour_wait_duration_ms\""},{"name":"TOUR_WAITED_FOR_ELEMENT","type":"\"$product_tour_waited_for_element\""},{"name":"USE_MANUAL_SELECTOR","type":"\"$use_manual_selector\""}]},{"id":"ProductTourRenderReason","name":"ProductTourRenderReason","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"auto\" | \"api\" | \"trigger\" | \"event\"","properties":[]},{"id":"ProductTourSelectorError","name":"ProductTourSelectorError","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"not_found\" | \"multiple_matches\" | \"not_visible\"","properties":[]},{"id":"ProductTourStep","name":"ProductTourStep","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"bannerConfig","type":"ProductTourBannerConfig","description":"Banner configuration (only for banner steps)"},{"name":"buttons","type":"ProductTourStepButtons","description":"Button configuration for modal steps"},{"name":"content","type":"JSONContent | null"},{"name":"contentHtml","type":"string","description":"Pre-rendered HTML content from the editor. If present, SDK should use this instead of rendering from JSONContent."},{"name":"id","type":"string"},{"name":"inferenceData","type":"InferredSelector","description":"Enhanced element data for more reliable lookup at runtime"},{"name":"linkedSurveyId","type":"string","description":"ID of the auto-created survey for this step (set by backend)"},{"name":"linkedSurveyQuestionId","type":"string","description":"ID of the survey question (set by backend, used for event tracking)"},{"name":"maxWidth","type":"number","description":"Maximum tooltip width in pixels (defaults to 320px)"},{"name":"modalPosition","type":"SurveyPosition","description":"Position for modal/survey steps (defaults to middle_center)"},{"name":"progressionTrigger","type":"'button' | 'click'"},{"name":"selector","type":"string"},{"name":"survey","type":"ProductTourSurveyQuestion","description":"Inline survey question config - if present, this is a survey step"},{"name":"translations","type":"Record<string, ProductTourStepTranslation>","description":"translation data for this tour step"},{"name":"type","type":"ProductTourStepType"},{"name":"useManualSelector","type":"boolean","description":"Use CSS selector instead of inference. Defaults to false (use inference)."}]},{"id":"ProductTourStepButton","name":"ProductTourStepButton","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"action","type":"ProductTourButtonAction"},{"name":"link","type":"string","description":"URL to open when action is 'link'"},{"name":"text","type":"string"},{"name":"tourId","type":"string","description":"Tour ID to trigger when action is 'trigger_tour'"}]},{"id":"ProductTourStepButtons","name":"ProductTourStepButtons","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"primary","type":"ProductTourStepButton"},{"name":"secondary","type":"ProductTourStepButton"}]},{"id":"ProductTourStepTranslation","name":"ProductTourStepTranslation","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"buttons","type":"{\n        primary?: Pick<ProductTourStepButton, 'text'>;\n        secondary?: Pick<ProductTourStepButton, 'text'>;\n    }"},{"name":"content","type":"ProductTourStep['content']"},{"name":"contentHtml","type":"ProductTourStep['contentHtml']"},{"name":"survey","type":"Pick<ProductTourSurveyQuestion, 'questionText' | 'lowerBoundLabel' | 'upperBoundLabel' | 'submitButtonText' | 'backButtonText'>"}]},{"id":"ProductTourStepType","name":"ProductTourStepType","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"element\" | \"modal\" | \"survey\" | \"banner\"","properties":[]},{"id":"ProductTourSurveyQuestion","name":"ProductTourSurveyQuestion","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"backButtonText","type":"string"},{"name":"display","type":"'emoji' | 'number'","description":"Rating display type - emoji or number"},{"name":"lowerBoundLabel","type":"string","description":"Label for low end of rating scale (e.g., \"Not likely\")"},{"name":"questionText","type":"string"},{"name":"scale","type":"3 | 5 | 10","description":"Rating scale - 3 or 5 for emoji, 5 or 10 for number"},{"name":"submitButtonText","type":"string"},{"name":"type","type":"ProductTourSurveyQuestionType"},{"name":"upperBoundLabel","type":"string","description":"Label for high end of rating scale (e.g., \"Very likely\")"}]},{"id":"ProductTourSurveyQuestionType","name":"ProductTourSurveyQuestionType","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"open\" | \"rating\"","properties":[]},{"id":"PropertyFilters","name":"PropertyFilters","path":"lib/src/posthog-surveys-types.d.ts","example":"{\n    [propertyName: string]: {\n        values: string[];\n        operator: PropertyOperator;\n    };\n}","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"PropertyOperator","name":"PropertyOperator","path":"lib/src/posthog-surveys-types.d.ts","example":"\"gt\" | \"lt\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"2 | 3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"conversations","type":"boolean | ConversationsRemoteConfig","description":"Conversations widget configuration"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"logs","type":"{\n        captureConsoleLogs?: boolean;\n    }","description":"Whether capturing logs to the logs product is enabled"},{"name":"productTours","type":"boolean","description":"Whether product tours are enabled"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RequestRestoreLinkPayload","name":"RequestRestoreLinkPayload","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"email","type":"string"},{"name":"request_url","type":"string"}]},{"id":"RequestRestoreLinkResponse","name":"RequestRestoreLinkResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"ok","type":"true"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"(response: RequestResponse) => void"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RestoreFromTokenPayload","name":"RestoreFromTokenPayload","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"current_url","type":"string","description":"Optional current URL for backend observability"},{"name":"distinct_id","type":"string","description":"Optional distinct ID for debugging/observability"},{"name":"restore_token","type":"string","description":"Opaque one-time restore token from email link"},{"name":"widget_session_id","type":"string","description":"Current browser widget session ID requesting restore"}]},{"id":"RestoreFromTokenResponse","name":"RestoreFromTokenResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"code","type":"string","description":"Optional machine-readable backend code"},{"name":"migrated_ticket_ids","type":"string[]","description":"Migrated ticket IDs, if any"},{"name":"status","type":"RestoreFromTokenStatus","description":"Restore result"},{"name":"widget_session_id","type":"string","description":"Canonical widget session ID to use after restore"}]},{"id":"RestoreFromTokenStatus","name":"RestoreFromTokenStatus","path":"lib/src/posthog-conversations-types.d.ts","example":"\"success\" | \"expired\" | \"invalid\" | \"used\"","properties":[]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SendMessagePayload","name":"SendMessagePayload","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"distinct_id","type":"string","description":"Distinct ID for linking to PostHog Person"},{"name":"message","type":"string","description":"The message content to send"},{"name":"session_context","type":"SessionContext","description":"Session context captured when creating a new ticket Stored in a JSONField for flexibility"},{"name":"session_id","type":"string","description":"Session ID captured when creating a new ticket Stored as a separate queryable DB field"},{"name":"ticket_id","type":"string | null","description":"Ticket ID to send the message to (null to create a new ticket)"},{"name":"traits","type":"{\n        name: string | null;\n        email: string | null;\n    }","description":"User identification traits"},{"name":"widget_session_id","type":"string","description":"Widget session ID for access control"}]},{"id":"SendMessageResponse","name":"SendMessageResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"created_at","type":"string","description":"ISO timestamp when the message was created"},{"name":"message_id","type":"string","description":"ID of the newly created message"},{"name":"ticket_id","type":"string","description":"ID of the ticket this message belongs to"},{"name":"ticket_status","type":"TicketStatus","description":"Current status of the ticket"},{"name":"unread_count","type":"number","description":"Number of unread messages from the team After customer sends a message, this is always 0"}]},{"id":"SessionContext","name":"SessionContext","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"current_url","type":"string","description":"Page URL where the ticket was created"},{"name":"session_replay_url","type":"string","description":"URL to the session replay at the time the ticket was created Includes timestamp to jump to the exact moment"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","path":"lib/src/types.d.ts","example":"Omit<SessionRecordingRemoteConfig, 'recordCanvas' | 'canvasFps' | 'canvasQuality' | 'networkPayloadCapture' | 'sampleRate' | 'minimumDurationMilliseconds'> & {\n    cache_timestamp?: number;\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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"ShowTourOptions","name":"ShowTourOptions","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"enableStrictValidation","type":"boolean"},{"name":"reason","type":"ProductTourRenderReason"}]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","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":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string","description":""},{"name":"disabledButtonOpacity","type":"string"},{"name":"fontFamily","type":"string"},{"name":"hideCancelButton","type":"boolean"},{"name":"inputBackgroundColor","type":"string","description":""},{"name":"maxWidth","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"tabPosition","type":"SurveyTabPosition"},{"name":"whiteLabel","type":"boolean"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyConfig","name":"SurveyConfig","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoSubmitDelay","type":"number","description":""},{"name":"autoSubmitIfComplete","type":"boolean","description":""},{"name":"prefillFromUrl","type":"boolean"}]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"ABANDONED","type":"\"survey abandoned\""},{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"PRODUCT_TOUR_ID","type":"\"$product_tour_id\""},{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_LAST_SEEN_DATE","type":"\"$survey_last_seen_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyEventType","name":"SurveyEventType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Activation","type":"\"events\""},{"name":"Cancellation","type":"\"cancelEvents\""}]},{"id":"SurveyEventWithFilters","name":"SurveyEventWithFilters","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"name","type":"string"},{"name":"propertyFilters","type":"PropertyFilters"}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyResponseValue","name":"SurveyResponseValue","path":"lib/src/posthog-surveys-types.d.ts","example":"string | number | string[] | null","properties":[]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyTabPosition","name":"SurveyTabPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Bottom","type":"\"bottom\""},{"name":"Left","type":"\"left\""},{"name":"Right","type":"\"right\""},{"name":"Top","type":"\"top\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"Ticket","name":"Ticket","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"created_at","type":"string","description":"ISO timestamp when the ticket was created"},{"name":"id","type":"string","description":"Unique identifier for the ticket"},{"name":"last_message_at","type":"string","description":"ISO timestamp of the last message"},{"name":"last_message","type":"string","description":"Preview of the last message"},{"name":"message_count","type":"number","description":"Total number of messages in this ticket"},{"name":"messages","type":"Message[]","description":"Array of messages (only present in detailed ticket view)"},{"name":"status","type":"TicketStatus","description":"Current status of the ticket"},{"name":"unread_count","type":"number","description":"Number of unread messages from the team"}]},{"id":"TicketStatus","name":"TicketStatus","path":"lib/src/posthog-conversations-types.d.ts","example":"\"new\" | \"open\" | \"pending\" | \"on_hold\" | \"resolved\"","properties":[]},{"id":"TipTapDoc","name":"TipTapDoc","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"content","type":"TipTapNode[]"},{"name":"type","type":"'doc'"}]},{"id":"TipTapMark","name":"TipTapMark","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"attrs","type":"{\n        href?: string;\n        target?: string;\n        [key: string]: unknown;\n    }"},{"name":"type","type":"'bold' | 'italic' | 'underline' | 'strike' | 'code' | 'link'"}]},{"id":"TipTapNode","name":"TipTapNode","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"attrs","type":"Record<string, unknown>"},{"name":"content","type":"TipTapNode[]"},{"name":"marks","type":"TipTapMark[]"},{"name":"text","type":"string"},{"name":"type","type":"string"}]},{"id":"UserProvidedTraits","name":"UserProvidedTraits","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"email","type":"string"},{"name":"name","type":"string"}]},{"id":"WidgetPosition","name":"WidgetPosition","path":"lib/src/posthog-conversations-types.d.ts","example":"\"bottom_left\" | \"bottom_right\" | \"top_left\" | \"top_right\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"cancelPendingSurvey","path":"lib/src/posthog-core.d.ts","title":"cancelPendingSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":""}],"details":null,"category":"Surveys","examples":[{"id":"cancelpendingsurvey","code":"// Generated example for cancelPendingSurvey\nposthog.cancelPendingSurvey();","name":"Generated example for cancelPendingSurvey"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Cancels a pending survey that is waiting to be displayed (e.g., due to a popup delay)."},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"FeatureFlagOptions","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog. If fresh: true, we won't return cached values from localStorage - only values loaded from the server."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getFeatureFlagResult","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagResult","params":[{"name":"key","type":"string","isOptional":false,"description":"Key of the feature flag."},{"name":"options","type":"FeatureFlagOptions","isOptional":true,"description":"Options for the feature flag lookup."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst result = posthog.getFeatureFlagResult('my-flag')\nif (result?.enabled) {\n    console.log('Flag is enabled with payload:', result.payload)\n}\n\n\n","name":""},{"id":"multivariate_flag","code":"\n\n// multivariate flag\nconst result = posthog.getFeatureFlagResult('button-color')\nif (result?.variant === 'red') {\n    showRedButton(result.payload)\n}\n\n\n\n","name":"multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"FeatureFlagResult | undefined","name":"FeatureFlagResult | undefined"},"description":"Get a feature flag evaluation result including both the flag value and payload.\nBy default, this method emits the `$feature_flag_called` event."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"FeatureFlagOptions","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog. If fresh: true, we won't return cached values from localStorage - only values loaded from the server."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured' | 'featureFlagsReloading'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n","name":""},{"id":"track_when_feature_flags_are_reloading_to_show_a_loading_state","code":"\n\n// Track when feature flags are reloading to show a loading state\nposthog.on('featureFlagsReloading', () => {\n  console.log('Feature flags are being reloaded...')\n})\n\n\n\n","name":"Track when feature flags are reloading to show a loading state"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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\nAvailable events: - `eventCaptured`: Emitted immediately before trying to send an event - `featureFlagsReloading`: Emitted when feature flags are being reloaded (e.g. after `identify()`, `group()`, or `reloadFeatureFlags()`)"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setInternalOrTestUser","path":"lib/src/posthog-core.d.ts","title":"setInternalOrTestUser","params":[],"details":null,"category":"Identification","examples":[{"id":"manually_mark_as_test_user","code":"\n\n// Manually mark as test user\nposthog.setInternalOrTestUser()\n\n// Or use internal_or_test_user_hostname config for automatic detection\nposthog.init('token', { internal_or_test_user_hostname: 'localhost' })\n\n\n","name":"Manually mark as test user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Marks the current user as a test user by setting the `$internal_or_test_user` person property to `true`. This also enables person processing for the current user.\nThis is useful for using in a cohort your internal/test filters for your posthog org."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startExceptionAutocapture","path":"lib/src/posthog-core.d.ts","title":"startExceptionAutocapture","params":[{"name":"config","type":"ExceptionAutoCaptureConfig","isOptional":true,"description":"optional configuration option to control the exception autocapture behavior"}],"details":null,"category":"Error tracking","examples":[{"id":"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\nposthog.startExceptionAutocapture()\n\n\n","name":"Start with default exception autocapture rules. No-op if already enabled"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns exception autocapture on, and updates the config option `capture_exceptions` to the provided config (or `true`)"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopExceptionAutocapture","path":"lib/src/posthog-core.d.ts","title":"stopExceptionAutocapture","params":[],"details":null,"category":"Error tracking","examples":[{"id":"stop_capturing_exceptions_automatically","code":"\n\n// Stop capturing exceptions automatically\nposthog.stopExceptionAutocapture()\n\n\n\n","name":"Stop capturing exceptions automatically"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns exception autocapture off by updating the config option `capture_exceptions` to `false`"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"updateFlags","path":"lib/src/posthog-core.d.ts","title":"updateFlags","params":[{"name":"flags","type":"Record<string, boolean | string>","isOptional":false,"description":"An object mapping flag keys to their values (boolean or string variant)"},{"name":"payloads","type":"Record<string, JsonType>","isOptional":true,"description":"Optional object mapping flag keys to their JSON payloads"},{"name":"options","type":"{\n        merge?: boolean;\n    }","isOptional":true,"description":"Optional settings. Use `{ merge: true }` to merge with existing flags instead of replacing."}],"details":null,"category":"Feature flags","examples":[{"id":"replace_all_flags_with_server-evaluated_values","code":"\n\n// Replace all flags with server-evaluated values\nposthog.updateFlags({\n  'my-flag': true,\n  'my-experiment': 'variant-a'\n})\n\n// Merge with existing flags (update only specified flags)\nposthog.updateFlags(\n  { 'my-flag': true },\n  undefined,\n  { merge: true }\n)\n\n// With payloads\nposthog.updateFlags(\n  { 'my-flag': true },\n  { 'my-flag': { some: 'data' } }\n)\n\n\n\n","name":"Replace all flags with server-evaluated values"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.352.1","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2026-02-23T10:30:12.055Z","updatedAt":"2026-02-23T10:30:12.055Z","publishedAt":"2026-02-23T10:30:12.043Z"}},{"id":15,"attributes":{"referenceId":"posthog-node","version":"5.10.0","data":{"id":"posthog-node-5.10.0","info":{"id":"posthog-node","title":"PostHog Node.js SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"5.10.0","slugPrefix":"posthog-node","description":"PostHog Node.js SDK allows you to capture events and send them to PostHog from your Node.js applications."},"types":[{"id":"_SentryEvent","name":"_SentryEvent","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryEventProcessor","name":"_SentryEventProcessor","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryHub","name":"_SentryHub","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryIntegration","name":"_SentryIntegration","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"_SentryIntegrationClass","name":"_SentryIntegrationClass","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"src/types.ts","example":"(event: EventMessage | null) => EventMessage | null","properties":[]},{"id":"EventMessage","name":"EventMessage","path":"src/types.ts","properties":[{"name":"event","type":"string"},{"name":"groups","type":"Record<string, string | number>"},{"name":"sendFeatureFlags","type":"boolean | SendFeatureFlagsOptions"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"ExpressErrorMiddleware","name":"ExpressErrorMiddleware","path":"src/extensions/express.ts","example":"(error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void","properties":[]},{"id":"ExpressMiddleware","name":"ExpressMiddleware","path":"src/extensions/express.ts","example":"(req: http.IncomingMessage, res: http.ServerResponse, next: () => void) => void","properties":[]},{"id":"FeatureFlagCondition","name":"FeatureFlagCondition","path":"src/types.ts","example":"{\n    properties: FlagProperty[];\n    rollout_percentage?: number;\n    variant?: string;\n}","properties":[]},{"id":"FlagProperty","name":"FlagProperty","path":"src/types.ts","example":"{\n    key: string;\n    type?: string;\n    value: FlagPropertyValue;\n    operator?: string;\n    negation?: boolean;\n    dependency_chain?: string[];\n}","properties":[]},{"id":"FlagPropertyValue","name":"FlagPropertyValue","path":"src/types.ts","example":"string | number | (string | number)[] | boolean","properties":[]},{"id":"GroupIdentifyMessage","name":"GroupIdentifyMessage","path":"src/types.ts","properties":[{"name":"disableGeoip","type":"boolean"},{"name":"distinctId","type":"string"},{"name":"groupKey","type":"string"},{"name":"groupType","type":"string"},{"name":"properties","type":"Record<string | number, any>"}]},{"id":"IdentifyMessage","name":"IdentifyMessage","path":"src/types.ts","properties":[{"name":"disableGeoip","type":"boolean"},{"name":"distinctId","type":"string"},{"name":"properties","type":"Record<string | number, any>"}]},{"id":"IPostHog","name":"IPostHog","path":"src/types.ts","properties":[]},{"id":"MiddlewareError","name":"MiddlewareError","path":"src/extensions/express.ts","properties":[{"name":"output","type":"{\n        statusCode?: number | string;\n    }"},{"name":"status_code","type":"number | string"},{"name":"status","type":"number | string"},{"name":"statusCode","type":"number | string"}]},{"id":"PostHogFeatureFlag","name":"PostHogFeatureFlag","path":"src/types.ts","example":"{\n    id: number;\n    name: string;\n    key: string;\n    filters?: {\n        aggregation_group_type_index?: number;\n        groups?: FeatureFlagCondition[];\n        multivariate?: {\n            variants: {\n                key: string;\n                rollout_percentage: number;\n            }[];\n        };\n        payloads?: Record<string, string>;\n    };\n    deleted: boolean;\n    active: boolean;\n    rollout_percentage: null | number;\n    ensure_experience_continuity: boolean;\n    experiment_set: number[];\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"src/types.ts","example":"PostHogCoreOptions & {\n    persistence?: 'memory';\n    personalApiKey?: string;\n    privacyMode?: boolean;\n    enableExceptionAutocapture?: boolean;\n    featureFlagsPollingInterval?: number;\n    maxCacheSize?: number;\n    fetch?: (url: string, options: PostHogFetchOptions) => Promise<PostHogFetchResponse>;\n    enableLocalEvaluation?: boolean;\n    before_send?: BeforeSendFn | BeforeSendFn[];\n    evaluationEnvironments?: readonly string[];\n}","properties":[]},{"id":"PropertyGroup","name":"PropertyGroup","path":"src/types.ts","example":"{\n    type: 'AND' | 'OR';\n    values: PropertyGroup[] | FlagProperty[];\n}","properties":[]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"src/types.ts","properties":[{"name":"flagKeys","type":"string[]"},{"name":"groupProperties","type":"Record<string, Record<string, any>>"},{"name":"onlyEvaluateLocally","type":"boolean"},{"name":"personProperties","type":"Record<string, any>"}]},{"id":"SentryIntegrationOptions","name":"SentryIntegrationOptions","path":"src/extensions/sentry-integration.ts","example":"{\n    organization?: string;\n    projectId?: number;\n    prefix?: string;\n    severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n    sendExceptionsToPostHog?: boolean;\n}","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"getLibraryId","path":"src/entrypoints/index.node.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"PostHog","path":"src/entrypoints/index.node.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog project API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"Configuration options for the client"}],"details":null,"category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// Basic initialization\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  { host: 'https://app.posthog.com' }\n)\n\n\n","name":"Basic initialization"},{"id":"with_personal_api_key","code":"\n\n// With personal API key\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  {\n    host: 'https://app.posthog.com',\n    personalApiKey: 'your-personal-api-key'\n  }\n)\n\n\n\n","name":"With personal API key"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Initialize a new PostHog client instance."},{"id":"alias","path":"src/entrypoints/index.node.ts","title":"alias","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user","code":"\n\n// Link an anonymous user to an identified user\nclient.alias({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create an alias to link two distinct IDs together."},{"id":"aliasImmediate","path":"src/entrypoints/index.node.ts","title":"aliasImmediate","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user_immediately","code":"\n\n// Link an anonymous user to an identified user immediately\nawait client.aliasImmediate({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user immediately"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Create an alias to link two distinct IDs together immediately (synchronously)."},{"id":"capture","path":"src/entrypoints/index.node.ts","title":"capture","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_capture","code":"\n\n// Basic capture\nclient.capture({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n\n","name":"Basic capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an event manually."},{"id":"captureException","path":"src/entrypoints/index.node.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_with_user_id","code":"\n\n// Capture an error with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  client.captureException(error, 'user_123')\n}\n\n\n","name":"Capture an error with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  client.captureException(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an error exception as an event."},{"id":"captureExceptionImmediate","path":"src/entrypoints/index.node.ts","title":"captureExceptionImmediate","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_immediately_with_user_id","code":"\n\n// Capture an error immediately with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123')\n}\n\n\n","name":"Capture an error immediately with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an error exception as an event immediately (synchronously)."},{"id":"captureImmediate","path":"src/entrypoints/index.node.ts","title":"captureImmediate","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_immediate_capture","code":"\n\n// Basic immediate capture\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n","name":"Basic immediate capture"},{"id":"with_feature_flags","code":"\n\n// With feature flags\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: true\n})\n\n\n","name":"With feature flags"},{"id":"with_custom_feature_flags_options","code":"\n\n// With custom feature flags options\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: {\n    onlyEvaluateLocally: true,\n    personProperties: { plan: 'premium' },\n    groupProperties: { org: { tier: 'enterprise' } }\n    flagKeys: ['flag1', 'flag2']\n  }\n})\n\n\n\n","name":"With custom feature flags options"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an event immediately (synchronously)."},{"id":"debug","path":"src/entrypoints/index.node.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":"Whether to enable debug logging"}],"details":null,"category":"Initialization","examples":[{"id":"enable_debug_logging","code":"\n\n// Enable debug logging\nclient.debug(true)\n\n\n","name":"Enable debug logging"},{"id":"disable_debug_logging","code":"\n\n// Disable debug logging\nclient.debug(false)\n\n\n\n","name":"Disable debug logging"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enable or disable debug logging."},{"id":"disable","path":"src/entrypoints/index.node.ts","title":"disable","params":[],"details":null,"category":"Privacy","examples":[{"id":"disable_client","code":"\n\n// Disable client\nawait client.disable()\n// Client is now disabled and will not capture events\n\n\n\n","name":"Disable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Disable the PostHog client (opt-out)."},{"id":"enable","path":"src/entrypoints/index.node.ts","title":"enable","params":[],"details":null,"category":"Privacy","examples":[{"id":"enable_client","code":"\n\n// Enable client\nawait client.enable()\n// Client is now enabled and will capture events\n\n\n\n","name":"Enable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Enable the PostHog client (opt-in)."},{"id":"getAllFlags","path":"src/entrypoints/index.node.ts","title":"getAllFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_for_a_user","code":"\n\n// Get all flags for a user\nconst allFlags = await client.getAllFlags('user_123')\nconsole.log('User flags:', allFlags)\n// Output: { 'flag-1': 'variant-a', 'flag-2': false, 'flag-3': 'variant-b' }\n\n\n","name":"Get all flags for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst specificFlags = await client.getAllFlags('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst orgFlags = await client.getAllFlags('user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, FeatureFlagValue>>","name":"Promise<Record<string, FeatureFlagValue>>"},"description":"Get all feature flag values for a specific user."},{"id":"getAllFlagsAndPayloads","path":"src/entrypoints/index.node.ts","title":"getAllFlagsAndPayloads","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_and_payloads_for_a_user","code":"\n\n// Get all flags and payloads for a user\nconst result = await client.getAllFlagsAndPayloads('user_123')\nconsole.log('Flags:', result.featureFlags)\nconsole.log('Payloads:', result.featureFlagPayloads)\n\n\n","name":"Get all flags and payloads for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsAndPayloadsResponse>","name":"Promise<PostHogFlagsAndPayloadsResponse>"},"description":"Get all feature flag values and payloads for a specific user."},{"id":"getCustomUserAgent","path":"src/entrypoints/index.node.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"Identification","examples":[{"id":"get_user_agent","code":"\n\n// Get user agent\nconst userAgent = client.getCustomUserAgent()\n// Returns: \"posthog-node/5.7.0\"\n\n\n\n","name":"Get user agent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the custom user agent string for this client."},{"id":"getFeatureFlag","path":"src/entrypoints/index.node.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst flagValue = await client.getFeatureFlag('new-feature', 'user_123')\nif (flagValue === 'variant-a') {\n  // Show variant A\n} else if (flagValue === 'variant-b') {\n  // Show variant B\n} else {\n  // Flag is disabled or not found\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst flagValue = await client.getFeatureFlag('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' },\n  groupProperties: { organization: { tier: 'premium' } }\n})\n\n\n","name":"With groups and properties"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst flagValue = await client.getFeatureFlag('local-flag', 'user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<FeatureFlagValue | undefined>","name":"Promise<FeatureFlagValue | undefined>"},"description":"Get the value of a feature flag for a specific user."},{"id":"getFeatureFlagPayload","path":"src/entrypoints/index.node.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"matchValue","type":"FeatureFlagValue","isOptional":true,"description":"Optional match value to get payload for"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_payload_for_a_feature_flag","code":"\n\n// Get payload for a feature flag\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123')\nif (payload) {\n  console.log('Flag payload:', payload)\n}\n\n\n","name":"Get payload for a feature flag"},{"id":"get_payload_with_specific_match_value","code":"\n\n// Get payload with specific match value\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123', 'variant-a')\n\n\n","name":"Get payload with specific match value"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst payload = await client.getFeatureFlagPayload('org-flag', 'user_123', undefined, {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the payload for a feature flag."},{"id":"getLibraryVersion","path":"src/entrypoints/index.node.ts","title":"getLibraryVersion","params":[],"details":null,"category":"Initialization","examples":[{"id":"get_version","code":"\n\n// Get version\nconst version = client.getLibraryVersion()\nconsole.log(`Using PostHog SDK version: ${version}`)\n\n\n\n","name":"Get version"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the library version from package.json."},{"id":"getPersistedProperty","path":"src/entrypoints/index.node.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to retrieve"}],"details":null,"category":"Initialization","examples":[{"id":"get_user_id","code":"\n\n// Get user ID\nconst userId = client.getPersistedProperty('userId')\n\n\n","name":"Get user ID"},{"id":"get_session_id","code":"\n\n// Get session ID\nconst sessionId = client.getPersistedProperty('sessionId')\n\n\n\n","name":"Get session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any | undefined","name":"any | undefined"},"description":"Get a persisted property value from memory storage."},{"id":"getRemoteConfigPayload","path":"src/entrypoints/index.node.ts","title":"getRemoteConfigPayload","params":[{"name":"flagKey","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_remote_config_payload","code":"\n\n// Get remote config payload\nconst payload = await client.getRemoteConfigPayload('flag-key')\nif (payload) {\n  console.log('Remote config payload:', payload)\n}\n\n\n\n\n","name":"Get remote config payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the remote config payload for a feature flag."},{"id":"groupIdentify","path":"src/entrypoints/index.node.ts","title":"groupIdentify","params":[{"name":"{ groupType, groupKey, properties, distinctId, disableGeoip }","type":"GroupIdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"create_a_company_group","code":"\n\n// Create a company group\nclient.groupIdentify({\n  groupType: 'company',\n  groupKey: 'acme-corp',\n  properties: {\n    name: 'Acme Corporation',\n    industry: 'Technology',\n    employee_count: 500\n  },\n  distinctId: 'user_123'\n})\n\n\n","name":"Create a company group"},{"id":"update_organization_properties","code":"\n\n// Update organization properties\nclient.groupIdentify({\n  groupType: 'organization',\n  groupKey: 'org-456',\n  properties: {\n    plan: 'enterprise',\n    region: 'US-West'\n  }\n})\n\n\n\n","name":"Update organization properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create or update a group and its properties."},{"id":"identify","path":"src/entrypoints/index.node.ts","title":"identify","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_identify_with_properties","code":"\n\n// Basic identify with properties\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com',\n    plan: 'premium'\n  }\n})\n\n\n","name":"Basic identify with properties"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    $set: { name: 'John Doe', email: 'john@example.com' },\n    $set_once: { first_login: new Date().toISOString() }\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Identify a user and set their properties."},{"id":"identifyImmediate","path":"src/entrypoints/index.node.ts","title":"identifyImmediate","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_immediate_identify","code":"\n\n// Basic immediate identify\nawait client.identifyImmediate({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com'\n  }\n})\n\n\n\n","name":"Basic immediate identify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Identify a user and set their properties immediately (synchronously)."},{"id":"isFeatureEnabled","path":"src/entrypoints/index.node.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst isEnabled = await client.isFeatureEnabled('new-feature', 'user_123')\nif (isEnabled) {\n  // Feature is enabled\n  console.log('New feature is active')\n} else {\n  // Feature is disabled\n  console.log('New feature is not active')\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst isEnabled = await client.isFeatureEnabled('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean | undefined>","name":"Promise<boolean | undefined>"},"description":"Check if a feature flag is enabled for a specific user."},{"id":"isLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"isLocalEvaluationReady","params":[],"details":null,"category":"Feature flags","examples":[{"id":"check_if_ready","code":"\n\n// Check if ready\nif (client.isLocalEvaluationReady()) {\n  // Local evaluation is ready, can evaluate flags locally\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n} else {\n  // Local evaluation not ready, will use remote evaluation\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n}\n\n\n\n","name":"Check if ready"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Check if local evaluation of feature flags is ready."},{"id":"prepareEventMessage","path":"src/entrypoints/index.node.ts","title":"prepareEventMessage","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"prepareeventmessage","code":"// Generated example for prepareEventMessage\nposthog.prepareEventMessage();","name":"Generated example for prepareEventMessage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>","name":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>"}},{"id":"reloadFeatureFlags","path":"src/entrypoints/index.node.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"force_reload_of_feature_flags","code":"\n\n// Force reload of feature flags\nawait client.reloadFeatureFlags()\nconsole.log('Feature flags reloaded')\n\n\n","name":"Force reload of feature flags"},{"id":"reload_before_checking_a_specific_flag","code":"\n\n// Reload before checking a specific flag\nawait client.reloadFeatureFlags()\nconst flag = await client.getFeatureFlag('flag-key', 'user_123')\n\n\n\n","name":"Reload before checking a specific flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Reload feature flag definitions from the server for local evaluation."},{"id":"setPersistedProperty","path":"src/entrypoints/index.node.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to set"},{"name":"value","type":"any | null","isOptional":false,"description":"The value to store (null to remove)"}],"details":null,"category":"Initialization","examples":[{"id":"set_user_id","code":"\n\n// Set user ID\nclient.setPersistedProperty('userId', 'user_123')\n\n\n","name":"Set user ID"},{"id":"set_session_id","code":"\n\n// Set session ID\nclient.setPersistedProperty('sessionId', 'session_456')\n\n\n\n","name":"Set session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Set a persisted property value in memory storage."},{"id":"waitForLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"waitForLocalEvaluationReady","params":[{"name":"timeoutMs","type":"number","isOptional":true,"description":"Timeout in milliseconds (default: 30000)"}],"details":null,"category":"Feature flags","examples":[{"id":"wait_for_local_evaluation","code":"\n\n// Wait for local evaluation\nconst isReady = await client.waitForLocalEvaluationReady()\nif (isReady) {\n  console.log('Local evaluation is ready')\n} else {\n  console.log('Local evaluation timed out')\n}\n\n\n","name":"Wait for local evaluation"},{"id":"wait_with_custom_timeout","code":"\n\n// Wait with custom timeout\nconst isReady = await client.waitForLocalEvaluationReady(10000) // 10 seconds\n\n\n\n","name":"Wait with custom timeout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean>","name":"Promise<boolean>"},"description":"Wait for local evaluation of feature flags to be ready."}]}],"version":"5.10.0","categories":["Initialization","Identification","Capture","Error tracking","Privacy","Feature flags"],"referenceId":"posthog-node"},"createdAt":"2025-10-25T22:45:02.036Z","updatedAt":"2025-10-25T22:45:02.036Z","publishedAt":"2025-10-25T22:45:02.031Z"}},{"id":16,"attributes":{"referenceId":"posthog-node","version":"5.10.1","data":{"id":"posthog-node-5.10.1","info":{"id":"posthog-node","title":"PostHog Node.js SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"5.10.1","slugPrefix":"posthog-node","description":"PostHog Node.js SDK allows you to capture events and send them to PostHog from your Node.js applications."},"types":[{"id":"_SentryEvent","name":"_SentryEvent","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryEventProcessor","name":"_SentryEventProcessor","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryHub","name":"_SentryHub","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryIntegration","name":"_SentryIntegration","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"_SentryIntegrationClass","name":"_SentryIntegrationClass","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"src/types.ts","example":"(event: EventMessage | null) => EventMessage | null","properties":[]},{"id":"EventMessage","name":"EventMessage","path":"src/types.ts","properties":[{"name":"event","type":"string"},{"name":"groups","type":"Record<string, string | number>"},{"name":"sendFeatureFlags","type":"boolean | SendFeatureFlagsOptions"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"ExpressErrorMiddleware","name":"ExpressErrorMiddleware","path":"src/extensions/express.ts","example":"(error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void","properties":[]},{"id":"ExpressMiddleware","name":"ExpressMiddleware","path":"src/extensions/express.ts","example":"(req: http.IncomingMessage, res: http.ServerResponse, next: () => void) => void","properties":[]},{"id":"FeatureFlagCondition","name":"FeatureFlagCondition","path":"src/types.ts","example":"{\n    properties: FlagProperty[];\n    rollout_percentage?: number;\n    variant?: string;\n}","properties":[]},{"id":"FlagProperty","name":"FlagProperty","path":"src/types.ts","example":"{\n    key: string;\n    type?: string;\n    value: FlagPropertyValue;\n    operator?: string;\n    negation?: boolean;\n    dependency_chain?: string[];\n}","properties":[]},{"id":"FlagPropertyValue","name":"FlagPropertyValue","path":"src/types.ts","example":"string | number | (string | number)[] | boolean","properties":[]},{"id":"GroupIdentifyMessage","name":"GroupIdentifyMessage","path":"src/types.ts","properties":[{"name":"disableGeoip","type":"boolean"},{"name":"distinctId","type":"string"},{"name":"groupKey","type":"string"},{"name":"groupType","type":"string"},{"name":"properties","type":"Record<string | number, any>"}]},{"id":"IdentifyMessage","name":"IdentifyMessage","path":"src/types.ts","properties":[{"name":"disableGeoip","type":"boolean"},{"name":"distinctId","type":"string"},{"name":"properties","type":"Record<string | number, any>"}]},{"id":"IPostHog","name":"IPostHog","path":"src/types.ts","properties":[]},{"id":"MiddlewareError","name":"MiddlewareError","path":"src/extensions/express.ts","properties":[{"name":"output","type":"{\n        statusCode?: number | string;\n    }"},{"name":"status_code","type":"number | string"},{"name":"status","type":"number | string"},{"name":"statusCode","type":"number | string"}]},{"id":"PostHogFeatureFlag","name":"PostHogFeatureFlag","path":"src/types.ts","example":"{\n    id: number;\n    name: string;\n    key: string;\n    filters?: {\n        aggregation_group_type_index?: number;\n        groups?: FeatureFlagCondition[];\n        multivariate?: {\n            variants: {\n                key: string;\n                rollout_percentage: number;\n            }[];\n        };\n        payloads?: Record<string, string>;\n    };\n    deleted: boolean;\n    active: boolean;\n    rollout_percentage: null | number;\n    ensure_experience_continuity: boolean;\n    experiment_set: number[];\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"src/types.ts","example":"PostHogCoreOptions & {\n    persistence?: 'memory';\n    personalApiKey?: string;\n    privacyMode?: boolean;\n    enableExceptionAutocapture?: boolean;\n    featureFlagsPollingInterval?: number;\n    maxCacheSize?: number;\n    fetch?: (url: string, options: PostHogFetchOptions) => Promise<PostHogFetchResponse>;\n    enableLocalEvaluation?: boolean;\n    before_send?: BeforeSendFn | BeforeSendFn[];\n    evaluationEnvironments?: readonly string[];\n}","properties":[]},{"id":"PropertyGroup","name":"PropertyGroup","path":"src/types.ts","example":"{\n    type: 'AND' | 'OR';\n    values: PropertyGroup[] | FlagProperty[];\n}","properties":[]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"src/types.ts","properties":[{"name":"flagKeys","type":"string[]"},{"name":"groupProperties","type":"Record<string, Record<string, any>>"},{"name":"onlyEvaluateLocally","type":"boolean"},{"name":"personProperties","type":"Record<string, any>"}]},{"id":"SentryIntegrationOptions","name":"SentryIntegrationOptions","path":"src/extensions/sentry-integration.ts","example":"{\n    organization?: string;\n    projectId?: number;\n    prefix?: string;\n    severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n    sendExceptionsToPostHog?: boolean;\n}","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"getLibraryId","path":"src/entrypoints/index.node.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"PostHog","path":"src/entrypoints/index.node.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog project API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"Configuration options for the client"}],"details":null,"category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// Basic initialization\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  { host: 'https://app.posthog.com' }\n)\n\n\n","name":"Basic initialization"},{"id":"with_personal_api_key","code":"\n\n// With personal API key\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  {\n    host: 'https://app.posthog.com',\n    personalApiKey: 'your-personal-api-key'\n  }\n)\n\n\n\n","name":"With personal API key"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Initialize a new PostHog client instance."},{"id":"alias","path":"src/entrypoints/index.node.ts","title":"alias","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user","code":"\n\n// Link an anonymous user to an identified user\nclient.alias({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create an alias to link two distinct IDs together."},{"id":"aliasImmediate","path":"src/entrypoints/index.node.ts","title":"aliasImmediate","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user_immediately","code":"\n\n// Link an anonymous user to an identified user immediately\nawait client.aliasImmediate({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user immediately"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Create an alias to link two distinct IDs together immediately (synchronously)."},{"id":"capture","path":"src/entrypoints/index.node.ts","title":"capture","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_capture","code":"\n\n// Basic capture\nclient.capture({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n\n","name":"Basic capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an event manually."},{"id":"captureException","path":"src/entrypoints/index.node.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_with_user_id","code":"\n\n// Capture an error with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  client.captureException(error, 'user_123')\n}\n\n\n","name":"Capture an error with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  client.captureException(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an error exception as an event."},{"id":"captureExceptionImmediate","path":"src/entrypoints/index.node.ts","title":"captureExceptionImmediate","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_immediately_with_user_id","code":"\n\n// Capture an error immediately with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123')\n}\n\n\n","name":"Capture an error immediately with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an error exception as an event immediately (synchronously)."},{"id":"captureImmediate","path":"src/entrypoints/index.node.ts","title":"captureImmediate","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_immediate_capture","code":"\n\n// Basic immediate capture\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n","name":"Basic immediate capture"},{"id":"with_feature_flags","code":"\n\n// With feature flags\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: true\n})\n\n\n","name":"With feature flags"},{"id":"with_custom_feature_flags_options","code":"\n\n// With custom feature flags options\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: {\n    onlyEvaluateLocally: true,\n    personProperties: { plan: 'premium' },\n    groupProperties: { org: { tier: 'enterprise' } }\n    flagKeys: ['flag1', 'flag2']\n  }\n})\n\n\n\n","name":"With custom feature flags options"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an event immediately (synchronously)."},{"id":"debug","path":"src/entrypoints/index.node.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":"Whether to enable debug logging"}],"details":null,"category":"Initialization","examples":[{"id":"enable_debug_logging","code":"\n\n// Enable debug logging\nclient.debug(true)\n\n\n","name":"Enable debug logging"},{"id":"disable_debug_logging","code":"\n\n// Disable debug logging\nclient.debug(false)\n\n\n\n","name":"Disable debug logging"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enable or disable debug logging."},{"id":"disable","path":"src/entrypoints/index.node.ts","title":"disable","params":[],"details":null,"category":"Privacy","examples":[{"id":"disable_client","code":"\n\n// Disable client\nawait client.disable()\n// Client is now disabled and will not capture events\n\n\n\n","name":"Disable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Disable the PostHog client (opt-out)."},{"id":"enable","path":"src/entrypoints/index.node.ts","title":"enable","params":[],"details":null,"category":"Privacy","examples":[{"id":"enable_client","code":"\n\n// Enable client\nawait client.enable()\n// Client is now enabled and will capture events\n\n\n\n","name":"Enable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Enable the PostHog client (opt-in)."},{"id":"getAllFlags","path":"src/entrypoints/index.node.ts","title":"getAllFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_for_a_user","code":"\n\n// Get all flags for a user\nconst allFlags = await client.getAllFlags('user_123')\nconsole.log('User flags:', allFlags)\n// Output: { 'flag-1': 'variant-a', 'flag-2': false, 'flag-3': 'variant-b' }\n\n\n","name":"Get all flags for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst specificFlags = await client.getAllFlags('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst orgFlags = await client.getAllFlags('user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, FeatureFlagValue>>","name":"Promise<Record<string, FeatureFlagValue>>"},"description":"Get all feature flag values for a specific user."},{"id":"getAllFlagsAndPayloads","path":"src/entrypoints/index.node.ts","title":"getAllFlagsAndPayloads","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_and_payloads_for_a_user","code":"\n\n// Get all flags and payloads for a user\nconst result = await client.getAllFlagsAndPayloads('user_123')\nconsole.log('Flags:', result.featureFlags)\nconsole.log('Payloads:', result.featureFlagPayloads)\n\n\n","name":"Get all flags and payloads for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsAndPayloadsResponse>","name":"Promise<PostHogFlagsAndPayloadsResponse>"},"description":"Get all feature flag values and payloads for a specific user."},{"id":"getCustomUserAgent","path":"src/entrypoints/index.node.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"Identification","examples":[{"id":"get_user_agent","code":"\n\n// Get user agent\nconst userAgent = client.getCustomUserAgent()\n// Returns: \"posthog-node/5.7.0\"\n\n\n\n","name":"Get user agent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the custom user agent string for this client."},{"id":"getFeatureFlag","path":"src/entrypoints/index.node.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst flagValue = await client.getFeatureFlag('new-feature', 'user_123')\nif (flagValue === 'variant-a') {\n  // Show variant A\n} else if (flagValue === 'variant-b') {\n  // Show variant B\n} else {\n  // Flag is disabled or not found\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst flagValue = await client.getFeatureFlag('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' },\n  groupProperties: { organization: { tier: 'premium' } }\n})\n\n\n","name":"With groups and properties"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst flagValue = await client.getFeatureFlag('local-flag', 'user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<FeatureFlagValue | undefined>","name":"Promise<FeatureFlagValue | undefined>"},"description":"Get the value of a feature flag for a specific user."},{"id":"getFeatureFlagPayload","path":"src/entrypoints/index.node.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"matchValue","type":"FeatureFlagValue","isOptional":true,"description":"Optional match value to get payload for"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_payload_for_a_feature_flag","code":"\n\n// Get payload for a feature flag\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123')\nif (payload) {\n  console.log('Flag payload:', payload)\n}\n\n\n","name":"Get payload for a feature flag"},{"id":"get_payload_with_specific_match_value","code":"\n\n// Get payload with specific match value\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123', 'variant-a')\n\n\n","name":"Get payload with specific match value"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst payload = await client.getFeatureFlagPayload('org-flag', 'user_123', undefined, {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the payload for a feature flag."},{"id":"getLibraryVersion","path":"src/entrypoints/index.node.ts","title":"getLibraryVersion","params":[],"details":null,"category":"Initialization","examples":[{"id":"get_version","code":"\n\n// Get version\nconst version = client.getLibraryVersion()\nconsole.log(`Using PostHog SDK version: ${version}`)\n\n\n\n","name":"Get version"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the library version from package.json."},{"id":"getPersistedProperty","path":"src/entrypoints/index.node.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to retrieve"}],"details":null,"category":"Initialization","examples":[{"id":"get_user_id","code":"\n\n// Get user ID\nconst userId = client.getPersistedProperty('userId')\n\n\n","name":"Get user ID"},{"id":"get_session_id","code":"\n\n// Get session ID\nconst sessionId = client.getPersistedProperty('sessionId')\n\n\n\n","name":"Get session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any | undefined","name":"any | undefined"},"description":"Get a persisted property value from memory storage."},{"id":"getRemoteConfigPayload","path":"src/entrypoints/index.node.ts","title":"getRemoteConfigPayload","params":[{"name":"flagKey","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_remote_config_payload","code":"\n\n// Get remote config payload\nconst payload = await client.getRemoteConfigPayload('flag-key')\nif (payload) {\n  console.log('Remote config payload:', payload)\n}\n\n\n\n\n","name":"Get remote config payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the remote config payload for a feature flag."},{"id":"groupIdentify","path":"src/entrypoints/index.node.ts","title":"groupIdentify","params":[{"name":"{ groupType, groupKey, properties, distinctId, disableGeoip }","type":"GroupIdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"create_a_company_group","code":"\n\n// Create a company group\nclient.groupIdentify({\n  groupType: 'company',\n  groupKey: 'acme-corp',\n  properties: {\n    name: 'Acme Corporation',\n    industry: 'Technology',\n    employee_count: 500\n  },\n  distinctId: 'user_123'\n})\n\n\n","name":"Create a company group"},{"id":"update_organization_properties","code":"\n\n// Update organization properties\nclient.groupIdentify({\n  groupType: 'organization',\n  groupKey: 'org-456',\n  properties: {\n    plan: 'enterprise',\n    region: 'US-West'\n  }\n})\n\n\n\n","name":"Update organization properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create or update a group and its properties."},{"id":"identify","path":"src/entrypoints/index.node.ts","title":"identify","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_identify_with_properties","code":"\n\n// Basic identify with properties\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com',\n    plan: 'premium'\n  }\n})\n\n\n","name":"Basic identify with properties"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    $set: { name: 'John Doe', email: 'john@example.com' },\n    $set_once: { first_login: new Date().toISOString() }\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Identify a user and set their properties."},{"id":"identifyImmediate","path":"src/entrypoints/index.node.ts","title":"identifyImmediate","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_immediate_identify","code":"\n\n// Basic immediate identify\nawait client.identifyImmediate({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com'\n  }\n})\n\n\n\n","name":"Basic immediate identify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Identify a user and set their properties immediately (synchronously)."},{"id":"isFeatureEnabled","path":"src/entrypoints/index.node.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst isEnabled = await client.isFeatureEnabled('new-feature', 'user_123')\nif (isEnabled) {\n  // Feature is enabled\n  console.log('New feature is active')\n} else {\n  // Feature is disabled\n  console.log('New feature is not active')\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst isEnabled = await client.isFeatureEnabled('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean | undefined>","name":"Promise<boolean | undefined>"},"description":"Check if a feature flag is enabled for a specific user."},{"id":"isLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"isLocalEvaluationReady","params":[],"details":null,"category":"Feature flags","examples":[{"id":"check_if_ready","code":"\n\n// Check if ready\nif (client.isLocalEvaluationReady()) {\n  // Local evaluation is ready, can evaluate flags locally\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n} else {\n  // Local evaluation not ready, will use remote evaluation\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n}\n\n\n\n","name":"Check if ready"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Check if local evaluation of feature flags is ready."},{"id":"prepareEventMessage","path":"src/entrypoints/index.node.ts","title":"prepareEventMessage","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"prepareeventmessage","code":"// Generated example for prepareEventMessage\nposthog.prepareEventMessage();","name":"Generated example for prepareEventMessage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>","name":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>"}},{"id":"reloadFeatureFlags","path":"src/entrypoints/index.node.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"force_reload_of_feature_flags","code":"\n\n// Force reload of feature flags\nawait client.reloadFeatureFlags()\nconsole.log('Feature flags reloaded')\n\n\n","name":"Force reload of feature flags"},{"id":"reload_before_checking_a_specific_flag","code":"\n\n// Reload before checking a specific flag\nawait client.reloadFeatureFlags()\nconst flag = await client.getFeatureFlag('flag-key', 'user_123')\n\n\n\n","name":"Reload before checking a specific flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Reload feature flag definitions from the server for local evaluation."},{"id":"setPersistedProperty","path":"src/entrypoints/index.node.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to set"},{"name":"value","type":"any | null","isOptional":false,"description":"The value to store (null to remove)"}],"details":null,"category":"Initialization","examples":[{"id":"set_user_id","code":"\n\n// Set user ID\nclient.setPersistedProperty('userId', 'user_123')\n\n\n","name":"Set user ID"},{"id":"set_session_id","code":"\n\n// Set session ID\nclient.setPersistedProperty('sessionId', 'session_456')\n\n\n\n","name":"Set session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Set a persisted property value in memory storage."},{"id":"waitForLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"waitForLocalEvaluationReady","params":[{"name":"timeoutMs","type":"number","isOptional":true,"description":"Timeout in milliseconds (default: 30000)"}],"details":null,"category":"Feature flags","examples":[{"id":"wait_for_local_evaluation","code":"\n\n// Wait for local evaluation\nconst isReady = await client.waitForLocalEvaluationReady()\nif (isReady) {\n  console.log('Local evaluation is ready')\n} else {\n  console.log('Local evaluation timed out')\n}\n\n\n","name":"Wait for local evaluation"},{"id":"wait_with_custom_timeout","code":"\n\n// Wait with custom timeout\nconst isReady = await client.waitForLocalEvaluationReady(10000) // 10 seconds\n\n\n\n","name":"Wait with custom timeout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean>","name":"Promise<boolean>"},"description":"Wait for local evaluation of feature flags to be ready."}]}],"version":"5.10.1","categories":["Initialization","Identification","Capture","Error tracking","Privacy","Feature flags"],"referenceId":"posthog-node"},"createdAt":"2025-10-25T22:45:02.053Z","updatedAt":"2025-10-25T22:45:02.053Z","publishedAt":"2025-10-25T22:45:02.049Z"}},{"id":17,"attributes":{"referenceId":"posthog-node","version":"5.10.2","data":{"id":"posthog-node-5.10.2","info":{"id":"posthog-node","title":"PostHog Node.js SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"5.10.2","slugPrefix":"posthog-node","description":"PostHog Node.js SDK allows you to capture events and send them to PostHog from your Node.js applications."},"types":[{"id":"_SentryEvent","name":"_SentryEvent","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryEventProcessor","name":"_SentryEventProcessor","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryHub","name":"_SentryHub","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryIntegration","name":"_SentryIntegration","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"_SentryIntegrationClass","name":"_SentryIntegrationClass","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"src/types.ts","example":"(event: EventMessage | null) => EventMessage | null","properties":[]},{"id":"EventMessage","name":"EventMessage","path":"src/types.ts","properties":[{"name":"event","type":"string"},{"name":"groups","type":"Record<string, string | number>"},{"name":"sendFeatureFlags","type":"boolean | SendFeatureFlagsOptions"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"ExpressErrorMiddleware","name":"ExpressErrorMiddleware","path":"src/extensions/express.ts","example":"(error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void","properties":[]},{"id":"ExpressMiddleware","name":"ExpressMiddleware","path":"src/extensions/express.ts","example":"(req: http.IncomingMessage, res: http.ServerResponse, next: () => void) => void","properties":[]},{"id":"FeatureFlagCondition","name":"FeatureFlagCondition","path":"src/types.ts","example":"{\n    properties: FlagProperty[];\n    rollout_percentage?: number;\n    variant?: string;\n}","properties":[]},{"id":"FlagProperty","name":"FlagProperty","path":"src/types.ts","example":"{\n    key: string;\n    type?: string;\n    value: FlagPropertyValue;\n    operator?: string;\n    negation?: boolean;\n    dependency_chain?: string[];\n}","properties":[]},{"id":"FlagPropertyValue","name":"FlagPropertyValue","path":"src/types.ts","example":"string | number | (string | number)[] | boolean","properties":[]},{"id":"GroupIdentifyMessage","name":"GroupIdentifyMessage","path":"src/types.ts","properties":[{"name":"disableGeoip","type":"boolean"},{"name":"distinctId","type":"string"},{"name":"groupKey","type":"string"},{"name":"groupType","type":"string"},{"name":"properties","type":"Record<string | number, any>"}]},{"id":"IdentifyMessage","name":"IdentifyMessage","path":"src/types.ts","properties":[{"name":"disableGeoip","type":"boolean"},{"name":"distinctId","type":"string"},{"name":"properties","type":"Record<string | number, any>"}]},{"id":"IPostHog","name":"IPostHog","path":"src/types.ts","properties":[]},{"id":"MiddlewareError","name":"MiddlewareError","path":"src/extensions/express.ts","properties":[{"name":"output","type":"{\n        statusCode?: number | string;\n    }"},{"name":"status_code","type":"number | string"},{"name":"status","type":"number | string"},{"name":"statusCode","type":"number | string"}]},{"id":"PostHogFeatureFlag","name":"PostHogFeatureFlag","path":"src/types.ts","example":"{\n    id: number;\n    name: string;\n    key: string;\n    filters?: {\n        aggregation_group_type_index?: number;\n        groups?: FeatureFlagCondition[];\n        multivariate?: {\n            variants: {\n                key: string;\n                rollout_percentage: number;\n            }[];\n        };\n        payloads?: Record<string, string>;\n    };\n    deleted: boolean;\n    active: boolean;\n    rollout_percentage: null | number;\n    ensure_experience_continuity: boolean;\n    experiment_set: number[];\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"src/types.ts","example":"PostHogCoreOptions & {\n    persistence?: 'memory';\n    personalApiKey?: string;\n    privacyMode?: boolean;\n    enableExceptionAutocapture?: boolean;\n    featureFlagsPollingInterval?: number;\n    maxCacheSize?: number;\n    fetch?: (url: string, options: PostHogFetchOptions) => Promise<PostHogFetchResponse>;\n    enableLocalEvaluation?: boolean;\n    before_send?: BeforeSendFn | BeforeSendFn[];\n    evaluationEnvironments?: readonly string[];\n}","properties":[]},{"id":"PropertyGroup","name":"PropertyGroup","path":"src/types.ts","example":"{\n    type: 'AND' | 'OR';\n    values: PropertyGroup[] | FlagProperty[];\n}","properties":[]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"src/types.ts","properties":[{"name":"flagKeys","type":"string[]"},{"name":"groupProperties","type":"Record<string, Record<string, any>>"},{"name":"onlyEvaluateLocally","type":"boolean"},{"name":"personProperties","type":"Record<string, any>"}]},{"id":"SentryIntegrationOptions","name":"SentryIntegrationOptions","path":"src/extensions/sentry-integration.ts","example":"{\n    organization?: string;\n    projectId?: number;\n    prefix?: string;\n    severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n    sendExceptionsToPostHog?: boolean;\n}","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"getLibraryId","path":"src/entrypoints/index.node.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"PostHog","path":"src/entrypoints/index.node.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog project API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"Configuration options for the client"}],"details":null,"category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// Basic initialization\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  { host: 'https://app.posthog.com' }\n)\n\n\n","name":"Basic initialization"},{"id":"with_personal_api_key","code":"\n\n// With personal API key\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  {\n    host: 'https://app.posthog.com',\n    personalApiKey: 'your-personal-api-key'\n  }\n)\n\n\n\n","name":"With personal API key"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Initialize a new PostHog client instance."},{"id":"alias","path":"src/entrypoints/index.node.ts","title":"alias","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user","code":"\n\n// Link an anonymous user to an identified user\nclient.alias({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create an alias to link two distinct IDs together."},{"id":"aliasImmediate","path":"src/entrypoints/index.node.ts","title":"aliasImmediate","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user_immediately","code":"\n\n// Link an anonymous user to an identified user immediately\nawait client.aliasImmediate({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user immediately"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Create an alias to link two distinct IDs together immediately (synchronously)."},{"id":"capture","path":"src/entrypoints/index.node.ts","title":"capture","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_capture","code":"\n\n// Basic capture\nclient.capture({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n\n","name":"Basic capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an event manually."},{"id":"captureException","path":"src/entrypoints/index.node.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_with_user_id","code":"\n\n// Capture an error with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  client.captureException(error, 'user_123')\n}\n\n\n","name":"Capture an error with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  client.captureException(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an error exception as an event."},{"id":"captureExceptionImmediate","path":"src/entrypoints/index.node.ts","title":"captureExceptionImmediate","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_immediately_with_user_id","code":"\n\n// Capture an error immediately with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123')\n}\n\n\n","name":"Capture an error immediately with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an error exception as an event immediately (synchronously)."},{"id":"captureImmediate","path":"src/entrypoints/index.node.ts","title":"captureImmediate","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_immediate_capture","code":"\n\n// Basic immediate capture\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n","name":"Basic immediate capture"},{"id":"with_feature_flags","code":"\n\n// With feature flags\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: true\n})\n\n\n","name":"With feature flags"},{"id":"with_custom_feature_flags_options","code":"\n\n// With custom feature flags options\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: {\n    onlyEvaluateLocally: true,\n    personProperties: { plan: 'premium' },\n    groupProperties: { org: { tier: 'enterprise' } }\n    flagKeys: ['flag1', 'flag2']\n  }\n})\n\n\n\n","name":"With custom feature flags options"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an event immediately (synchronously)."},{"id":"debug","path":"src/entrypoints/index.node.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":"Whether to enable debug logging"}],"details":null,"category":"Initialization","examples":[{"id":"enable_debug_logging","code":"\n\n// Enable debug logging\nclient.debug(true)\n\n\n","name":"Enable debug logging"},{"id":"disable_debug_logging","code":"\n\n// Disable debug logging\nclient.debug(false)\n\n\n\n","name":"Disable debug logging"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enable or disable debug logging."},{"id":"disable","path":"src/entrypoints/index.node.ts","title":"disable","params":[],"details":null,"category":"Privacy","examples":[{"id":"disable_client","code":"\n\n// Disable client\nawait client.disable()\n// Client is now disabled and will not capture events\n\n\n\n","name":"Disable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Disable the PostHog client (opt-out)."},{"id":"enable","path":"src/entrypoints/index.node.ts","title":"enable","params":[],"details":null,"category":"Privacy","examples":[{"id":"enable_client","code":"\n\n// Enable client\nawait client.enable()\n// Client is now enabled and will capture events\n\n\n\n","name":"Enable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Enable the PostHog client (opt-in)."},{"id":"getAllFlags","path":"src/entrypoints/index.node.ts","title":"getAllFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_for_a_user","code":"\n\n// Get all flags for a user\nconst allFlags = await client.getAllFlags('user_123')\nconsole.log('User flags:', allFlags)\n// Output: { 'flag-1': 'variant-a', 'flag-2': false, 'flag-3': 'variant-b' }\n\n\n","name":"Get all flags for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst specificFlags = await client.getAllFlags('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst orgFlags = await client.getAllFlags('user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, FeatureFlagValue>>","name":"Promise<Record<string, FeatureFlagValue>>"},"description":"Get all feature flag values for a specific user."},{"id":"getAllFlagsAndPayloads","path":"src/entrypoints/index.node.ts","title":"getAllFlagsAndPayloads","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_and_payloads_for_a_user","code":"\n\n// Get all flags and payloads for a user\nconst result = await client.getAllFlagsAndPayloads('user_123')\nconsole.log('Flags:', result.featureFlags)\nconsole.log('Payloads:', result.featureFlagPayloads)\n\n\n","name":"Get all flags and payloads for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsAndPayloadsResponse>","name":"Promise<PostHogFlagsAndPayloadsResponse>"},"description":"Get all feature flag values and payloads for a specific user."},{"id":"getCustomUserAgent","path":"src/entrypoints/index.node.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"Identification","examples":[{"id":"get_user_agent","code":"\n\n// Get user agent\nconst userAgent = client.getCustomUserAgent()\n// Returns: \"posthog-node/5.7.0\"\n\n\n\n","name":"Get user agent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the custom user agent string for this client."},{"id":"getFeatureFlag","path":"src/entrypoints/index.node.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst flagValue = await client.getFeatureFlag('new-feature', 'user_123')\nif (flagValue === 'variant-a') {\n  // Show variant A\n} else if (flagValue === 'variant-b') {\n  // Show variant B\n} else {\n  // Flag is disabled or not found\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst flagValue = await client.getFeatureFlag('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' },\n  groupProperties: { organization: { tier: 'premium' } }\n})\n\n\n","name":"With groups and properties"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst flagValue = await client.getFeatureFlag('local-flag', 'user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<FeatureFlagValue | undefined>","name":"Promise<FeatureFlagValue | undefined>"},"description":"Get the value of a feature flag for a specific user."},{"id":"getFeatureFlagPayload","path":"src/entrypoints/index.node.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"matchValue","type":"FeatureFlagValue","isOptional":true,"description":"Optional match value to get payload for"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_payload_for_a_feature_flag","code":"\n\n// Get payload for a feature flag\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123')\nif (payload) {\n  console.log('Flag payload:', payload)\n}\n\n\n","name":"Get payload for a feature flag"},{"id":"get_payload_with_specific_match_value","code":"\n\n// Get payload with specific match value\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123', 'variant-a')\n\n\n","name":"Get payload with specific match value"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst payload = await client.getFeatureFlagPayload('org-flag', 'user_123', undefined, {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the payload for a feature flag."},{"id":"getLibraryVersion","path":"src/entrypoints/index.node.ts","title":"getLibraryVersion","params":[],"details":null,"category":"Initialization","examples":[{"id":"get_version","code":"\n\n// Get version\nconst version = client.getLibraryVersion()\nconsole.log(`Using PostHog SDK version: ${version}`)\n\n\n\n","name":"Get version"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the library version from package.json."},{"id":"getPersistedProperty","path":"src/entrypoints/index.node.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to retrieve"}],"details":null,"category":"Initialization","examples":[{"id":"get_user_id","code":"\n\n// Get user ID\nconst userId = client.getPersistedProperty('userId')\n\n\n","name":"Get user ID"},{"id":"get_session_id","code":"\n\n// Get session ID\nconst sessionId = client.getPersistedProperty('sessionId')\n\n\n\n","name":"Get session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any | undefined","name":"any | undefined"},"description":"Get a persisted property value from memory storage."},{"id":"getRemoteConfigPayload","path":"src/entrypoints/index.node.ts","title":"getRemoteConfigPayload","params":[{"name":"flagKey","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_remote_config_payload","code":"\n\n// Get remote config payload\nconst payload = await client.getRemoteConfigPayload('flag-key')\nif (payload) {\n  console.log('Remote config payload:', payload)\n}\n\n\n\n\n","name":"Get remote config payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the remote config payload for a feature flag."},{"id":"groupIdentify","path":"src/entrypoints/index.node.ts","title":"groupIdentify","params":[{"name":"{ groupType, groupKey, properties, distinctId, disableGeoip }","type":"GroupIdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"create_a_company_group","code":"\n\n// Create a company group\nclient.groupIdentify({\n  groupType: 'company',\n  groupKey: 'acme-corp',\n  properties: {\n    name: 'Acme Corporation',\n    industry: 'Technology',\n    employee_count: 500\n  },\n  distinctId: 'user_123'\n})\n\n\n","name":"Create a company group"},{"id":"update_organization_properties","code":"\n\n// Update organization properties\nclient.groupIdentify({\n  groupType: 'organization',\n  groupKey: 'org-456',\n  properties: {\n    plan: 'enterprise',\n    region: 'US-West'\n  }\n})\n\n\n\n","name":"Update organization properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create or update a group and its properties."},{"id":"identify","path":"src/entrypoints/index.node.ts","title":"identify","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_identify_with_properties","code":"\n\n// Basic identify with properties\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com',\n    plan: 'premium'\n  }\n})\n\n\n","name":"Basic identify with properties"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    $set: { name: 'John Doe', email: 'john@example.com' },\n    $set_once: { first_login: new Date().toISOString() }\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Identify a user and set their properties."},{"id":"identifyImmediate","path":"src/entrypoints/index.node.ts","title":"identifyImmediate","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_immediate_identify","code":"\n\n// Basic immediate identify\nawait client.identifyImmediate({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com'\n  }\n})\n\n\n\n","name":"Basic immediate identify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Identify a user and set their properties immediately (synchronously)."},{"id":"isFeatureEnabled","path":"src/entrypoints/index.node.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst isEnabled = await client.isFeatureEnabled('new-feature', 'user_123')\nif (isEnabled) {\n  // Feature is enabled\n  console.log('New feature is active')\n} else {\n  // Feature is disabled\n  console.log('New feature is not active')\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst isEnabled = await client.isFeatureEnabled('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean | undefined>","name":"Promise<boolean | undefined>"},"description":"Check if a feature flag is enabled for a specific user."},{"id":"isLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"isLocalEvaluationReady","params":[],"details":null,"category":"Feature flags","examples":[{"id":"check_if_ready","code":"\n\n// Check if ready\nif (client.isLocalEvaluationReady()) {\n  // Local evaluation is ready, can evaluate flags locally\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n} else {\n  // Local evaluation not ready, will use remote evaluation\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n}\n\n\n\n","name":"Check if ready"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Check if local evaluation of feature flags is ready."},{"id":"prepareEventMessage","path":"src/entrypoints/index.node.ts","title":"prepareEventMessage","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"prepareeventmessage","code":"// Generated example for prepareEventMessage\nposthog.prepareEventMessage();","name":"Generated example for prepareEventMessage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>","name":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>"}},{"id":"reloadFeatureFlags","path":"src/entrypoints/index.node.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"force_reload_of_feature_flags","code":"\n\n// Force reload of feature flags\nawait client.reloadFeatureFlags()\nconsole.log('Feature flags reloaded')\n\n\n","name":"Force reload of feature flags"},{"id":"reload_before_checking_a_specific_flag","code":"\n\n// Reload before checking a specific flag\nawait client.reloadFeatureFlags()\nconst flag = await client.getFeatureFlag('flag-key', 'user_123')\n\n\n\n","name":"Reload before checking a specific flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Reload feature flag definitions from the server for local evaluation."},{"id":"setPersistedProperty","path":"src/entrypoints/index.node.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to set"},{"name":"value","type":"any | null","isOptional":false,"description":"The value to store (null to remove)"}],"details":null,"category":"Initialization","examples":[{"id":"set_user_id","code":"\n\n// Set user ID\nclient.setPersistedProperty('userId', 'user_123')\n\n\n","name":"Set user ID"},{"id":"set_session_id","code":"\n\n// Set session ID\nclient.setPersistedProperty('sessionId', 'session_456')\n\n\n\n","name":"Set session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Set a persisted property value in memory storage."},{"id":"waitForLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"waitForLocalEvaluationReady","params":[{"name":"timeoutMs","type":"number","isOptional":true,"description":"Timeout in milliseconds (default: 30000)"}],"details":null,"category":"Feature flags","examples":[{"id":"wait_for_local_evaluation","code":"\n\n// Wait for local evaluation\nconst isReady = await client.waitForLocalEvaluationReady()\nif (isReady) {\n  console.log('Local evaluation is ready')\n} else {\n  console.log('Local evaluation timed out')\n}\n\n\n","name":"Wait for local evaluation"},{"id":"wait_with_custom_timeout","code":"\n\n// Wait with custom timeout\nconst isReady = await client.waitForLocalEvaluationReady(10000) // 10 seconds\n\n\n\n","name":"Wait with custom timeout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean>","name":"Promise<boolean>"},"description":"Wait for local evaluation of feature flags to be ready."}]}],"version":"5.10.2","categories":["Initialization","Identification","Capture","Error tracking","Privacy","Feature flags"],"referenceId":"posthog-node"},"createdAt":"2025-10-25T22:45:02.095Z","updatedAt":"2025-10-25T22:45:02.095Z","publishedAt":"2025-10-25T22:45:02.090Z"}},{"id":18,"attributes":{"referenceId":"posthog-node","version":"5.9.1","data":{"id":"posthog-node-5.9.1","info":{"id":"posthog-node","title":"PostHog Node.js SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"5.9.1","slugPrefix":"posthog-node","description":"PostHog Node.js SDK allows you to capture events and send them to PostHog from your Node.js applications."},"types":[{"id":"_SentryEvent","name":"_SentryEvent","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryEventProcessor","name":"_SentryEventProcessor","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryHub","name":"_SentryHub","path":"src/extensions/sentry-integration.ts","properties":[]},{"id":"_SentryIntegration","name":"_SentryIntegration","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"_SentryIntegrationClass","name":"_SentryIntegrationClass","path":"src/extensions/sentry-integration.ts","properties":[{"name":"name","type":"string"}]},{"id":"BeforeSendFn","name":"BeforeSendFn","path":"src/types.ts","example":"(event: EventMessage | null) => EventMessage | null","properties":[]},{"id":"EventMessage","name":"EventMessage","path":"src/types.ts","properties":[{"name":"event","type":"string"},{"name":"groups","type":"Record<string, string | number>"},{"name":"sendFeatureFlags","type":"boolean | SendFeatureFlagsOptions"},{"name":"timestamp","type":"Date"},{"name":"uuid","type":"string"}]},{"id":"ExpressErrorMiddleware","name":"ExpressErrorMiddleware","path":"src/extensions/express.ts","example":"(error: MiddlewareError, req: http.IncomingMessage, res: http.ServerResponse, next: (error: MiddlewareError) => void) => void","properties":[]},{"id":"ExpressMiddleware","name":"ExpressMiddleware","path":"src/extensions/express.ts","example":"(req: http.IncomingMessage, res: http.ServerResponse, next: () => void) => void","properties":[]},{"id":"FeatureFlagCondition","name":"FeatureFlagCondition","path":"src/types.ts","example":"{\n    properties: FlagProperty[];\n    rollout_percentage?: number;\n    variant?: string;\n}","properties":[]},{"id":"FlagProperty","name":"FlagProperty","path":"src/types.ts","example":"{\n    key: string;\n    type?: string;\n    value: FlagPropertyValue;\n    operator?: string;\n    negation?: boolean;\n    dependency_chain?: string[];\n}","properties":[]},{"id":"FlagPropertyValue","name":"FlagPropertyValue","path":"src/types.ts","example":"string | number | (string | number)[] | boolean","properties":[]},{"id":"GroupIdentifyMessage","name":"GroupIdentifyMessage","path":"src/types.ts","properties":[{"name":"disableGeoip","type":"boolean"},{"name":"distinctId","type":"string"},{"name":"groupKey","type":"string"},{"name":"groupType","type":"string"},{"name":"properties","type":"Record<string | number, any>"}]},{"id":"IdentifyMessage","name":"IdentifyMessage","path":"src/types.ts","properties":[{"name":"disableGeoip","type":"boolean"},{"name":"distinctId","type":"string"},{"name":"properties","type":"Record<string | number, any>"}]},{"id":"IPostHog","name":"IPostHog","path":"src/types.ts","properties":[]},{"id":"MiddlewareError","name":"MiddlewareError","path":"src/extensions/express.ts","properties":[{"name":"output","type":"{\n        statusCode?: number | string;\n    }"},{"name":"status_code","type":"number | string"},{"name":"status","type":"number | string"},{"name":"statusCode","type":"number | string"}]},{"id":"PostHogFeatureFlag","name":"PostHogFeatureFlag","path":"src/types.ts","example":"{\n    id: number;\n    name: string;\n    key: string;\n    filters?: {\n        aggregation_group_type_index?: number;\n        groups?: FeatureFlagCondition[];\n        multivariate?: {\n            variants: {\n                key: string;\n                rollout_percentage: number;\n            }[];\n        };\n        payloads?: Record<string, string>;\n    };\n    deleted: boolean;\n    active: boolean;\n    rollout_percentage: null | number;\n    ensure_experience_continuity: boolean;\n    experiment_set: number[];\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"src/types.ts","example":"PostHogCoreOptions & {\n    persistence?: 'memory';\n    personalApiKey?: string;\n    privacyMode?: boolean;\n    enableExceptionAutocapture?: boolean;\n    featureFlagsPollingInterval?: number;\n    maxCacheSize?: number;\n    fetch?: (url: string, options: PostHogFetchOptions) => Promise<PostHogFetchResponse>;\n    enableLocalEvaluation?: boolean;\n    before_send?: BeforeSendFn | BeforeSendFn[];\n}","properties":[]},{"id":"PropertyGroup","name":"PropertyGroup","path":"src/types.ts","example":"{\n    type: 'AND' | 'OR';\n    values: PropertyGroup[] | FlagProperty[];\n}","properties":[]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"src/types.ts","properties":[{"name":"flagKeys","type":"string[]"},{"name":"groupProperties","type":"Record<string, Record<string, any>>"},{"name":"onlyEvaluateLocally","type":"boolean"},{"name":"personProperties","type":"Record<string, any>"}]},{"id":"SentryIntegrationOptions","name":"SentryIntegrationOptions","path":"src/extensions/sentry-integration.ts","example":"{\n    organization?: string;\n    projectId?: number;\n    prefix?: string;\n    severityAllowList?: CoreErrorTracking.SeverityLevel[] | '*';\n    sendExceptionsToPostHog?: boolean;\n}","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"getLibraryId","path":"src/entrypoints/index.node.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"PostHog","path":"src/entrypoints/index.node.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog project API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"Configuration options for the client"}],"details":null,"category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// Basic initialization\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  { host: 'https://app.posthog.com' }\n)\n\n\n","name":"Basic initialization"},{"id":"with_personal_api_key","code":"\n\n// With personal API key\nconst client = new PostHogBackendClient(\n  'your-api-key',\n  {\n    host: 'https://app.posthog.com',\n    personalApiKey: 'your-personal-api-key'\n  }\n)\n\n\n\n","name":"With personal API key"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Initialize a new PostHog client instance."},{"id":"alias","path":"src/entrypoints/index.node.ts","title":"alias","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user","code":"\n\n// Link an anonymous user to an identified user\nclient.alias({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create an alias to link two distinct IDs together."},{"id":"aliasImmediate","path":"src/entrypoints/index.node.ts","title":"aliasImmediate","params":[{"name":"data","type":"{\n        distinctId: string;\n        alias: string;\n        disableGeoip?: boolean;\n    }","isOptional":false,"description":"The alias data containing distinctId and alias"}],"details":null,"category":"Identification","examples":[{"id":"link_an_anonymous_user_to_an_identified_user_immediately","code":"\n\n// Link an anonymous user to an identified user immediately\nawait client.aliasImmediate({\n  distinctId: 'anonymous_123',\n  alias: 'user_456'\n})\n\n\n\n","name":"Link an anonymous user to an identified user immediately"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Create an alias to link two distinct IDs together immediately (synchronously)."},{"id":"capture","path":"src/entrypoints/index.node.ts","title":"capture","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_capture","code":"\n\n// Basic capture\nclient.capture({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n\n","name":"Basic capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an event manually."},{"id":"captureException","path":"src/entrypoints/index.node.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_with_user_id","code":"\n\n// Capture an error with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  client.captureException(error, 'user_123')\n}\n\n\n","name":"Capture an error with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  client.captureException(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture an error exception as an event."},{"id":"captureExceptionImmediate","path":"src/entrypoints/index.node.ts","title":"captureExceptionImmediate","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"distinctId","type":"string","isOptional":true,"description":"Optional user distinct ID"},{"name":"additionalProperties","type":"Record<string | number, any>","isOptional":true,"description":"Optional additional properties to include"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_an_error_immediately_with_user_id","code":"\n\n// Capture an error immediately with user ID\ntry {\n  // Some risky operation\n  riskyOperation()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123')\n}\n\n\n","name":"Capture an error immediately with user ID"},{"id":"capture_with_additional_properties","code":"\n\n// Capture with additional properties\ntry {\n  apiCall()\n} catch (error) {\n  await client.captureExceptionImmediate(error, 'user_123', {\n    endpoint: '/api/users',\n    method: 'POST',\n    status_code: 500\n  })\n}\n\n\n\n","name":"Capture with additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an error exception as an event immediately (synchronously)."},{"id":"captureImmediate","path":"src/entrypoints/index.node.ts","title":"captureImmediate","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":"The event properties"}],"details":null,"category":"Capture","examples":[{"id":"basic_immediate_capture","code":"\n\n// Basic immediate capture\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'button_clicked',\n  properties: { button_color: 'red' }\n})\n\n\n","name":"Basic immediate capture"},{"id":"with_feature_flags","code":"\n\n// With feature flags\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: true\n})\n\n\n","name":"With feature flags"},{"id":"with_custom_feature_flags_options","code":"\n\n// With custom feature flags options\nawait client.captureImmediate({\n  distinctId: 'user_123',\n  event: 'user_action',\n  sendFeatureFlags: {\n    onlyEvaluateLocally: true,\n    personProperties: { plan: 'premium' },\n    groupProperties: { org: { tier: 'enterprise' } }\n    flagKeys: ['flag1', 'flag2']\n  }\n})\n\n\n\n","name":"With custom feature flags options"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Capture an event immediately (synchronously)."},{"id":"debug","path":"src/entrypoints/index.node.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":"Whether to enable debug logging"}],"details":null,"category":"Initialization","examples":[{"id":"enable_debug_logging","code":"\n\n// Enable debug logging\nclient.debug(true)\n\n\n","name":"Enable debug logging"},{"id":"disable_debug_logging","code":"\n\n// Disable debug logging\nclient.debug(false)\n\n\n\n","name":"Disable debug logging"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enable or disable debug logging."},{"id":"disable","path":"src/entrypoints/index.node.ts","title":"disable","params":[],"details":null,"category":"Privacy","examples":[{"id":"disable_client","code":"\n\n// Disable client\nawait client.disable()\n// Client is now disabled and will not capture events\n\n\n\n","name":"Disable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Disable the PostHog client (opt-out)."},{"id":"enable","path":"src/entrypoints/index.node.ts","title":"enable","params":[],"details":null,"category":"Privacy","examples":[{"id":"enable_client","code":"\n\n// Enable client\nawait client.enable()\n// Client is now enabled and will capture events\n\n\n\n","name":"Enable client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Enable the PostHog client (opt-in)."},{"id":"getAllFlags","path":"src/entrypoints/index.node.ts","title":"getAllFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_for_a_user","code":"\n\n// Get all flags for a user\nconst allFlags = await client.getAllFlags('user_123')\nconsole.log('User flags:', allFlags)\n// Output: { 'flag-1': 'variant-a', 'flag-2': false, 'flag-3': 'variant-b' }\n\n\n","name":"Get all flags for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst specificFlags = await client.getAllFlags('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst orgFlags = await client.getAllFlags('user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, FeatureFlagValue>>","name":"Promise<Record<string, FeatureFlagValue>>"},"description":"Get all feature flag values for a specific user."},{"id":"getAllFlagsAndPayloads","path":"src/entrypoints/index.node.ts","title":"getAllFlagsAndPayloads","params":[{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        disableGeoip?: boolean;\n        flagKeys?: string[];\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_all_flags_and_payloads_for_a_user","code":"\n\n// Get all flags and payloads for a user\nconst result = await client.getAllFlagsAndPayloads('user_123')\nconsole.log('Flags:', result.featureFlags)\nconsole.log('Payloads:', result.featureFlagPayloads)\n\n\n","name":"Get all flags and payloads for a user"},{"id":"with_specific_flag_keys","code":"\n\n// With specific flag keys\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  flagKeys: ['flag-1', 'flag-2']\n})\n\n\n","name":"With specific flag keys"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst result = await client.getAllFlagsAndPayloads('user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsAndPayloadsResponse>","name":"Promise<PostHogFlagsAndPayloadsResponse>"},"description":"Get all feature flag values and payloads for a specific user."},{"id":"getCustomUserAgent","path":"src/entrypoints/index.node.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"Identification","examples":[{"id":"get_user_agent","code":"\n\n// Get user agent\nconst userAgent = client.getCustomUserAgent()\n// Returns: \"posthog-node/5.7.0\"\n\n\n\n","name":"Get user agent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the custom user agent string for this client."},{"id":"getFeatureFlag","path":"src/entrypoints/index.node.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst flagValue = await client.getFeatureFlag('new-feature', 'user_123')\nif (flagValue === 'variant-a') {\n  // Show variant A\n} else if (flagValue === 'variant-b') {\n  // Show variant B\n} else {\n  // Flag is disabled or not found\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst flagValue = await client.getFeatureFlag('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' },\n  groupProperties: { organization: { tier: 'premium' } }\n})\n\n\n","name":"With groups and properties"},{"id":"only_evaluate_locally","code":"\n\n// Only evaluate locally\nconst flagValue = await client.getFeatureFlag('local-flag', 'user_123', {\n  onlyEvaluateLocally: true\n})\n\n\n\n","name":"Only evaluate locally"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<FeatureFlagValue | undefined>","name":"Promise<FeatureFlagValue | undefined>"},"description":"Get the value of a feature flag for a specific user."},{"id":"getFeatureFlagPayload","path":"src/entrypoints/index.node.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"matchValue","type":"FeatureFlagValue","isOptional":true,"description":"Optional match value to get payload for"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"get_payload_for_a_feature_flag","code":"\n\n// Get payload for a feature flag\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123')\nif (payload) {\n  console.log('Flag payload:', payload)\n}\n\n\n","name":"Get payload for a feature flag"},{"id":"get_payload_with_specific_match_value","code":"\n\n// Get payload with specific match value\nconst payload = await client.getFeatureFlagPayload('flag-key', 'user_123', 'variant-a')\n\n\n","name":"Get payload with specific match value"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst payload = await client.getFeatureFlagPayload('org-flag', 'user_123', undefined, {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the payload for a feature flag."},{"id":"getLibraryVersion","path":"src/entrypoints/index.node.ts","title":"getLibraryVersion","params":[],"details":null,"category":"Initialization","examples":[{"id":"get_version","code":"\n\n// Get version\nconst version = client.getLibraryVersion()\nconsole.log(`Using PostHog SDK version: ${version}`)\n\n\n\n","name":"Get version"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Get the library version from package.json."},{"id":"getPersistedProperty","path":"src/entrypoints/index.node.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to retrieve"}],"details":null,"category":"Initialization","examples":[{"id":"get_user_id","code":"\n\n// Get user ID\nconst userId = client.getPersistedProperty('userId')\n\n\n","name":"Get user ID"},{"id":"get_session_id","code":"\n\n// Get session ID\nconst sessionId = client.getPersistedProperty('sessionId')\n\n\n\n","name":"Get session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any | undefined","name":"any | undefined"},"description":"Get a persisted property value from memory storage."},{"id":"getRemoteConfigPayload","path":"src/entrypoints/index.node.ts","title":"getRemoteConfigPayload","params":[{"name":"flagKey","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_remote_config_payload","code":"\n\n// Get remote config payload\nconst payload = await client.getRemoteConfigPayload('flag-key')\nif (payload) {\n  console.log('Remote config payload:', payload)\n}\n\n\n\n\n","name":"Get remote config payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"},"description":"Get the remote config payload for a feature flag."},{"id":"groupIdentify","path":"src/entrypoints/index.node.ts","title":"groupIdentify","params":[{"name":"{ groupType, groupKey, properties, distinctId, disableGeoip }","type":"GroupIdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"create_a_company_group","code":"\n\n// Create a company group\nclient.groupIdentify({\n  groupType: 'company',\n  groupKey: 'acme-corp',\n  properties: {\n    name: 'Acme Corporation',\n    industry: 'Technology',\n    employee_count: 500\n  },\n  distinctId: 'user_123'\n})\n\n\n","name":"Create a company group"},{"id":"update_organization_properties","code":"\n\n// Update organization properties\nclient.groupIdentify({\n  groupType: 'organization',\n  groupKey: 'org-456',\n  properties: {\n    plan: 'enterprise',\n    region: 'US-West'\n  }\n})\n\n\n\n","name":"Update organization properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Create or update a group and its properties."},{"id":"identify","path":"src/entrypoints/index.node.ts","title":"identify","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_identify_with_properties","code":"\n\n// Basic identify with properties\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com',\n    plan: 'premium'\n  }\n})\n\n\n","name":"Basic identify with properties"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nclient.identify({\n  distinctId: 'user_123',\n  properties: {\n    $set: { name: 'John Doe', email: 'john@example.com' },\n    $set_once: { first_login: new Date().toISOString() }\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Identify a user and set their properties."},{"id":"identifyImmediate","path":"src/entrypoints/index.node.ts","title":"identifyImmediate","params":[{"name":"{ distinctId, properties, disableGeoip }","type":"IdentifyMessage","isOptional":false,"description":""}],"details":null,"category":"Identification","examples":[{"id":"basic_immediate_identify","code":"\n\n// Basic immediate identify\nawait client.identifyImmediate({\n  distinctId: 'user_123',\n  properties: {\n    name: 'John Doe',\n    email: 'john@example.com'\n  }\n})\n\n\n\n","name":"Basic immediate identify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Identify a user and set their properties immediately (synchronously)."},{"id":"isFeatureEnabled","path":"src/entrypoints/index.node.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"},{"name":"distinctId","type":"string","isOptional":false,"description":"The user's distinct ID"},{"name":"options","type":"{\n        groups?: Record<string, string>;\n        personProperties?: Record<string, string>;\n        groupProperties?: Record<string, Record<string, string>>;\n        onlyEvaluateLocally?: boolean;\n        sendFeatureFlagEvents?: boolean;\n        disableGeoip?: boolean;\n    }","isOptional":true,"description":"Optional configuration for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"basic_feature_flag_check","code":"\n\n// Basic feature flag check\nconst isEnabled = await client.isFeatureEnabled('new-feature', 'user_123')\nif (isEnabled) {\n  // Feature is enabled\n  console.log('New feature is active')\n} else {\n  // Feature is disabled\n  console.log('New feature is not active')\n}\n\n\n","name":"Basic feature flag check"},{"id":"with_groups_and_properties","code":"\n\n// With groups and properties\nconst isEnabled = await client.isFeatureEnabled('org-feature', 'user_123', {\n  groups: { organization: 'acme-corp' },\n  personProperties: { plan: 'enterprise' }\n})\n\n\n\n","name":"With groups and properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean | undefined>","name":"Promise<boolean | undefined>"},"description":"Check if a feature flag is enabled for a specific user."},{"id":"isLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"isLocalEvaluationReady","params":[],"details":null,"category":"Feature flags","examples":[{"id":"check_if_ready","code":"\n\n// Check if ready\nif (client.isLocalEvaluationReady()) {\n  // Local evaluation is ready, can evaluate flags locally\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n} else {\n  // Local evaluation not ready, will use remote evaluation\n  const flag = await client.getFeatureFlag('flag-key', 'user_123')\n}\n\n\n\n","name":"Check if ready"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Check if local evaluation of feature flags is ready."},{"id":"prepareEventMessage","path":"src/entrypoints/index.node.ts","title":"prepareEventMessage","params":[{"name":"props","type":"EventMessage","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"prepareeventmessage","code":"// Generated example for prepareEventMessage\nposthog.prepareEventMessage();","name":"Generated example for prepareEventMessage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>","name":"Promise<{\n        distinctId: string;\n        event: string;\n        properties: PostHogEventProperties;\n        options: PostHogCaptureOptions;\n    }>"}},{"id":"reloadFeatureFlags","path":"src/entrypoints/index.node.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"force_reload_of_feature_flags","code":"\n\n// Force reload of feature flags\nawait client.reloadFeatureFlags()\nconsole.log('Feature flags reloaded')\n\n\n","name":"Force reload of feature flags"},{"id":"reload_before_checking_a_specific_flag","code":"\n\n// Reload before checking a specific flag\nawait client.reloadFeatureFlags()\nconst flag = await client.getFeatureFlag('flag-key', 'user_123')\n\n\n\n","name":"Reload before checking a specific flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Reload feature flag definitions from the server for local evaluation."},{"id":"setPersistedProperty","path":"src/entrypoints/index.node.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":"The property key to set"},{"name":"value","type":"any | null","isOptional":false,"description":"The value to store (null to remove)"}],"details":null,"category":"Initialization","examples":[{"id":"set_user_id","code":"\n\n// Set user ID\nclient.setPersistedProperty('userId', 'user_123')\n\n\n","name":"Set user ID"},{"id":"set_session_id","code":"\n\n// Set session ID\nclient.setPersistedProperty('sessionId', 'session_456')\n\n\n\n","name":"Set session ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Set a persisted property value in memory storage."},{"id":"waitForLocalEvaluationReady","path":"src/entrypoints/index.node.ts","title":"waitForLocalEvaluationReady","params":[{"name":"timeoutMs","type":"number","isOptional":true,"description":"Timeout in milliseconds (default: 30000)"}],"details":null,"category":"Feature flags","examples":[{"id":"wait_for_local_evaluation","code":"\n\n// Wait for local evaluation\nconst isReady = await client.waitForLocalEvaluationReady()\nif (isReady) {\n  console.log('Local evaluation is ready')\n} else {\n  console.log('Local evaluation timed out')\n}\n\n\n","name":"Wait for local evaluation"},{"id":"wait_with_custom_timeout","code":"\n\n// Wait with custom timeout\nconst isReady = await client.waitForLocalEvaluationReady(10000) // 10 seconds\n\n\n\n","name":"Wait with custom timeout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<boolean>","name":"Promise<boolean>"},"description":"Wait for local evaluation of feature flags to be ready."}]}],"version":"5.9.1","categories":["Initialization","Identification","Capture","Error tracking","Privacy","Feature flags"],"referenceId":"posthog-node"},"createdAt":"2025-10-25T22:45:02.109Z","updatedAt":"2025-10-25T22:45:02.109Z","publishedAt":"2025-10-25T22:45:02.106Z"}},{"id":252,"attributes":{"referenceId":"posthog-js","version":"1.354.1","data":{"id":"posthog-js-1.354.1","info":{"id":"posthog-js","title":"PostHog JavaScript Web SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"1.354.1","slugPrefix":"posthog-js","description":"Posthog-js allows you to automatically capture usage and send events to PostHog."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"lib/src/posthog-surveys-types.d.ts","example":"\"contains\" | \"exact\" | \"regex\"","properties":[]},{"id":"ActionStepType","name":"ActionStepType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"event","type":"string | null"},{"name":"href_matching","type":"ActionStepStringMatching | null","description":"ActionStepStringMatching.Exact"},{"name":"href","type":"string | null"},{"name":"properties","type":"{\n        key: string;\n        value?: string | number | boolean | (string | number | boolean)[] | null;\n        operator?: PropertyMatchType;\n        type?: string;\n    }[]","description":"Property filters for action step matching"},{"name":"selector_regex","type":"string | null","description":"pre-compiled regex pattern for matching selector against $elements_chain"},{"name":"selector","type":"string | null"},{"name":"tag_name","type":"string","description":""},{"name":"text_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Exact"},{"name":"text","type":"string | null"},{"name":"url_matching","type":"ActionStepStringMatching | null","description":"StringMatching.Contains"},{"name":"url","type":"string | null"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"type","type":"SurveyQuestionType.Open"}]},{"id":"Breaker","name":"Breaker","path":"lib/src/types.d.ts","example":"{}","properties":[]},{"id":"Compression","name":"Compression","path":"lib/src/types.d.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"ConversationsRemoteConfig","name":"ConversationsRemoteConfig","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"collectName","type":"boolean","description":"Whether to show the name field in the identification form   true (when requireEmail is true)"},{"name":"color","type":"string","description":"Primary color for the widget UI"},{"name":"domains","type":"string[]","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."},{"name":"enabled","type":"boolean","description":"Whether conversations are enabled for this team When true, the conversations API is available (posthog.conversations.*)"},{"name":"greetingText","type":"string","description":"Greeting text to show when widget is first opened"},{"name":"identificationFormDescription","type":"string","description":"Description for the identification form   \"Please provide your details so we can help you better.\""},{"name":"identificationFormTitle","type":"string","description":"Title for the identification form   \"Before we start...\""},{"name":"placeholderText","type":"string","description":"Placeholder text for the message input"},{"name":"requireEmail","type":"boolean","description":"Whether to require email before starting a conversation   false"},{"name":"token","type":"string","description":"Public token for authenticating conversations API requests This token is team-scoped and meant to be embedded in client code"},{"name":"widgetEnabled","type":"boolean","description":"Whether the widget UI (button + chat panel) should be shown Only takes effect when enabled is true   false"},{"name":"widgetPosition","type":"WidgetPosition","description":"Position of the widget on the screen   'bottom_right'"}]},{"id":"ConversationsTraits","name":"ConversationsTraits","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"email","type":"string | null"},{"name":"name","type":"string | null"}]},{"id":"ConversationsWidgetState","name":"ConversationsWidgetState","path":"lib/src/posthog-conversations-types.d.ts","example":"\"open\" | \"closed\"","properties":[]},{"id":"DisplaySurveyOptions","name":"DisplaySurveyOptions","path":"lib/src/posthog-surveys-types.d.ts","example":"DisplaySurveyPopoverOptions | DisplaySurveyInlineOptions","properties":[]},{"id":"DisplaySurveyPopoverOptions","name":"DisplaySurveyPopoverOptions","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"displayType","type":"DisplaySurveyType.Popover"},{"name":"position","type":"SurveyPosition","description":"Override the survey's configured position"},{"name":"selector","type":"string","description":"CSS selector for the element to position the survey next to (when position is NextToTrigger)"},{"name":"skipShownEvent","type":"boolean","description":"When true, `survey shown` events will not be emitted automatically"}]},{"id":"DisplaySurveyType","name":"DisplaySurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Inline","type":"\"inline\""},{"name":"Popover","type":"\"popover\""}]},{"id":"ErrorEventArgs","name":"ErrorEventArgs","path":"lib/src/types.d.ts","example":"[\n    event: string | Event, source?: string | undefined, lineno?: number | undefined, colno?: number | undefined, error?: Error | undefined\n]","properties":[]},{"id":"ErrorTrackingSuppressionRule","name":"ErrorTrackingSuppressionRule","path":"lib/src/types.d.ts","properties":[{"name":"type","type":"'AND' | 'OR'"},{"name":"values","type":"ErrorTrackingSuppressionRuleValue[]"}]},{"id":"ErrorTrackingSuppressionRuleValue","name":"ErrorTrackingSuppressionRuleValue","path":"lib/src/types.d.ts","properties":[{"name":"key","type":"'$exception_types' | '$exception_values'"},{"name":"operator","type":"PropertyMatchType"},{"name":"type","type":"string"},{"name":"value","type":"string | string[]"}]},{"id":"EventHandler","name":"EventHandler","path":"lib/src/types.d.ts","example":"(event: Event) => boolean | void","properties":[]},{"id":"FlagsResponse","name":"FlagsResponse","path":"lib/src/types.d.ts","properties":[{"name":"errorsWhileComputingFlags","type":"boolean"},{"name":"evaluatedAt","type":"number"},{"name":"featureFlagPayloads","type":"Record<string, JsonType>"},{"name":"featureFlags","type":"Record<string, string | boolean>"},{"name":"flags","type":"Record<string, FeatureFlagDetail>"},{"name":"requestId","type":"string"}]},{"id":"FlagVariant","name":"FlagVariant","path":"lib/src/types.d.ts","example":"{\n    flag: string;\n    variant: string;\n}","properties":[]},{"id":"GetMessagesResponse","name":"GetMessagesResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"has_more","type":"boolean","description":"Whether there are more messages to fetch"},{"name":"messages","type":"Message[]","description":"Array of messages"},{"name":"ticket_id","type":"string","description":"ID of the ticket"},{"name":"ticket_status","type":"TicketStatus","description":"Current status of the ticket"},{"name":"unread_count","type":"number","description":"Number of unread messages from the team"}]},{"id":"GetTicketsOptions","name":"GetTicketsOptions","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"limit","type":"number","description":"Number of tickets to return (default: 20)"},{"name":"offset","type":"number","description":"Pagination offset (default: 0)"},{"name":"status","type":"string","description":"Filter by ticket status (e.g., 'open', 'closed')"}]},{"id":"GetTicketsResponse","name":"GetTicketsResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"count","type":"number","description":"Total count of tickets"},{"name":"results","type":"Ticket[]","description":"Array of tickets"}]},{"id":"JSONContent","name":"JSONContent","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"attrs","type":"Record<string, any>"},{"name":"content","type":"JSONContent[]"},{"name":"marks","type":"{\n        type: string;\n        attrs?: Record<string, any>;\n    }[]"},{"name":"text","type":"string"},{"name":"type","type":"string"}]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"link","type":"string | null"},{"name":"type","type":"SurveyQuestionType.Link"}]},{"id":"MarkAsReadResponse","name":"MarkAsReadResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"success","type":"boolean","description":"Whether the operation was successful"},{"name":"unread_count","type":"number","description":"Number of unread messages (should be 0 after marking as read)"}]},{"id":"Message","name":"Message","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"author_name","type":"string","description":"Display name of the message author"},{"name":"author_type","type":"MessageAuthorType","description":"Type of the message author"},{"name":"content","type":"string","description":"The message content as plain text (fallback)"},{"name":"created_at","type":"string","description":"ISO timestamp when the message was created"},{"name":"id","type":"string","description":"Unique identifier for the message"},{"name":"is_private","type":"boolean","description":"Whether this is an internal note (not shown to customer)"},{"name":"rich_content","type":"TipTapDoc","description":"Rich content in TipTap JSON format (preferred for rendering) Falls back to `content` if missing or invalid"}]},{"id":"MessageAuthorType","name":"MessageAuthorType","path":"lib/src/posthog-conversations-types.d.ts","example":"\"customer\" | \"AI\" | \"human\"","properties":[]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"choices","type":"string[]"},{"name":"hasOpenChoice","type":"boolean"},{"name":"shuffleOptions","type":"boolean"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice"}]},{"id":"NetworkRecordOptions","name":"NetworkRecordOptions","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}","properties":[]},{"id":"OverrideConfig","name":"OverrideConfig","path":"lib/src/types.d.ts","example":"{\n    sampling: boolean;\n    linked_flag: boolean;\n    url_trigger: boolean;\n    event_trigger: boolean;\n}","properties":[]},{"id":"PersistentStore","name":"PersistentStore","path":"lib/src/types.d.ts","properties":[{"name":"_error","type":"(error: any) => void"},{"name":"_get","type":"(name: string) => any"},{"name":"_is_supported","type":"() => boolean"},{"name":"_parse","type":"(name: string) => any"},{"name":"_remove","type":"(name: string, cross_subdomain?: boolean) => void"},{"name":"_set","type":"(name: string, value: any, expire_days?: number | null, cross_subdomain?: boolean, secure?: boolean, debug?: boolean) => void"}]},{"id":"PostHogConfig","name":"PostHogConfig","path":"lib/src/types.d.ts","example":"Omit<BasePostHogConfig, 'loaded'> & {\n    loaded: (posthog: PostHogInterface) => void;\n    __extensionClasses?: {\n        historyAutocapture?: Extension<HistoryAutocapture>;\n        tracingHeaders?: Extension<TracingHeaders>;\n        siteApps?: Extension<SiteApps>;\n        sessionRecording?: Extension<SessionRecording>;\n        autocapture?: Extension<Autocapture>;\n        productTours?: Extension<PostHogProductTours>;\n        heatmaps?: Extension<Heatmaps>;\n        webVitalsAutocapture?: Extension<WebVitalsAutocapture>;\n        exceptionObserver?: Extension<ExceptionObserver>;\n        deadClicksAutocapture?: Extension<DeadClicksAutocapture>;\n    };\n}","properties":[]},{"id":"PostHogInterface","name":"PostHogInterface","path":"lib/src/types.d.ts","example":"\"config\" | \"init\"","properties":[]},{"id":"ProductTour","name":"ProductTour","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"appearance","type":"ProductTourAppearance"},{"name":"auto_launch","type":"boolean"},{"name":"conditions","type":"ProductTourConditions"},{"name":"current_iteration","type":"number"},{"name":"description","type":"string"},{"name":"disable_image_preload","type":"boolean"},{"name":"display_frequency","type":"ProductTourDisplayFrequency"},{"name":"end_date","type":"string | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string"},{"name":"linked_flag_key","type":"string"},{"name":"name","type":"string"},{"name":"start_date","type":"string | null"},{"name":"steps","type":"ProductTourStep[]"},{"name":"type","type":"'product_tour'"}]},{"id":"ProductTourAppearance","name":"ProductTourAppearance","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"backgroundColor","type":"string"},{"name":"borderColor","type":"string"},{"name":"borderRadius","type":"number"},{"name":"boxShadow","type":"string"},{"name":"buttonBorderRadius","type":"number"},{"name":"buttonColor","type":"string"},{"name":"dismissOnClickOutside","type":"boolean","description":"defaults to true, auto-set to false for announcements/banners"},{"name":"fontFamily","type":"string"},{"name":"showOverlay","type":"boolean"},{"name":"textColor","type":"string"},{"name":"whiteLabel","type":"boolean"},{"name":"zIndex","type":"number"}]},{"id":"ProductTourBannerConfig","name":"ProductTourBannerConfig","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"action","type":"{\n        type: 'none' | 'link' | 'trigger_tour';\n        link?: string;\n        tourId?: string;\n    }"},{"name":"animation","type":"{\n        duration?: number;\n    }"},{"name":"behavior","type":"'sticky' | 'static' | 'custom'"},{"name":"selector","type":"string"}]},{"id":"ProductTourButtonAction","name":"ProductTourButtonAction","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"dismiss\" | \"link\" | \"next_step\" | \"previous_step\" | \"trigger_tour\"","properties":[]},{"id":"ProductTourCallback","name":"ProductTourCallback","path":"lib/src/posthog-product-tours-types.d.ts","example":"(tours: ProductTour[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"ProductTourConditions","name":"ProductTourConditions","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"actions","type":"{\n        values: SurveyActionType[];\n    } | null"},{"name":"autoShowDelaySeconds","type":"number"},{"name":"cancelEvents","type":"{\n        values: SurveyEventWithFilters[];\n    } | null"},{"name":"events","type":"{\n        values: SurveyEventWithFilters[];\n    } | null"},{"name":"linkedFlagVariant","type":"string"},{"name":"selector","type":"string"},{"name":"url","type":"string"},{"name":"urlMatchType","type":"PropertyMatchType"}]},{"id":"ProductTourDismissReason","name":"ProductTourDismissReason","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"user_clicked_skip\" | \"user_clicked_outside\" | \"escape_key\" | \"element_unavailable\" | \"container_unavailable\"","properties":[]},{"id":"ProductTourDisplayFrequency","name":"ProductTourDisplayFrequency","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"show_once\" | \"until_interacted\" | \"always\"","properties":[]},{"id":"ProductTourEventName","name":"ProductTourEventName","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"BANNER_ACTION_CLICKED","type":"\"product tour banner action clicked\""},{"name":"BANNER_CONTAINER_SELECTOR_FAILED","type":"\"product tour banner container selector failed\""},{"name":"BUTTON_CLICKED","type":"\"product tour button clicked\""},{"name":"COMPLETED","type":"\"product tour completed\""},{"name":"DISMISSED","type":"\"product tour dismissed\""},{"name":"SHOWN","type":"\"product tour shown\""},{"name":"STEP_COMPLETED","type":"\"product tour step completed\""},{"name":"STEP_SELECTOR_FAILED","type":"\"product tour step selector failed\""},{"name":"STEP_SHOWN","type":"\"product tour step shown\""}]},{"id":"ProductTourEventProperties","name":"ProductTourEventProperties","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"INFERENCE_DATA_PRESENT","type":"\"$inference_data_present\""},{"name":"TOUR_BANNER_SELECTOR","type":"\"$product_tour_banner_selector\""},{"name":"TOUR_BUTTON_ACTION","type":"\"$product_tour_button_action\""},{"name":"TOUR_BUTTON_LINK","type":"\"$product_tour_button_link\""},{"name":"TOUR_BUTTON_TEXT","type":"\"$product_tour_button_text\""},{"name":"TOUR_BUTTON_TOUR_ID","type":"\"$product_tour_button_tour_id\""},{"name":"TOUR_DISMISS_REASON","type":"\"$product_tour_dismiss_reason\""},{"name":"TOUR_ERROR","type":"\"$product_tour_error\""},{"name":"TOUR_FAILURE_PHASE","type":"\"$product_tour_failure_phase\""},{"name":"TOUR_ID","type":"\"$product_tour_id\""},{"name":"TOUR_ITERATION","type":"\"$product_tour_iteration\""},{"name":"TOUR_LINKED_SURVEY_ID","type":"\"$product_tour_linked_survey_id\""},{"name":"TOUR_MATCHES_COUNT","type":"\"$product_tour_matches_count\""},{"name":"TOUR_NAME","type":"\"$product_tour_name\""},{"name":"TOUR_RENDER_REASON","type":"\"$product_tour_render_reason\""},{"name":"TOUR_STEP_ELEMENT_CLASSES","type":"\"$product_tour_step_element_classes\""},{"name":"TOUR_STEP_ELEMENT_ID","type":"\"$product_tour_step_element_id\""},{"name":"TOUR_STEP_ELEMENT_TAG","type":"\"$product_tour_step_element_tag\""},{"name":"TOUR_STEP_ELEMENT_TEXT","type":"\"$product_tour_step_element_text\""},{"name":"TOUR_STEP_ID","type":"\"$product_tour_step_id\""},{"name":"TOUR_STEP_ORDER","type":"\"$product_tour_step_order\""},{"name":"TOUR_STEP_SELECTOR","type":"\"$product_tour_step_selector\""},{"name":"TOUR_STEP_SELECTOR_FOUND","type":"\"$product_tour_step_selector_found\""},{"name":"TOUR_STEP_TYPE","type":"\"$product_tour_step_type\""},{"name":"TOUR_STEPS_COUNT","type":"\"$product_tour_steps_count\""},{"name":"TOUR_WAIT_DURATION_MS","type":"\"$product_tour_wait_duration_ms\""},{"name":"TOUR_WAITED_FOR_ELEMENT","type":"\"$product_tour_waited_for_element\""},{"name":"USE_MANUAL_SELECTOR","type":"\"$use_manual_selector\""}]},{"id":"ProductTourRenderReason","name":"ProductTourRenderReason","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"auto\" | \"api\" | \"trigger\" | \"event\"","properties":[]},{"id":"ProductTourSelectorError","name":"ProductTourSelectorError","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"not_found\" | \"multiple_matches\" | \"not_visible\"","properties":[]},{"id":"ProductTourStep","name":"ProductTourStep","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"bannerConfig","type":"ProductTourBannerConfig","description":"Banner configuration (only for banner steps)"},{"name":"buttons","type":"ProductTourStepButtons","description":"Button configuration for modal steps"},{"name":"content","type":"JSONContent | null"},{"name":"contentHtml","type":"string","description":"Pre-rendered HTML content from the editor. If present, SDK should use this instead of rendering from JSONContent."},{"name":"id","type":"string"},{"name":"inferenceData","type":"InferredSelector","description":"Enhanced element data for more reliable lookup at runtime"},{"name":"linkedSurveyId","type":"string","description":"ID of the auto-created survey for this step (set by backend)"},{"name":"linkedSurveyQuestionId","type":"string","description":"ID of the survey question (set by backend, used for event tracking)"},{"name":"maxWidth","type":"number","description":"Maximum tooltip width in pixels (defaults to 320px)"},{"name":"modalPosition","type":"SurveyPosition","description":"Position for modal/survey steps (defaults to middle_center)"},{"name":"progressionTrigger","type":"'button' | 'click'"},{"name":"selector","type":"string"},{"name":"survey","type":"ProductTourSurveyQuestion","description":"Inline survey question config - if present, this is a survey step"},{"name":"translations","type":"Record<string, ProductTourStepTranslation>","description":"translation data for this tour step"},{"name":"type","type":"ProductTourStepType"},{"name":"useManualSelector","type":"boolean","description":"Use CSS selector instead of inference. Defaults to false (use inference)."}]},{"id":"ProductTourStepButton","name":"ProductTourStepButton","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"action","type":"ProductTourButtonAction"},{"name":"link","type":"string","description":"URL to open when action is 'link'"},{"name":"text","type":"string"},{"name":"tourId","type":"string","description":"Tour ID to trigger when action is 'trigger_tour'"}]},{"id":"ProductTourStepButtons","name":"ProductTourStepButtons","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"primary","type":"ProductTourStepButton"},{"name":"secondary","type":"ProductTourStepButton"}]},{"id":"ProductTourStepTranslation","name":"ProductTourStepTranslation","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"buttons","type":"{\n        primary?: Pick<ProductTourStepButton, 'text'>;\n        secondary?: Pick<ProductTourStepButton, 'text'>;\n    }"},{"name":"content","type":"ProductTourStep['content']"},{"name":"contentHtml","type":"ProductTourStep['contentHtml']"},{"name":"survey","type":"Pick<ProductTourSurveyQuestion, 'questionText' | 'lowerBoundLabel' | 'upperBoundLabel' | 'submitButtonText' | 'backButtonText'>"}]},{"id":"ProductTourStepType","name":"ProductTourStepType","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"element\" | \"modal\" | \"survey\" | \"banner\"","properties":[]},{"id":"ProductTourSurveyQuestion","name":"ProductTourSurveyQuestion","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"backButtonText","type":"string"},{"name":"display","type":"'emoji' | 'number'","description":"Rating display type - emoji or number"},{"name":"lowerBoundLabel","type":"string","description":"Label for low end of rating scale (e.g., \"Not likely\")"},{"name":"questionText","type":"string"},{"name":"scale","type":"3 | 5 | 10","description":"Rating scale - 3 or 5 for emoji, 5 or 10 for number"},{"name":"submitButtonText","type":"string"},{"name":"type","type":"ProductTourSurveyQuestionType"},{"name":"upperBoundLabel","type":"string","description":"Label for high end of rating scale (e.g., \"Very likely\")"}]},{"id":"ProductTourSurveyQuestionType","name":"ProductTourSurveyQuestionType","path":"lib/src/posthog-product-tours-types.d.ts","example":"\"open\" | \"rating\"","properties":[]},{"id":"PropertyFilters","name":"PropertyFilters","path":"lib/src/posthog-surveys-types.d.ts","example":"{\n    [propertyName: string]: {\n        values: string[];\n        operator: PropertyOperator;\n    };\n}","properties":[]},{"id":"PropertyMatchType","name":"PropertyMatchType","path":"lib/src/types.d.ts","example":"\"regex\" | \"not_regex\" | \"exact\" | \"is_not\" | \"icontains\" | \"not_icontains\"","properties":[]},{"id":"PropertyOperator","name":"PropertyOperator","path":"lib/src/posthog-surveys-types.d.ts","example":"\"gt\" | \"lt\"","properties":[]},{"id":"QueuedRequestWithOptions","name":"QueuedRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"batchKey","type":"string","description":"key of queue, e.g. 'sessionRecording' vs 'event'"}]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"display","type":"'number' | 'emoji'"},{"name":"lowerBoundLabel","type":"string"},{"name":"scale","type":"2 | 3 | 5 | 7 | 10"},{"name":"skipSubmitButton","type":"boolean"},{"name":"type","type":"SurveyQuestionType.Rating"},{"name":"upperBoundLabel","type":"string"}]},{"id":"RemoteConfig","name":"RemoteConfig","path":"lib/src/types.d.ts","properties":[{"name":"analytics","type":"{\n        endpoint?: string;\n    }","description":"Whether we should use a custom endpoint for analytics\nendpoint: \"/e\""},{"name":"autocapture_opt_out","type":"boolean","description":"If set, disables autocapture"},{"name":"autocaptureExceptions","type":"boolean | {\n        endpoint?: string;\n    }","description":"This is currently in development and may have breaking changes without a major version bump"},{"name":"captureDeadClicks","type":"boolean","description":"Whether to capture dead clicks"},{"name":"capturePerformance","type":"boolean | PerformanceCaptureConfig","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"},{"name":"conversations","type":"boolean | ConversationsRemoteConfig","description":"Conversations widget configuration"},{"name":"defaultIdentifiedOnly","type":"boolean","description":"Whether to only capture identified users by default"},{"name":"editorParams","type":"ToolbarParams","description":""},{"name":"elementsChainAsString","type":"boolean","description":"Whether the `$elements_chain` property should be sent as a string or as an array\nfalse"},{"name":"errorTracking","type":"{\n        autocaptureExceptions?: boolean;\n        captureExtensionExceptions?: boolean;\n        suppressionRules?: ErrorTrackingSuppressionRule[];\n    }","description":"Error tracking configuration options"},{"name":"hasFeatureFlags","type":"boolean","description":"Indicates if the team has any flags enabled (if not we don't need to load them)"},{"name":"heatmaps","type":"boolean","description":"Whether heatmaps are enabled"},{"name":"isAuthenticated","type":"boolean","description":"Whether the user is authenticated"},{"name":"logs","type":"{\n        captureConsoleLogs?: boolean;\n    }","description":"Whether capturing logs to the logs product is enabled"},{"name":"productTours","type":"boolean","description":"Whether product tours are enabled"},{"name":"sessionRecording","type":"SessionRecordingRemoteConfig | false","description":"Session recording configuration options"},{"name":"siteApps","type":"{\n        id: string;\n        url: string;\n    }[]","description":"List of site apps with their IDs and URLs"},{"name":"supportedCompression","type":"Compression[]","description":"Supported compression algorithms"},{"name":"surveys","type":"boolean | Survey[]","description":"Whether surveys are enabled"},{"name":"toolbarParams","type":"ToolbarParams","description":"Parameters for the toolbar"},{"name":"toolbarVersion","type":"'toolbar'","description":"deprecated, moved to toolbarParams"}]},{"id":"RequestRestoreLinkPayload","name":"RequestRestoreLinkPayload","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"email","type":"string"},{"name":"request_url","type":"string"}]},{"id":"RequestRestoreLinkResponse","name":"RequestRestoreLinkResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"ok","type":"true"}]},{"id":"RequestWithOptions","name":"RequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"callback","type":"(response: RequestResponse) => void"},{"name":"compression","type":"Compression | 'best-available'"},{"name":"data","type":"Record<string, any> | Record<string, any>[]"},{"name":"disableTransport","type":"('XHR' | 'fetch' | 'sendBeacon')[]"},{"name":"disableXHRCredentials","type":"boolean"},{"name":"fetchOptions","type":"{\n        cache?: RequestInit['cache'];\n        next?: NextOptions;\n    }"},{"name":"headers","type":"Record<string, any>"},{"name":"method","type":"'POST' | 'GET'"},{"name":"noRetries","type":"boolean"},{"name":"timeout","type":"number"},{"name":"transport","type":"'XHR' | 'fetch' | 'sendBeacon'"},{"name":"url","type":"string"},{"name":"urlQueryArgs","type":"{\n        compression: Compression;\n    }"}]},{"id":"RestoreFromTokenPayload","name":"RestoreFromTokenPayload","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"current_url","type":"string","description":"Optional current URL for backend observability"},{"name":"distinct_id","type":"string","description":"Optional distinct ID for debugging/observability"},{"name":"restore_token","type":"string","description":"Opaque one-time restore token from email link"},{"name":"widget_session_id","type":"string","description":"Current browser widget session ID requesting restore"}]},{"id":"RestoreFromTokenResponse","name":"RestoreFromTokenResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"code","type":"string","description":"Optional machine-readable backend code"},{"name":"migrated_ticket_ids","type":"string[]","description":"Migrated ticket IDs, if any"},{"name":"status","type":"RestoreFromTokenStatus","description":"Restore result"},{"name":"widget_session_id","type":"string","description":"Canonical widget session ID to use after restore"}]},{"id":"RestoreFromTokenStatus","name":"RestoreFromTokenStatus","path":"lib/src/posthog-conversations-types.d.ts","example":"\"success\" | \"expired\" | \"invalid\" | \"used\"","properties":[]},{"id":"RetriableRequestWithOptions","name":"RetriableRequestWithOptions","path":"lib/src/types.d.ts","properties":[{"name":"retriesPerformedSoFar","type":"number"}]},{"id":"SendMessagePayload","name":"SendMessagePayload","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"distinct_id","type":"string","description":"Distinct ID for linking to PostHog Person"},{"name":"message","type":"string","description":"The message content to send"},{"name":"session_context","type":"SessionContext","description":"Session context captured when creating a new ticket Stored in a JSONField for flexibility"},{"name":"session_id","type":"string","description":"Session ID captured when creating a new ticket Stored as a separate queryable DB field"},{"name":"ticket_id","type":"string | null","description":"Ticket ID to send the message to (null to create a new ticket)"},{"name":"traits","type":"{\n        name: string | null;\n        email: string | null;\n    }","description":"User identification traits"},{"name":"widget_session_id","type":"string","description":"Widget session ID for access control"}]},{"id":"SendMessageResponse","name":"SendMessageResponse","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"created_at","type":"string","description":"ISO timestamp when the message was created"},{"name":"message_id","type":"string","description":"ID of the newly created message"},{"name":"ticket_id","type":"string","description":"ID of the ticket this message belongs to"},{"name":"ticket_status","type":"TicketStatus","description":"Current status of the ticket"},{"name":"unread_count","type":"number","description":"Number of unread messages from the team After customer sends a message, this is always 0"}]},{"id":"SessionContext","name":"SessionContext","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"current_url","type":"string","description":"Page URL where the ticket was created"},{"name":"session_replay_url","type":"string","description":"URL to the session replay at the time the ticket was created Includes timestamp to jump to the exact moment"}]},{"id":"SessionRecordingPersistedConfig","name":"SessionRecordingPersistedConfig","path":"lib/src/types.d.ts","example":"Omit<SessionRecordingRemoteConfig, 'recordCanvas' | 'canvasFps' | 'canvasQuality' | 'networkPayloadCapture' | 'sampleRate' | 'minimumDurationMilliseconds'> & {\n    cache_timestamp?: number;\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}","properties":[]},{"id":"SessionRecordingRemoteConfig","name":"SessionRecordingRemoteConfig","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}","properties":[]},{"id":"SessionRecordingUrlTrigger","name":"SessionRecordingUrlTrigger","path":"lib/src/types.d.ts","properties":[{"name":"matching","type":"'regex'"},{"name":"url","type":"string"}]},{"id":"SessionStartReason","name":"SessionStartReason","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\"","properties":[]},{"id":"ShowTourOptions","name":"ShowTourOptions","path":"lib/src/posthog-product-tours-types.d.ts","properties":[{"name":"enableStrictValidation","type":"boolean"},{"name":"reason","type":"ProductTourRenderReason"}]},{"id":"SiteApp","name":"SiteApp","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}","properties":[]},{"id":"SiteAppGlobals","name":"SiteAppGlobals","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}","properties":[]},{"id":"SiteAppLoader","name":"SiteAppLoader","path":"lib/src/types.d.ts","example":"{\n    id: string;\n    init: (config: {\n        posthog: PostHog;\n        callback: (success: boolean) => void;\n    }) => {\n        processEvent?: (globals: SiteAppGlobals) => void;\n    };\n}","properties":[]},{"id":"SnippetArrayItem","name":"SnippetArrayItem","path":"lib/src/types.d.ts","example":"[method: string, ...args: any[]]","properties":[]},{"id":"Survey","name":"Survey","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"appearance","type":"SurveyAppearance | null"},{"name":"conditions","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":"current_iteration_start_date","type":"string | null"},{"name":"current_iteration","type":"number | null"},{"name":"description","type":"string"},{"name":"enable_partial_responses","type":"boolean | null"},{"name":"end_date","type":"string | null"},{"name":"feature_flag_keys","type":"{\n        key: string;\n        value?: string;\n    }[] | null"},{"name":"id","type":"string"},{"name":"internal_targeting_flag_key","type":"string | null"},{"name":"linked_flag_key","type":"string | null"},{"name":"name","type":"string"},{"name":"questions","type":"SurveyQuestion[]"},{"name":"schedule","type":"SurveySchedule | null"},{"name":"start_date","type":"string | null"},{"name":"targeting_flag_key","type":"string | null"},{"name":"type","type":"SurveyType"}]},{"id":"SurveyActionType","name":"SurveyActionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"id","type":"number"},{"name":"name","type":"string | null"},{"name":"steps","type":"ActionStepType[]"}]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"boxPadding","type":"string"},{"name":"descriptionTextColor","type":"string","description":""},{"name":"disabledButtonOpacity","type":"string"},{"name":"fontFamily","type":"string"},{"name":"hideCancelButton","type":"boolean"},{"name":"inputBackgroundColor","type":"string","description":""},{"name":"maxWidth","type":"string"},{"name":"position","type":"SurveyPosition"},{"name":"ratingButtonHoverColor","type":"string"},{"name":"tabPosition","type":"SurveyTabPosition"},{"name":"whiteLabel","type":"boolean"},{"name":"zIndex","type":"string"}]},{"id":"SurveyCallback","name":"SurveyCallback","path":"lib/src/posthog-surveys-types.d.ts","example":"(surveys: Survey[], context?: {\n    isLoaded: boolean;\n    error?: string;\n}) => void","properties":[]},{"id":"SurveyConfig","name":"SurveyConfig","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"autoSubmitDelay","type":"number","description":""},{"name":"autoSubmitIfComplete","type":"boolean","description":""},{"name":"prefillFromUrl","type":"boolean"}]},{"id":"SurveyElement","name":"SurveyElement","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"$el_text","type":"string"},{"name":"attr_class","type":"string[]"},{"name":"attr_id","type":"string"},{"name":"attributes","type":"Record<string, any>"},{"name":"event_id","type":"number"},{"name":"group_id","type":"number"},{"name":"href","type":"string"},{"name":"nth_child","type":"number"},{"name":"nth_of_type","type":"number"},{"name":"order","type":"number"},{"name":"tag_name","type":"string"},{"name":"text","type":"string"}]},{"id":"SurveyEventName","name":"SurveyEventName","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"ABANDONED","type":"\"survey abandoned\""},{"name":"DISMISSED","type":"\"survey dismissed\""},{"name":"SENT","type":"\"survey sent\""},{"name":"SHOWN","type":"\"survey shown\""}]},{"id":"SurveyEventProperties","name":"SurveyEventProperties","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"PRODUCT_TOUR_ID","type":"\"$product_tour_id\""},{"name":"SURVEY_COMPLETED","type":"\"$survey_completed\""},{"name":"SURVEY_ID","type":"\"$survey_id\""},{"name":"SURVEY_ITERATION","type":"\"$survey_iteration\""},{"name":"SURVEY_ITERATION_START_DATE","type":"\"$survey_iteration_start_date\""},{"name":"SURVEY_LAST_SEEN_DATE","type":"\"$survey_last_seen_date\""},{"name":"SURVEY_NAME","type":"\"$survey_name\""},{"name":"SURVEY_PARTIALLY_COMPLETED","type":"\"$survey_partially_completed\""},{"name":"SURVEY_QUESTIONS","type":"\"$survey_questions\""},{"name":"SURVEY_RESPONSE","type":"\"$survey_response\""},{"name":"SURVEY_SUBMISSION_ID","type":"\"$survey_submission_id\""}]},{"id":"SurveyEventType","name":"SurveyEventType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Activation","type":"\"events\""},{"name":"Cancellation","type":"\"cancelEvents\""}]},{"id":"SurveyEventWithFilters","name":"SurveyEventWithFilters","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"name","type":"string"},{"name":"propertyFilters","type":"PropertyFilters"}]},{"id":"SurveyPosition","name":"SurveyPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"NextToTrigger","type":"\"next_to_trigger\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"lib/src/posthog-surveys-types.d.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"lib/src/posthog-surveys-types.d.ts","example":"\"html\" | \"text\"","properties":[]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyResponseValue","name":"SurveyResponseValue","path":"lib/src/posthog-surveys-types.d.ts","example":"string | number | string[] | null","properties":[]},{"id":"SurveySchedule","name":"SurveySchedule","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Always","type":"\"always\""},{"name":"Once","type":"\"once\""},{"name":"Recurring","type":"\"recurring\""}]},{"id":"SurveyTabPosition","name":"SurveyTabPosition","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Bottom","type":"\"bottom\""},{"name":"Left","type":"\"left\""},{"name":"Right","type":"\"right\""},{"name":"Top","type":"\"top\""}]},{"id":"SurveyType","name":"SurveyType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"lib/src/posthog-surveys-types.d.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]},{"id":"SurveyWithTypeAndAppearance","name":"SurveyWithTypeAndAppearance","path":"lib/src/posthog-surveys-types.d.ts","example":"\"id\" | \"type\" | \"appearance\"","properties":[]},{"id":"Ticket","name":"Ticket","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"created_at","type":"string","description":"ISO timestamp when the ticket was created"},{"name":"id","type":"string","description":"Unique identifier for the ticket"},{"name":"last_message_at","type":"string","description":"ISO timestamp of the last message"},{"name":"last_message","type":"string","description":"Preview of the last message"},{"name":"message_count","type":"number","description":"Total number of messages in this ticket"},{"name":"messages","type":"Message[]","description":"Array of messages (only present in detailed ticket view)"},{"name":"status","type":"TicketStatus","description":"Current status of the ticket"},{"name":"unread_count","type":"number","description":"Number of unread messages from the team"}]},{"id":"TicketStatus","name":"TicketStatus","path":"lib/src/posthog-conversations-types.d.ts","example":"\"new\" | \"open\" | \"pending\" | \"on_hold\" | \"resolved\"","properties":[]},{"id":"TipTapDoc","name":"TipTapDoc","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"content","type":"TipTapNode[]"},{"name":"type","type":"'doc'"}]},{"id":"TipTapMark","name":"TipTapMark","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"attrs","type":"{\n        href?: string;\n        target?: string;\n        [key: string]: unknown;\n    }"},{"name":"type","type":"'bold' | 'italic' | 'underline' | 'strike' | 'code' | 'link'"}]},{"id":"TipTapNode","name":"TipTapNode","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"attrs","type":"Record<string, unknown>"},{"name":"content","type":"TipTapNode[]"},{"name":"marks","type":"TipTapMark[]"},{"name":"text","type":"string"},{"name":"type","type":"string"}]},{"id":"UserProvidedTraits","name":"UserProvidedTraits","path":"lib/src/posthog-conversations-types.d.ts","properties":[{"name":"email","type":"string"},{"name":"name","type":"string"}]},{"id":"WidgetPosition","name":"WidgetPosition","path":"lib/src/posthog-conversations-types.d.ts","example":"\"bottom_left\" | \"bottom_right\" | \"top_left\" | \"top_right\"","properties":[]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHog","path":"lib/src/posthog-core.d.ts","title":"PostHog","params":[],"details":null,"category":"","examples":[{"id":"posthog","code":"// Generated example for PostHog\nposthog.PostHog();","name":"Generated example for PostHog"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Constructs a new instance of the `PostHog` class"},{"id":"alias","path":"lib/src/posthog-core.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"A unique identifier that you want to use for this user in the future."},{"name":"original","type":"string","isOptional":true,"description":"The current identifier being used for this user."}],"details":"PostHog 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.","category":"Identification","examples":[{"id":"link_anonymous_user_to_account_on_signup","code":"\n\n// link anonymous user to account on signup\nposthog.alias('user_12345')\n\n\n","name":"link anonymous user to account on signup"},{"id":"explicit_alias_with_original_id","code":"\n\n// explicit alias with original ID\nposthog.alias('user_12345', 'anonymous_abc123')\n\n\n\n","name":"explicit alias with original ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | void | number","name":"CaptureResult | void | number"},"description":"Creates an alias linking two distinct user identifiers. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"cancelPendingSurvey","path":"lib/src/posthog-core.d.ts","title":"cancelPendingSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":""}],"details":null,"category":"Surveys","examples":[{"id":"cancelpendingsurvey","code":"// Generated example for cancelPendingSurvey\nposthog.cancelPendingSurvey();","name":"Generated example for cancelPendingSurvey"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Cancels a pending survey that is waiting to be displayed (e.g., due to a popup delay)."},{"id":"canRenderSurvey","path":"lib/src/posthog-core.d.ts","title":"canRenderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."}],"details":null,"category":"Surveys","examples":[{"id":"canrendersurvey","code":"// Generated example for canRenderSurvey\nposthog.canRenderSurvey();","name":"Generated example for canRenderSurvey"}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"SurveyRenderReason | null","name":"SurveyRenderReason | null"},"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."},{"id":"canRenderSurveyAsync","path":"lib/src/posthog-core.d.ts","title":"canRenderSurveyAsync","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to check."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"If true, the survey will be reloaded from the server, Default: false"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyRenderReason>","name":"Promise<SurveyRenderReason>"},"description":"Checks the feature flags associated with this Survey to see if the survey can be rendered."},{"id":"capture","path":"lib/src/posthog-core.d.ts","title":"capture","params":[{"name":"event_name","type":"EventName","isOptional":false,"description":"The name of the event (e.g., 'Sign Up', 'Button Click', 'Purchase')"},{"name":"properties","type":"Properties | null","isOptional":true,"description":"Properties to include with the event describing the user or event details"},{"name":"options","type":"CaptureOptions","isOptional":true,"description":"Optional configuration for the capture request"}],"details":"You can capture arbitrary object-like values as events. [Learn about capture best practices](/docs/product-analytics/capture-events)","category":"Capture","examples":[{"id":"basic_event_capture","code":"\n\n// basic event capture\nposthog.capture('cta-button-clicked', {\n    button_name: 'Get Started',\n    page: 'homepage'\n})\n\n\n\n\n\n","name":"basic event capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Captures an event with optional properties and configuration."},{"id":"captureException","path":"lib/src/posthog-core.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"Properties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"CaptureResult | undefined","name":"CaptureResult | undefined"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"lib/src/posthog-core.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"lib/src/posthog-core.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"clear_opt_in_out_capturing","path":"lib/src/posthog-core.d.ts","title":"clear_opt_in_out_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"clear_opt_in_out_capturing","code":"// Generated example for clear_opt_in_out_capturing\nposthog.clear_opt_in_out_capturing();","name":"Generated example for clear_opt_in_out_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Clear the user's opt in/out status of data capturing and cookies/localstorage for this PostHog instance"},{"id":"createPersonProfile","path":"lib/src/posthog-core.d.ts","title":"createPersonProfile","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.createPersonProfile()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"debug","path":"lib/src/posthog-core.d.ts","title":"debug","params":[{"name":"debug","type":"boolean","isOptional":true,"description":"If true, will enable debug mode."}],"details":"Debug mode logs all PostHog calls to the browser console for troubleshooting. Can also be enabled by adding `?__posthog_debug=true` to the URL.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"displaySurvey","path":"lib/src/posthog-core.d.ts","title":"displaySurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The survey ID to display"},{"name":"options","type":"DisplaySurveyOptions","isOptional":true,"description":"Display configuration"}],"details":null,"category":"Surveys","examples":[{"id":"display_as_popover_(respects_all_conditions_defined_in_the_dashboard)","code":"\n\n// Display as popover (respects all conditions defined in the dashboard)\nposthog.displaySurvey('survey-id-123')\n\n\n","name":"Display as popover (respects all conditions defined in the dashboard)"},{"id":"display_inline_in_a_specific_element","code":"\n\n// Display inline in a specific element\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Inline,\n  selector: '#survey-container'\n})\n\n\n","name":"Display inline in a specific element"},{"id":"force_display_ignoring_conditions_and_delays","code":"\n\n// Force display ignoring conditions and delays\nposthog.displaySurvey('survey-id-123', {\n  displayType: DisplaySurveyType.Popover,\n  ignoreConditions: true,\n  ignoreDelay: true\n})\n\n\n\n","name":"Force display ignoring conditions and delays"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Display a survey programmatically as either a popover or inline element."},{"id":"get_distinct_id","path":"lib/src/posthog-core.d.ts","title":"get_distinct_id","params":[],"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 PostHog.","category":"Identification","examples":[{"id":"get_the_current_user_id","code":"\n\n// get the current user ID\nconst userId = posthog.get_distinct_id()\nconsole.log('Current user:', userId)\n\n\n","name":"get the current user ID"},{"id":"use_in_loaded_callback","code":"\n\n// use in loaded callback\nposthog.init('token', {\n    loaded: (posthog) => {\n        const id = posthog.get_distinct_id()\n        // use the ID\n    }\n})\n\n\n\n","name":"use in loaded callback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current distinct ID for the user."},{"id":"get_explicit_consent_status","path":"lib/src/posthog-core.d.ts","title":"get_explicit_consent_status","params":[],"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.","category":"","examples":[{"id":"","code":"\n\nconst consentStatus = posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"'granted' | 'denied' | 'pending'","name":"'granted' | 'denied' | 'pending'"},"description":"Returns the explicit consent status of the user."},{"id":"get_property","path":"lib/src/posthog-core.d.ts","title":"get_property","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the super property you want to retrieve"}],"details":"get_property() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'$user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for '$user_id' after the posthog library has loaded\nposthog.init('<YOUR PROJECT TOKEN>', {\n    loaded: function(posthog) {\n        user_id = posthog.get_property('$user_id');\n    }\n});\n\n\n\n","name":"grab value for '$user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of a super property. Returns undefined if the property doesn't exist."},{"id":"get_session_id","path":"lib/src/posthog-core.d.ts","title":"get_session_id","params":[],"details":"This should only be used for informative purposes. Any actual internal use case for the session_id should be handled by the sessionManager.","category":"","examples":[{"id":"get_session_id","code":"// Generated example for get_session_id\nposthog.get_session_id();","name":"Generated example for get_session_id"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the current session_id."},{"id":"get_session_replay_url","path":"lib/src/posthog-core.d.ts","title":"get_session_replay_url","params":[{"name":"options","type":"{\n        withTimestamp?: boolean;\n        timestampLookBack?: number;\n    }","isOptional":true,"description":"Options for the url"}],"details":null,"category":"Session replay","examples":[{"id":"basic_usage","code":"\n\n// basic usage\nposthog.get_session_replay_url()\n\n@example\n\njs // timestamp posthog.get_session_replay_url({ withTimestamp: true })\n\n\n@example\n\njs // timestamp and lookback posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 // look back 30 seconds }) ```\n\n\n\n","name":"basic usage"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"description":"Returns the Replay url for the current session."},{"id":"getActiveMatchingSurveys","path":"lib/src/posthog-core.d.ts","title":"getActiveMatchingSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when the surveys are loaded or updated."},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the surveys."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.getActiveMatchingSurveys((surveys) => {\n     // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"getEarlyAccessFeatures","path":"lib/src/posthog-core.d.ts","title":"getEarlyAccessFeatures","params":[{"name":"callback","type":"EarlyAccessFeatureCallback","isOptional":false,"description":"The callback function will be called when the early access features are loaded."},{"name":"force_reload","type":"boolean","isOptional":true,"description":"Whether to force a reload of the early access features."},{"name":"stages","type":"EarlyAccessFeatureStage[]","isOptional":true,"description":"The stages of the early access features to load."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst posthog = usePostHog()\nconst activeFlags = useActiveFeatureFlags()\n\nconst [activeBetas, setActiveBetas] = useState([])\nconst [inactiveBetas, setInactiveBetas] = useState([])\nconst [comingSoonFeatures, setComingSoonFeatures] = useState([])\n\nuseEffect(() => {\n  posthog.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","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"getFeatureFlag","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"FeatureFlagOptions","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog. If fresh: true, we won't return cached values from localStorage - only values loaded from the server."}],"details":"Returns the feature flag value which can be a boolean, string, or undefined. Supports multivariate flags that can return custom string values.","category":"Feature flags","examples":[{"id":"check_boolean_flag","code":"\n\n// check boolean flag\nif (posthog.getFeatureFlag('new-feature')) {\n    // show new feature\n}\n\n\n","name":"check boolean flag"},{"id":"check_multivariate_flag","code":"\n\n// check multivariate flag\nconst variant = posthog.getFeatureFlag('button-color')\nif (variant === 'red') {\n    // show red button\n}\n\n\n\n","name":"check multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"description":"Gets the value of a feature flag for the current user."},{"id":"getFeatureFlagPayload","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nif(posthog.getFeatureFlag('beta-feature') === 'some-value') {\n     const someValue = posthog.getFeatureFlagPayload('beta-feature')\n     // do something\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"JsonType","name":"JsonType"},"description":"Get feature flag payload value matching key for user (supports multivariate flags)."},{"id":"getFeatureFlagResult","path":"lib/src/posthog-core.d.ts","title":"getFeatureFlagResult","params":[{"name":"key","type":"string","isOptional":false,"description":"Key of the feature flag."},{"name":"options","type":"FeatureFlagOptions","isOptional":true,"description":"Options for the feature flag lookup."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst result = posthog.getFeatureFlagResult('my-flag')\nif (result?.enabled) {\n    console.log('Flag is enabled with payload:', result.payload)\n}\n\n\n","name":""},{"id":"multivariate_flag","code":"\n\n// multivariate flag\nconst result = posthog.getFeatureFlagResult('button-color')\nif (result?.variant === 'red') {\n    showRedButton(result.payload)\n}\n\n\n\n","name":"multivariate flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"FeatureFlagResult | undefined","name":"FeatureFlagResult | undefined"},"description":"Get a feature flag evaluation result including both the flag value and payload.\nBy default, this method emits the `$feature_flag_called` event."},{"id":"getGroups","path":"lib/src/posthog-core.d.ts","title":"getGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"getgroups","code":"// Generated example for getGroups\nposthog.getGroups();","name":"Generated example for getGroups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Record<string, any>","name":"Record<string, any>"},"description":"Returns the current groups."},{"id":"getPageViewId","path":"lib/src/posthog-core.d.ts","title":"getPageViewId","params":[],"details":null,"category":"Initialization","examples":[{"id":"getpageviewid","code":"// Generated example for getPageViewId\nposthog.getPageViewId();","name":"Generated example for getPageViewId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string | undefined","name":"string | undefined"},"description":"Returns the current page view ID."},{"id":"getSessionProperty","path":"lib/src/posthog-core.d.ts","title":"getSessionProperty","params":[{"name":"property_name","type":"string","isOptional":false,"description":"The name of the session super property you want to retrieve"}],"details":"This is based on browser-level `sessionStorage`, NOT the PostHog session. getSessionProperty() can only be called after the PostHog library has finished loading. init() has a loaded function available to handle this automatically.","category":"Identification","examples":[{"id":"grab_value_for_'user_id'_after_the_posthog_library_has_loaded","code":"\n\n// grab value for 'user_id' after the posthog library has loaded\nposthog.init('YOUR PROJECT TOKEN', {\n    loaded: function(posthog) {\n        user_id = posthog.getSessionProperty('user_id');\n    }\n});\n\n\n\n","name":"grab value for 'user_id' after the posthog library has loaded"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Property | undefined","name":"Property | undefined"},"description":"Returns the value of the session super property named property_name. If no such property is set, getSessionProperty() will return the undefined value."},{"id":"getSurveys","path":"lib/src/posthog-core.d.ts","title":"getSurveys","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"Function that receives the array of surveys"},{"name":"forceReload","type":"boolean","isOptional":true,"description":"Optional boolean to force an API call for updated surveys"}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nfunction callback(surveys, context) {\n  // do something\n}\n\nposthog.getSurveys(callback, false)\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Get list of all surveys."},{"id":"group","path":"lib/src/posthog-core.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"Group type (example: 'organization')"},{"name":"groupKey","type":"string","isOptional":false,"description":"Group key (example: 'org::5')"},{"name":"groupPropertiesToSet","type":"Properties","isOptional":true,"description":"Optional properties to set for group"}],"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.","category":"Identification","examples":[{"id":"associate_user_with_an_organization","code":"\n\n// associate user with an organization\nposthog.group('organization', 'org_12345', {\n    name: 'Acme Corp',\n    plan: 'enterprise'\n})\n\n\n","name":"associate user with an organization"},{"id":"associate_with_multiple_group_types","code":"\n\n// associate with multiple group types\nposthog.group('organization', 'org_12345')\nposthog.group('team', 'team_67890')\n\n\n\n","name":"associate with multiple group types"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates the user with a group for group-based analytics. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"has_opted_in_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_in_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_in_capturing()) {\n    // show analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted into data capturing."},{"id":"has_opted_out_capturing","path":"lib/src/posthog-core.d.ts","title":"has_opted_out_capturing","params":[],"details":"Returns the current consent status for event tracking and data persistence.","category":"Privacy","examples":[{"id":"","code":"\n\nif (posthog.has_opted_out_capturing()) {\n    // disable analytics features\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks if the user has opted out of data capturing."},{"id":"identify","path":"lib/src/posthog-core.d.ts","title":"identify","params":[{"name":"new_distinct_id","type":"string","isOptional":true,"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."},{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"By default, PostHog 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).","category":"Identification","examples":[{"id":"basic_identification","code":"\n\n// basic identification\nposthog.identify('user_12345')\n\n\n","name":"basic identification"},{"id":"identify_with_user_properties","code":"\n\n// identify with user properties\nposthog.identify('user_12345', {\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"identify with user properties"},{"id":"identify_with_set_and_set_once_properties","code":"\n\n// identify with set and set_once properties\nposthog.identify('user_12345',\n    { last_login: new Date() },  // updates every time\n    { signup_date: new Date() }  // sets only once\n)\n\n\n\n","name":"identify with set and set_once properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates a user with a unique identifier instead of an auto-generated ID. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"init","path":"lib/src/posthog-core.d.ts","title":"init","params":[{"name":"token","type":"string","isOptional":false,"description":"Your PostHog API token"},{"name":"config","type":"OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>","isOptional":true,"description":"A dictionary of config options to override"},{"name":"name","type":"string","isOptional":true,"description":"The name for the new posthog instance that you want created"}],"details":"All new instances are added to the main posthog object as sub properties (such as `posthog.library_name`) and also returned by this function. [Learn more about configuration options](https://github.com/posthog/posthog-js/blob/6e0e873/src/posthog-core.js#L57-L91)","category":"Initialization","examples":[{"id":"basic_initialization","code":"\n\n// basic initialization\nposthog.init('<ph_project_api_key>', {\n    api_host: '<ph_client_api_host>'\n})\n\n\n","name":"basic initialization"},{"id":"multiple_instances","code":"\n\n// multiple instances\nposthog.init('<ph_project_api_key>', {}, 'project1')\nposthog.init('<ph_project_api_key>', {}, 'project2')\n\n\n\n","name":"multiple instances"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHog","name":"PostHog"},"description":"Initializes a new instance of the PostHog capturing object."},{"id":"is_capturing","path":"lib/src/posthog-core.d.ts","title":"is_capturing","params":[],"details":null,"category":"Privacy","examples":[{"id":"is_capturing","code":"// Generated example for is_capturing\nposthog.is_capturing();","name":"Generated example for is_capturing"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"Checks whether the PostHog 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."},{"id":"isFeatureEnabled","path":"lib/src/posthog-core.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"options","type":"FeatureFlagOptions","isOptional":true,"description":"(optional) If send_event: false, we won't send an $feature_flag_call event to PostHog. If fresh: true, we won't return cached values from localStorage - only values loaded from the server."}],"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.","category":"Feature flags","examples":[{"id":"simple_feature_flag_check","code":"\n\n// simple feature flag check\nif (posthog.isFeatureEnabled('new-checkout')) {\n    showNewCheckout()\n}\n\n\n","name":"simple feature flag check"},{"id":"disable_event_tracking","code":"\n\n// disable event tracking\nif (posthog.isFeatureEnabled('feature', { send_event: false })) {\n    // flag checked without sending $feature_flag_call event\n}\n\n\n\n","name":"disable event tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"description":"Checks if a feature flag is enabled for the current user."},{"id":"loadToolbar","path":"lib/src/posthog-core.d.ts","title":"loadToolbar","params":[{"name":"params","type":"ToolbarParams","isOptional":false,"description":""}],"details":null,"category":"Toolbar","examples":[{"id":"loadtoolbar","code":"// Generated example for loadToolbar\nposthog.loadToolbar();","name":"Generated example for loadToolbar"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether the [toolbar](/docs/toolbar) loaded"},{"id":"on","path":"lib/src/posthog-core.d.ts","title":"on","params":[{"name":"event","type":"'eventCaptured' | 'featureFlagsReloading'","isOptional":false,"description":"The event to listen for."},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":"The callback function to call when the event is emitted."}],"details":null,"category":"Capture","examples":[{"id":"","code":"\n\nposthog.on('eventCaptured', (event) => {\n  console.log(event)\n})\n\n\n","name":""},{"id":"track_when_feature_flags_are_reloading_to_show_a_loading_state","code":"\n\n// Track when feature flags are reloading to show a loading state\nposthog.on('featureFlagsReloading', () => {\n  console.log('Feature flags are being reloaded...')\n})\n\n\n\n","name":"Track when feature flags are reloading to show a loading state"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Exposes a set of events that PostHog 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\nAvailable events: - `eventCaptured`: Emitted immediately before trying to send an event - `featureFlagsReloading`: Emitted when feature flags are being reloaded (e.g. after `identify()`, `group()`, or `reloadFeatureFlags()`)"},{"id":"onFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"onFeatureFlags","params":[{"name":"callback","type":"FeatureFlagsCallback","isOptional":false,"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."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.onFeatureFlags(function(featureFlags, featureFlagsVariants, { errorsLoading }) {\n    // do something\n})\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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."},{"id":"onSessionId","path":"lib/src/posthog-core.d.ts","title":"onSessionId","params":[{"name":"callback","type":"SessionIdChangedCallback","isOptional":false,"description":"The callback function will be called once a session id is present or when it or the window id are updated."}],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.onSessionId(function(sessionId, windowId) { // do something })\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"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 PostHog session id with a backend session."},{"id":"onSurveysLoaded","path":"lib/src/posthog-core.d.ts","title":"onSurveysLoaded","params":[{"name":"callback","type":"SurveyCallback","isOptional":false,"description":"The callback function will be called when surveys are loaded or updated."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.onSurveysLoaded((surveys, context) => { // do something })\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"},"description":"Register an event listener that runs when surveys are loaded.\nCallback parameters: - surveys: Survey[]: An array containing all survey objects fetched from PostHog using the getSurveys method - context:  isLoaded: boolean, error?: string : An object indicating if the surveys were loaded successfully"},{"id":"opt_in_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_in_capturing","params":[{"name":"options","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    }","isOptional":true,"description":""}],"details":"Enables event tracking and data persistence (cookies/localStorage) for this PostHog instance. By default, captures an `$opt_in` event unless disabled.","category":"Privacy","examples":[{"id":"simple_opt-in","code":"\n\n// simple opt-in\nposthog.opt_in_capturing()\n\n\n","name":"simple opt-in"},{"id":"opt-in_with_custom_event_and_properties","code":"\n\n// opt-in with custom event and properties\nposthog.opt_in_capturing({\n    captureEventName: 'Privacy Accepted',\n    captureProperties: { source: 'banner' }\n})\n\n\n","name":"opt-in with custom event and properties"},{"id":"opt-in_without_capturing_event","code":"\n\n// opt-in without capturing event\nposthog.opt_in_capturing({\n    captureEventName: false\n})\n\n\n\n","name":"opt-in without capturing event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user into data capturing and persistence."},{"id":"opt_out_capturing","path":"lib/src/posthog-core.d.ts","title":"opt_out_capturing","params":[],"details":"Disables event tracking and data persistence (cookies/localStorage) for this PostHog instance. If `opt_out_persistence_by_default` is true, SDK persistence will also be disabled.","category":"Privacy","examples":[{"id":"opt_user_out_(e.g.,_on_privacy_settings_page)","code":"\n\n// opt user out (e.g., on privacy settings page)\nposthog.opt_out_capturing()\n\n\n\n","name":"opt user out (e.g., on privacy settings page)"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Opts the user out of data capturing and persistence."},{"id":"push","path":"lib/src/posthog-core.d.ts","title":"push","params":[{"name":"item","type":"SnippetArrayItem","isOptional":false,"description":"A [function_name, args...] array to be executed"}],"details":null,"category":"","examples":[{"id":"","code":"\n\nposthog.push(['register', { a: 'b' }]);\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)."},{"id":"register_for_session","path":"lib/src/posthog-core.d.ts","title":"register_for_session","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"}],"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.","category":"Capture","examples":[{"id":"register_session-specific_properties","code":"\n\n// register session-specific properties\nposthog.register_for_session({\n    current_page_type: 'checkout',\n    ab_test_variant: 'control'\n})\n\n\n","name":"register session-specific properties"},{"id":"register_properties_for_user_flow_tracking","code":"\n\n// register properties for user flow tracking\nposthog.register_for_session({\n    selected_plan: 'pro',\n    completed_steps: 3,\n    flow_id: 'signup_flow_v2'\n})\n\n\n\n","name":"register properties for user flow tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties for the current session only."},{"id":"register_once","path":"lib/src/posthog-core.d.ts","title":"register_once","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"An associative array of properties to store about the user"},{"name":"default_value","type":"Property","isOptional":true,"description":"Value to override if already set in super properties (ex: 'False') Default: 'None'"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the users last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_once-only_properties","code":"\n\n// register once-only properties\nposthog.register_once({\n    first_login_date: new Date().toISOString(),\n    initial_referrer: document.referrer\n})\n\n\n","name":"register once-only properties"},{"id":"override_existing_value_if_it_matches_default","code":"\n\n// override existing value if it matches default\nposthog.register_once(\n    { user_type: 'premium' },\n    'unknown'  // overwrite if current value is 'unknown'\n)\n\n\n\n","name":"override existing value if it matches default"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties only if they haven't been set before."},{"id":"register","path":"lib/src/posthog-core.d.ts","title":"register","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"properties to store about the user"},{"name":"days","type":"number","isOptional":true,"description":"How many days since the user's last visit to store the super properties"}],"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.","category":"Capture","examples":[{"id":"register_a_single_property","code":"\n\n// register a single property\nposthog.register({ plan: 'premium' })\n\n\n\n\n","name":"register a single property"},{"id":"register_multiple_properties","code":"\n\n// register multiple properties\nposthog.register({\n    email: 'user@example.com',\n    account_type: 'business',\n    signup_date: '2023-01-15'\n})\n\n\n","name":"register multiple properties"},{"id":"register_with_custom_expiration","code":"\n\n// register with custom expiration\nposthog.register({ campaign: 'summer_sale' }, 7) // expires in 7 days\n\n\n\n","name":"register with custom expiration"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Registers super properties that are included with all events."},{"id":"reloadFeatureFlags","path":"lib/src/posthog-core.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.reloadFeatureFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"renderSurvey","path":"lib/src/posthog-core.d.ts","title":"renderSurvey","params":[{"name":"surveyId","type":"string","isOptional":false,"description":"The ID of the survey to render."},{"name":"selector","type":"string","isOptional":false,"description":"The selector of the HTML element to render the survey on."}],"details":null,"category":"Surveys","examples":[{"id":"","code":"\n\nposthog.renderSurvey(coolSurveyID, '#survey-container')\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"deprecated","returnType":{"id":"void","name":"void"},"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."},{"id":"reset","path":"lib/src/posthog-core.d.ts","title":"reset","params":[{"name":"reset_device_id","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"Identification","examples":[{"id":"reset_on_user_logout","code":"\n\n// reset on user logout\nfunction logout() {\n    posthog.reset()\n    // redirect to login page\n}\n\n\n","name":"reset on user logout"},{"id":"reset_and_generate_new_device_id","code":"\n\n// reset and generate new device ID\nposthog.reset(true)  // also resets device_id\n\n\n\n","name":"reset and generate new device ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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"},{"id":"resetGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetGroupPropertiesForFlags","params":[{"name":"group_type","type":"string","isOptional":true,"description":""}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the group properties for feature flags."},{"id":"resetGroups","path":"lib/src/posthog-core.d.ts","title":"resetGroups","params":[],"details":null,"category":"Identification","examples":[{"id":"","code":"\n\nposthog.resetGroups()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets only the group properties of the user currently logged in. Learn more about [groups](/docs/product-analytics/group-analytics)"},{"id":"resetPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets the person properties for feature flags."},{"id":"sessionRecordingStarted","path":"lib/src/posthog-core.d.ts","title":"sessionRecordingStarted","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording_if_it's_running","code":"\n\n// Stop session recording if it's running\nif (posthog.sessionRecordingStarted()) {\n  posthog.stopSessionRecording()\n}\n\n\n\n","name":"Stop session recording if it's running"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"},"description":"returns a boolean indicating whether session recording is currently running"},{"id":"set_config","path":"lib/src/posthog-core.d.ts","title":"set_config","params":[{"name":"config","type":"Partial<PostHogConfig>","isOptional":false,"description":"A dictionary of new configuration values to update"}],"details":null,"category":"Initialization","examples":[{"id":"set_config","code":"// Generated example for set_config\nposthog.set_config();","name":"Generated example for set_config"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Updates the configuration of the PostHog instance."},{"id":"setGroupPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"{\n        [type: string]: Properties;\n    }","isOptional":false,"description":"The properties to override, the key of which is the group type."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties_with_reload","code":"\n\n// Set properties with reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } })\n\n\n","name":"Set properties with reload"},{"id":"set_properties_without_reload","code":"\n\n// Set properties without reload\nposthog.setGroupPropertiesForFlags({'organization': { name: 'CYZ', employees: '11' } }, false)\n\n\n\n","name":"Set properties without reload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"setInternalOrTestUser","path":"lib/src/posthog-core.d.ts","title":"setInternalOrTestUser","params":[],"details":null,"category":"Identification","examples":[{"id":"manually_mark_as_test_user","code":"\n\n// Manually mark as test user\nposthog.setInternalOrTestUser()\n\n// Or use internal_or_test_user_hostname config for automatic detection\nposthog.init('token', { internal_or_test_user_hostname: 'localhost' })\n\n\n","name":"Manually mark as test user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Marks the current user as a test user by setting the `$internal_or_test_user` person property to `true`. This also enables person processing for the current user.\nThis is useful for using in a cohort your internal/test filters for your posthog org."},{"id":"setPersonProperties","path":"lib/src/posthog-core.d.ts","title":"setPersonProperties","params":[{"name":"userPropertiesToSet","type":"Properties","isOptional":true,"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."},{"name":"userPropertiesToSetOnce","type":"Properties","isOptional":true,"description":"Optional: An associative array of properties to store about the user. If property is previously set, this does not override that value."}],"details":"Updates user properties that are stored with the person profile in PostHog. If `person_profiles` is set to `identified_only` and no profile exists, this will create one.","category":"Identification","examples":[{"id":"set_user_properties","code":"\n\n// set user properties\nposthog.setPersonProperties({\n    email: 'user@example.com',\n    plan: 'premium'\n})\n\n\n","name":"set user properties"},{"id":"set_properties","code":"\n\n// set properties\nposthog.setPersonProperties(\n    { name: 'Max Hedgehog' },  // $set properties\n    { initial_url: '/blog' }   // $set_once properties\n)\n\n\n\n","name":"set properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets properties on the person profile associated with the current `distinct_id`. Learn more about [identifying users](/docs/product-analytics/identify)"},{"id":"setPersonPropertiesForFlags","path":"lib/src/posthog-core.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Properties","isOptional":false,"description":"The properties to override."},{"name":"reloadFeatureFlags","type":"boolean","isOptional":true,"description":"Whether to reload feature flags."}],"details":null,"category":"Feature flags","examples":[{"id":"set_properties","code":"\n\n// Set properties\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n","name":"Set properties"},{"id":"set_properties_without_reloading","code":"\n\n// Set properties without reloading\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'}, false)\n\n\n\n","name":"Set properties without reloading"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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:"},{"id":"startExceptionAutocapture","path":"lib/src/posthog-core.d.ts","title":"startExceptionAutocapture","params":[{"name":"config","type":"ExceptionAutoCaptureConfig","isOptional":true,"description":"optional configuration option to control the exception autocapture behavior"}],"details":null,"category":"Error tracking","examples":[{"id":"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\nposthog.startExceptionAutocapture()\n\n\n","name":"Start with default exception autocapture rules. No-op if already enabled"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns exception autocapture on, and updates the config option `capture_exceptions` to the provided config (or `true`)"},{"id":"startSessionRecording","path":"lib/src/posthog-core.d.ts","title":"startSessionRecording","params":[{"name":"override","type":"{\n        sampling?: boolean;\n        linked_flag?: boolean;\n        url_trigger?: true;\n        event_trigger?: true;\n    } | true","isOptional":true,"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"}],"details":null,"category":"Session replay","examples":[{"id":"start_and_ignore_controls","code":"\n\n// Start and ignore controls\nposthog.startSessionRecording(true)\n\n\n","name":"Start and ignore controls"},{"id":"start_and_override_controls","code":"\n\n// Start and override controls\nposthog.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","name":"Start and override controls"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording on, and updates the config option `disable_session_recording` to false"},{"id":"stopExceptionAutocapture","path":"lib/src/posthog-core.d.ts","title":"stopExceptionAutocapture","params":[],"details":null,"category":"Error tracking","examples":[{"id":"stop_capturing_exceptions_automatically","code":"\n\n// Stop capturing exceptions automatically\nposthog.stopExceptionAutocapture()\n\n\n\n","name":"Stop capturing exceptions automatically"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns exception autocapture off by updating the config option `capture_exceptions` to `false`"},{"id":"stopSessionRecording","path":"lib/src/posthog-core.d.ts","title":"stopSessionRecording","params":[],"details":null,"category":"Session replay","examples":[{"id":"stop_session_recording","code":"\n\n// Stop session recording\nposthog.stopSessionRecording()\n\n\n\n","name":"Stop session recording"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"turns session recording off, and updates the config option disable_session_recording to true"},{"id":"unregister_for_session","path":"lib/src/posthog-core.d.ts","title":"unregister_for_session","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the session super property to remove"}],"details":"This will stop the property from being automatically included in future events for this session. The property is removed from sessionStorage.","category":"Capture","examples":[{"id":"remove_a_session_property","code":"\n\n// remove a session property\nposthog.unregister_for_session('current_flow')\n\n\n\n","name":"remove a session property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a session super property from the current session."},{"id":"unregister","path":"lib/src/posthog-core.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":"This will stop the property from being automatically included in future events. The property will be permanently removed from the user's profile.","category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('plan_type')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Removes a super property from persistent storage."},{"id":"updateEarlyAccessFeatureEnrollment","path":"lib/src/posthog-core.d.ts","title":"updateEarlyAccessFeatureEnrollment","params":[{"name":"key","type":"string","isOptional":false,"description":"The key of the feature flag to update."},{"name":"isEnrolled","type":"boolean","isOptional":false,"description":"Whether the user is enrolled in the feature."},{"name":"stage","type":"string","isOptional":true,"description":"The stage of the feature flag to update."}],"details":null,"category":"Feature flags","examples":[{"id":"","code":"\n\nconst toggleBeta = (betaKey) => {\n  if (activeBetas.some(\n    beta => beta.flagKey === betaKey\n  )) {\n    posthog.updateEarlyAccessFeatureEnrollment(\n      betaKey,\n      false\n    )\n    setActiveBetas(\n      prevActiveBetas => prevActiveBetas.filter(\n        item => item.flagKey !== betaKey\n      )\n    );\n    return\n  }\n\n  posthog.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  posthog.updateEarlyAccessFeatureEnrollment(\n    featureKey,\n    true\n  )\n  // Update UI to show user has registered\n}\n\n\n\n","name":""}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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)"},{"id":"updateFlags","path":"lib/src/posthog-core.d.ts","title":"updateFlags","params":[{"name":"flags","type":"Record<string, boolean | string>","isOptional":false,"description":"An object mapping flag keys to their values (boolean or string variant)"},{"name":"payloads","type":"Record<string, JsonType>","isOptional":true,"description":"Optional object mapping flag keys to their JSON payloads"},{"name":"options","type":"{\n        merge?: boolean;\n    }","isOptional":true,"description":"Optional settings. Use `{ merge: true }` to merge with existing flags instead of replacing."}],"details":null,"category":"Feature flags","examples":[{"id":"replace_all_flags_with_server-evaluated_values","code":"\n\n// Replace all flags with server-evaluated values\nposthog.updateFlags({\n  'my-flag': true,\n  'my-experiment': 'variant-a'\n})\n\n// Merge with existing flags (update only specified flags)\nposthog.updateFlags(\n  { 'my-flag': true },\n  undefined,\n  { merge: true }\n)\n\n// With payloads\nposthog.updateFlags(\n  { 'my-flag': true },\n  { 'my-flag': { some: 'data' } }\n)\n\n\n\n","name":"Replace all flags with server-evaluated values"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."}],"description":"This is the SDK reference for the PostHog 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 PostHog into your project.\nThis SDK is designed for browser environments. Use the PostHog [Node.js SDK](/docs/libraries/node) for server-side usage."}],"version":"1.354.1","categories":["Initialization","Identification","Capture","Surveys","Error tracking","LLM analytics","Privacy","Session replay","Feature flags","Toolbar"],"referenceId":"posthog-js"},"createdAt":"2026-02-25T19:30:16.249Z","updatedAt":"2026-02-25T19:30:16.249Z","publishedAt":"2026-02-25T19:30:16.236Z"}},{"id":20,"attributes":{"referenceId":"posthog-react-native","version":"4.10.1","data":{"id":"posthog-react-native-4.10.1","info":{"id":"posthog-react-native","title":"PostHog React Native SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"4.10.1","slugPrefix":"posthog-react-native","description":"PostHog React Native SDK allows you to capture events and send them to PostHog from your React Native applications."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"../core/src/types.ts","properties":[{"name":"Contains","type":"\"contains\""},{"name":"Exact","type":"\"exact\""},{"name":"Regex","type":"\"regex\""}]},{"id":"ActionStepType","name":"ActionStepType","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}","properties":[]},{"id":"AutocaptureOptions","name":"AutocaptureOptions","path":"dist/error-tracking/index.d.ts","properties":[{"name":"console","type":"boolean | LogLevel[]"},{"name":"uncaughtExceptions","type":"boolean"},{"name":"unhandledRejections","type":"boolean"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Open;\n}","properties":[]},{"id":"Compression","name":"Compression","path":"../core/src/types.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"EndBranching","name":"EndBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.End;\n}","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"dist/error-tracking/index.d.ts","properties":[{"name":"autocapture","type":"AutocaptureOptions | boolean"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"../core/src/types.ts","example":"{\n    code: string | undefined;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","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}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"../core/src/types.ts","example":"{\n    id: number | undefined;\n    version: number | undefined;\n    description: string | undefined;\n    payload: string | undefined;\n}","properties":[]},{"id":"FeatureFlagValue","name":"FeatureFlagValue","path":"../core/src/types.ts","example":"string | boolean","properties":[]},{"id":"FeatureFlagWithPayload","name":"FeatureFlagWithPayload","path":"dist/hooks/useFeatureFlag.d.ts","example":"[FeatureFlagValue | undefined, JsonType | undefined]","properties":[]},{"id":"JsonType","name":"JsonType","path":"../core/src/types.ts","example":"string | number | boolean | null | {\n    [key: string]: JsonType;\n} | Array<JsonType> | JsonType[]","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Link;\n    link?: string;\n}","properties":[]},{"id":"Logger","name":"Logger","path":"../core/src/types.ts","example":"{\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}","properties":[]},{"id":"LogLevel","name":"LogLevel","path":"dist/error-tracking/index.d.ts","example":"\"debug\" | \"log\" | \"info\" | \"warn\" | \"error\"","properties":[]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n    choices: string[];\n    hasOpenChoice?: boolean;\n    shuffleOptions?: boolean;\n}","properties":[]},{"id":"NextQuestionBranching","name":"NextQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.NextQuestion;\n}","properties":[]},{"id":"PartialWithRequired","name":"PartialWithRequired","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}","properties":[]},{"id":"PostHogAutocaptureElement","name":"PostHogAutocaptureElement","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} & PostHogEventProperties","properties":[]},{"id":"PostHogAutocaptureNavigationTrackerOptions","name":"PostHogAutocaptureNavigationTrackerOptions","path":"dist/types.d.ts","example":"{\n    routeToName?: (name: string, params: any) => string;\n    routeToProperties?: (name: string, params: any) => Record<string, any>;\n}","properties":[]},{"id":"PostHogAutocaptureOptions","name":"PostHogAutocaptureOptions","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?: PostHogAutocaptureNavigationTrackerOptions;\n    navigationRef?: PostHogNavigationRef;\n}","properties":[]},{"id":"PostHogCaptureOptions","name":"PostHogCaptureOptions","path":"../core/src/types.ts","example":"{\n    uuid?: string;\n    timestamp?: Date;\n    disableGeoip?: boolean;\n}","properties":[]},{"id":"PostHogCoreOptions","name":"PostHogCoreOptions","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    evaluationEnvironments?: readonly string[];\n}","properties":[]},{"id":"PostHogCustomAppProperties","name":"PostHogCustomAppProperties","path":"dist/types.d.ts","properties":[{"name":"$app_build","type":"string | null","description":"Build number like \"1.2.2\" or \"122\""},{"name":"$app_name","type":"string | null","description":"Name of the app as displayed below the icon like \"PostHog\""},{"name":"$app_namespace","type":"string | null","description":"Namespace of the app usually like \"com.posthog.app\""},{"name":"$app_version","type":"string | null","description":"Human friendly app version like what a user would see in the app store like \"1.2.2\""},{"name":"$device_manufacturer","type":"string | null","description":"Manufacturer like \"Apple\", \"Samsung\" or \"Android\""},{"name":"$device_model","type":"string | null","description":"Model identifier like \"iPhone13,2\" or \"SM-S921B\""},{"name":"$device_name","type":"string | null","description":"Readable model name like \"iPhone 12\" or \"Samsung Galaxy S24\""},{"name":"$device_type","type":"string | null","description":"Device type (\"Mobile\" | \"Desktop\" | \"Web\")"},{"name":"$locale","type":"string | null","description":"Locale (language) of the device like \"en-US\""},{"name":"$os_name","type":"string | null","description":"Operating system name like iOS or Android"},{"name":"$os_version","type":"string | null","description":"Operating system version \"14.0\""},{"name":"$timezone","type":"string | null","description":"Timezone of the device like \"Europe/Berlin\""}]},{"id":"PostHogCustomStorage","name":"PostHogCustomStorage","path":"dist/types.d.ts","properties":[{"name":"getItem","type":"(key: string) => string | null | Promise<string | null>"},{"name":"setItem","type":"(key: string, value: string) => void | Promise<void>"}]},{"id":"PostHogEventProperties","name":"PostHogEventProperties","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: 'user@example.com',\n        name: 'John Doe'\n    }\n}","properties":[]},{"id":"PostHogFeatureFlagDetails","name":"PostHogFeatureFlagDetails","path":"../core/src/types.ts","example":"\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"","properties":[]},{"id":"PostHogFetchOptions","name":"PostHogFetchOptions","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}","properties":[]},{"id":"PostHogFetchResponse","name":"PostHogFetchResponse","path":"../core/src/types.ts","example":"{\n    status: number;\n    text: () => Promise<string>;\n    json: () => Promise<any>;\n}","properties":[]},{"id":"PostHogFlagsResponse","name":"PostHogFlagsResponse","path":"../core/src/types.ts","example":"Omit<PostHogRemoteConfig, '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}","properties":[]},{"id":"PostHogGroupProperties","name":"PostHogGroupProperties","path":"../core/src/types.ts","example":"{\n    [type: string]: string | number;\n}","properties":[]},{"id":"PostHogNavigationRef","name":"PostHogNavigationRef","path":"dist/types.d.ts","example":"{\n    getCurrentRoute(): any | undefined;\n    isReady: () => boolean;\n    current?: PostHogNavigationRef | any | undefined;\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"dist/posthog-rn.d.ts","properties":[{"name":"captureAppLifecycleEvents","type":"boolean","description":"Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded. By default is false. Application Installed and Application Updated events are not supported with persistence set to 'memory'."},{"name":"customAppProperties","type":"PostHogCustomAppProperties | ((properties: PostHogCustomAppProperties) => PostHogCustomAppProperties)","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"},{"name":"customStorage","type":"PostHogCustomStorage","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, PostHog 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."},{"name":"enablePersistSessionIdAcrossRestart","type":"boolean","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. Defaults to false"},{"name":"enableSessionReplay","type":"boolean","description":"Enable Recording of Session Replays for Android and iOS Requires Record user sessions to be enabled in the PostHog Project Settings Defaults to false"},{"name":"errorTracking","type":"ErrorTrackingOptions","description":"Error Tracking Configuration"},{"name":"persistence","type":"'memory' | 'file'","description":"Allows you to provide the storage type. By default 'file'. 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage."},{"name":"sessionReplayConfig","type":"PostHogSessionReplayConfig","description":"Configuration for Session Replay"}]},{"id":"PostHogPersistedProperty","name":"PostHogPersistedProperty","path":"../core/src/types.ts","properties":[{"name":"AnonymousId","type":"\"anonymous_id\""},{"name":"BootstrapFeatureFlagDetails","type":"\"bootstrap_feature_flag_details\""},{"name":"BootstrapFeatureFlagPayloads","type":"\"bootstrap_feature_flag_payloads\""},{"name":"BootstrapFeatureFlags","type":"\"bootstrap_feature_flags\""},{"name":"DistinctId","type":"\"distinct_id\""},{"name":"FeatureFlagDetails","type":"\"feature_flag_details\""},{"name":"FeatureFlagPayloads","type":"\"feature_flag_payloads\""},{"name":"FeatureFlags","type":"\"feature_flags\""},{"name":"FlagsEndpointWasHit","type":"\"flags_endpoint_was_hit\""},{"name":"GroupProperties","type":"\"group_properties\""},{"name":"InstalledAppBuild","type":"\"installed_app_build\""},{"name":"InstalledAppVersion","type":"\"installed_app_version\""},{"name":"OptedOut","type":"\"opted_out\""},{"name":"OverrideFeatureFlags","type":"\"override_feature_flags\""},{"name":"PersonProperties","type":"\"person_properties\""},{"name":"Props","type":"\"props\""},{"name":"Queue","type":"\"queue\""},{"name":"RemoteConfig","type":"\"remote_config\""},{"name":"SessionId","type":"\"session_id\""},{"name":"SessionLastTimestamp","type":"\"session_timestamp\""},{"name":"SessionReplay","type":"\"session_replay\""},{"name":"SessionStartTimestamp","type":"\"session_start_timestamp\""},{"name":"SurveyLastSeenDate","type":"\"survey_last_seen_date\""},{"name":"Surveys","type":"\"surveys\""},{"name":"SurveysSeen","type":"\"surveys_seen\""}]},{"id":"PostHogProviderProps","name":"PostHogProviderProps","path":"dist/PostHogProvider.d.ts","properties":[{"name":"apiKey","type":"string","description":"Your PostHog API key"},{"name":"autocapture","type":"boolean | PostHogAutocaptureOptions","description":"Autocapture configuration - can be a boolean or detailed options"},{"name":"children","type":"React.ReactNode","description":"The child components to render within the PostHog context"},{"name":"client","type":"PostHog","description":"An existing PostHog client instance"},{"name":"debug","type":"boolean","description":"Enable debug mode for additional logging"},{"name":"options","type":"PostHogOptions","description":"PostHog configuration options"},{"name":"style","type":"StyleProp<ViewStyle>","description":"Custom styles for the provider wrapper View"}]},{"id":"PostHogRemoteConfig","name":"PostHogRemoteConfig","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}","properties":[]},{"id":"PostHogSessionReplayConfig","name":"PostHogSessionReplayConfig","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}","properties":[]},{"id":"PostHogSurveyProviderProps","name":"PostHogSurveyProviderProps","path":"dist/surveys/PostHogSurveyProvider.d.ts","example":"{\n    defaultSurveyAppearance?: SurveyAppearance;\n    overrideAppearanceWithDefault?: boolean;\n    client?: PostHog;\n    children: React.ReactNode;\n}","properties":[]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Rating;\n    display: SurveyRatingDisplay;\n    scale: 3 | 5 | 7 | 10;\n    lowerBoundLabel: string;\n    upperBoundLabel: string;\n}","properties":[]},{"id":"ResponseBasedBranching","name":"ResponseBasedBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.ResponseBased;\n    responseValues: Record<string, any>;\n}","properties":[]},{"id":"RetriableOptions","name":"RetriableOptions","path":"../core/src/utils/index.ts","properties":[{"name":"retryCheck","type":"(err: unknown) => boolean"},{"name":"retryCount","type":"number"},{"name":"retryDelay","type":"number"}]},{"id":"SpecificQuestionBranching","name":"SpecificQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.SpecificQuestion;\n    index: number;\n}","properties":[]},{"id":"Survey","name":"Survey","path":"../core/src/types.ts","example":"{\n    id: string;\n    name: string;\n    description?: string;\n    type: SurveyType;\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}","properties":[]},{"id":"SurveyActionType","name":"SurveyActionType","path":"../core/src/types.ts","example":"{\n    id: number;\n    name?: string;\n    steps?: ActionStepType[];\n}","properties":[]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"../core/src/types.ts","example":"{\n    backgroundColor?: string;\n    submitButtonColor?: string;\n    submitButtonText?: string;\n    submitButtonTextColor?: string;\n    ratingButtonColor?: string;\n    ratingButtonActiveColor?: 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}","properties":[]},{"id":"SurveyAppearanceTheme","name":"SurveyAppearanceTheme","path":"dist/surveys/surveys-utils.d.ts","example":"\"widgetSelector\" | \"widgetType\" | \"widgetColor\" | \"widgetLabel\" | \"shuffleQuestions\"","properties":[]},{"id":"SurveyMatchType","name":"SurveyMatchType","path":"../core/src/types.ts","properties":[{"name":"Exact","type":"\"exact\""},{"name":"Icontains","type":"\"icontains\""},{"name":"IsNot","type":"\"is_not\""},{"name":"NotIcontains","type":"\"not_icontains\""},{"name":"NotRegex","type":"\"not_regex\""},{"name":"Regex","type":"\"regex\""}]},{"id":"SurveyModalProps","name":"SurveyModalProps","path":"dist/surveys/components/SurveyModal.d.ts","example":"{\n    survey: Survey;\n    appearance: SurveyAppearanceTheme;\n    onShow: () => void;\n    onClose: (submitted: boolean) => void;\n}","properties":[]},{"id":"SurveyPosition","name":"SurveyPosition","path":"../core/src/types.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"../core/src/types.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBase","name":"SurveyQuestionBase","path":"../core/src/types.ts","example":"{\n    question: string;\n    id: string;\n    description?: string;\n    descriptionContentType?: SurveyQuestionDescriptionContentType;\n    optional?: boolean;\n    buttonText?: string;\n    originalQuestionIndex: number;\n    branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n}","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"../core/src/types.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"../core/src/types.ts","properties":[{"name":"Html","type":"\"html\""},{"name":"Text","type":"\"text\""}]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"../core/src/types.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRatingDisplay","name":"SurveyRatingDisplay","path":"../core/src/types.ts","properties":[{"name":"Emoji","type":"\"emoji\""},{"name":"Number","type":"\"number\""}]},{"id":"SurveyResponse","name":"SurveyResponse","path":"../core/src/types.ts","example":"{\n    surveys: Survey[];\n}","properties":[]},{"id":"SurveyType","name":"SurveyType","path":"../core/src/types.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"../core/src/types.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHogProvider","title":"PostHogProvider","params":[{"name":"{ children, client, options, apiKey, autocapture, style, debug, }","type":"PostHogProviderProps","isOptional":false,"description":""}],"details":null,"category":"Initialization","examples":[{"id":"add_to_app.(js|ts)","code":"\n\n// Add to App.(js|ts)\nimport { usePostHog, PostHogProvider } from 'posthog-react-native'\n\nexport function MyApp() {\n    return (\n        <PostHogProvider apiKey=\"<ph_project_api_key>\" options={{\n            host: '<ph_client_api_host>',\n        }}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n// And access the PostHog client via the usePostHog hook\nimport { usePostHog } from 'posthog-react-native'\n\nconst MyComponent = () => {\n    const posthog = usePostHog()\n\n    useEffect(() => {\n        posthog.capture(\"event_name\")\n    }, [posthog])\n}\n\n\n\n","name":"Add to App.(js|ts)"},{"id":"using_with_existing_client","code":"\n\n// Using with existing client\nimport { PostHog } from 'posthog-react-native'\n\nconst posthog = new PostHog('<ph_project_api_key>', {\n    host: '<ph_client_api_host>'\n})\n\nexport function MyApp() {\n    return (\n        <PostHogProvider client={posthog}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n\n\n","name":"Using with existing client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JSX.Element | null","name":"JSX.Element | null"},"description":"PostHogProvider is a React component that provides PostHog functionality to your React Native app. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nAutocapturing navigation requires further configuration. See the [React Native SDK navigation docs](https://posthog.com/docs/libraries/react-native#capturing-screen-views) for more information about autocapturing navigation.\nThis is the recommended way to set up PostHog for React Native. This utilizes the Context API to pass the PostHog client around, enable autocapture."},{"id":"PostHog","path":"dist/posthog-rn.d.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"PostHog configuration options"}],"details":null,"category":"Initialization","examples":[{"id":"posthog.ts","code":"\n\n// posthog.ts\nimport PostHog from 'posthog-react-native'\n\nexport const posthog = new PostHog('<ph_project_api_key>', {\n  host: '<ph_client_api_host>'\n})\n\n// Then you can access PostHog by importing your instance\n// Another file:\nimport { posthog } from './posthog'\n\nexport function MyApp1() {\n    useEffect(async () => {\n        posthog.capture('event_name')\n    }, [posthog])\n\n    return <View>Your app code</View>\n}\n\n\n\n","name":"posthog.ts"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Creates a new PostHog instance for React Native. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nIf you prefer not to use the PostHogProvider, you can initialize PostHog in its own file and import the instance from there."},{"id":"alias","path":"dist/posthog-rn.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"The alias to assign to the current user"}],"details":null,"category":"Identification","examples":[{"id":"set_alias_for_current_user","code":"\n\n// set alias for current user\nposthog.alias('distinct_id')\n\n\n\n","name":"set alias for current user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"captureException","path":"dist/posthog-rn.d.ts","title":"captureException","params":[{"name":"error","type":"Error | unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"PostHogEventProperties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a caught exception manually"},{"id":"fetch","path":"dist/posthog-rn.d.ts","title":"fetch","params":[{"name":"url","type":"string","isOptional":false,"description":""},{"name":"options","type":"PostHogFetchOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"fetch","code":"// Generated example for fetch\nposthog.fetch();","name":"Generated example for fetch"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFetchResponse>","name":"Promise<PostHogFetchResponse>"}},{"id":"flush","path":"dist/posthog-rn.d.ts","title":"flush","params":[],"details":null,"category":"Capture","examples":[{"id":"manually_flush_the_queue","code":"\n\n// manually flush the queue\nawait posthog.flush()\n\n\n\n","name":"manually flush the queue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"getCommonEventProperties","path":"dist/posthog-rn.d.ts","title":"getCommonEventProperties","params":[],"details":null,"category":"","examples":[{"id":"getcommoneventproperties","code":"// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();","name":"Generated example for getCommonEventProperties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogEventProperties","name":"PostHogEventProperties"}},{"id":"getCustomUserAgent","path":"dist/posthog-rn.d.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"","examples":[{"id":"getcustomuseragent","code":"// Generated example for getCustomUserAgent\nposthog.getCustomUserAgent();","name":"Generated example for getCustomUserAgent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getDistinctId","path":"dist/posthog-rn.d.ts","title":"getDistinctId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_current_distinct_id","code":"\n\n// get current distinct ID\nconst distinctId = posthog.getDistinctId()\n\n\n\n","name":"get current distinct ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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 PostHog or the ID that has been passed by a call to identify()."},{"id":"getFeatureFlag","path":"dist/posthog-rn.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_value","code":"\n\n// get feature flag value\nconst value = posthog.getFeatureFlag('key-for-your-boolean-flag')\n\n\n\n","name":"get feature flag value"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"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."},{"id":"getFeatureFlagPayload","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_payload","code":"\n\n// get feature flag payload\nconst payload = posthog.getFeatureFlagPayload('key-for-your-multivariate-flag')\n\n\n\n","name":"get feature flag payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType | undefined","name":"JsonType | undefined"},"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."},{"id":"getLibraryId","path":"dist/posthog-rn.d.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getLibraryVersion","path":"dist/posthog-rn.d.ts","title":"getLibraryVersion","params":[],"details":null,"category":"","examples":[{"id":"getlibraryversion","code":"// Generated example for getLibraryVersion\nposthog.getLibraryVersion();","name":"Generated example for getLibraryVersion"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getPersistedProperty","path":"dist/posthog-rn.d.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"getpersistedproperty","code":"// Generated example for getPersistedProperty\nposthog.getPersistedProperty();","name":"Generated example for getPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"T | undefined","name":"T | undefined"}},{"id":"getSessionId","path":"dist/posthog-rn.d.ts","title":"getSessionId","params":[],"details":null,"category":"","examples":[{"id":"getsessionid","code":"// Generated example for getSessionId\nposthog.getSessionId();","name":"Generated example for getSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getSurveys","path":"dist/posthog-rn.d.ts","title":"getSurveys","params":[],"details":null,"category":"","examples":[{"id":"getsurveys","code":"// Generated example for getSurveys\nposthog.getSurveys();","name":"Generated example for getSurveys"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"}},{"id":"group","path":"dist/posthog-rn.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"The type of group (e.g. 'company', 'team')"},{"name":"groupKey","type":"string","isOptional":false,"description":"The unique identifier for the group"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to set for the group"}],"details":null,"category":"Group analytics","examples":[{"id":"associate_with_a_group","code":"\n\n// associate with a group\nposthog.group('company', 'company_id_in_your_db')\n\n\n","name":"associate with a group"},{"id":"associate_with_a_group_and_update_properties","code":"\n\n// associate with a group and update properties\nposthog.group('company', 'company_id_in_your_db', {\n  name: 'Awesome Inc.',\n  employees: 11,\n})\n\n\n\n","name":"associate with a group and update properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"identify","path":"dist/posthog-rn.d.ts","title":"identify","params":[{"name":"distinctId","type":"string","isOptional":true,"description":"A unique identifier for your user. Typically either their email or database ID."},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional dictionary with key:value pairs to set the person properties"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"details":null,"category":"Identification","examples":[{"id":"basic_identify","code":"\n\n// Basic identify\nposthog.identify('distinctID', {\n  email: 'user@posthog.com',\n  name: 'My Name'\n})\n\n\n","name":"Basic identify"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nposthog.identify('distinctID', {\n  $set: {\n    email: 'user@posthog.com',\n    name: 'My Name'\n  },\n  $set_once: {\n    date_of_first_log_in: '2024-03-01'\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates events with a specific user. Learn more about [identifying users](https://posthog.com/docs/product-analytics/identify)"},{"id":"initReactNativeNavigation","path":"dist/posthog-rn.d.ts","title":"initReactNativeNavigation","params":[{"name":"options","type":"PostHogAutocaptureOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"initreactnativenavigation","code":"// Generated example for initReactNativeNavigation\nposthog.initReactNativeNavigation();","name":"Generated example for initReactNativeNavigation"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"}},{"id":"isFeatureEnabled","path":"dist/posthog-rn.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"check_if_feature_flag_is_enabled","code":"\n\n// check if feature flag is enabled\nconst isEnabled = posthog.isFeatureEnabled('key-for-your-boolean-flag')\n\n\n\n","name":"check if feature flag is enabled"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"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."},{"id":"optIn","path":"dist/posthog-rn.d.ts","title":"optIn","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_in_to_tracking","code":"\n\n// opt in to tracking\nposthog.optIn()\n\n\n\n","name":"opt in to tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Opts the user in to data capture.\nBy default, PostHog 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."},{"id":"optOut","path":"dist/posthog-rn.d.ts","title":"optOut","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_out_of_tracking","code":"\n\n// opt out of tracking\nposthog.optOut()\n\n\n\n","name":"opt out of tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"register","path":"dist/posthog-rn.d.ts","title":"register","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":"An associative array of properties to store about the user"}],"details":null,"category":"Capture","examples":[{"id":"register_super_properties","code":"\n\n// register super properties\nposthog.register({\n    'icecream pref': 'vanilla',\n    team_id: 22,\n})\n\n\n\n","name":"register super properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"reloadFeatureFlags","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags","code":"\n\n// reload feature flags\nposthog.reloadFeatureFlags()\n\n\n\n","name":"reload feature flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Reloads feature flags from the server.\nPostHog 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."},{"id":"reloadFeatureFlagsAsync","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlagsAsync","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags_and_get_result","code":"\n\n// reload feature flags and get result\nposthog.reloadFeatureFlagsAsync().then((refreshedFlags) => console.log(refreshedFlags))\n\n\n\n","name":"reload feature flags and get result"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, boolean | string> | undefined>","name":"Promise<Record<string, boolean | string> | undefined>"},"description":"Reloads feature flags from the server asynchronously.\nPostHog 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."},{"id":"reset","path":"dist/posthog-rn.d.ts","title":"reset","params":[],"details":null,"category":"Identification","examples":[{"id":"reset_after_logout","code":"\n\n// reset after logout\nposthog.reset()\n\n\n\n","name":"reset after logout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"resetGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetGroupPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_group_properties_for_flags","code":"\n\n// reset group properties for flags\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":"reset group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets group properties for feature flag evaluation."},{"id":"resetPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_person_properties_for_flags","code":"\n\n// reset person properties for flags\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":"reset person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets person properties for feature flag evaluation."},{"id":"resetSessionId","path":"dist/posthog-rn.d.ts","title":"resetSessionId","params":[],"details":null,"category":"","examples":[{"id":"resetsessionid","code":"// Generated example for resetSessionId\nposthog.resetSessionId();","name":"Generated example for resetSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"screen","path":"dist/posthog-rn.d.ts","title":"screen","params":[{"name":"name","type":"string","isOptional":false,"description":"The name of the screen"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to include with the screen event"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"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.","category":"Capture","examples":[{"id":"basic_screen_capture","code":"\n\n// Basic screen capture\nposthog.screen('dashboard')\n\n\n","name":"Basic screen capture"},{"id":"screen_capture_with_properties","code":"\n\n// Screen capture with properties\nposthog.screen('dashboard', {\n    background: 'blue',\n    hero: 'superhog',\n})\n\n\n\n","name":"Screen capture with properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Captures a screen view event."},{"id":"setGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"Record<string, Record<string, string>>","isOptional":false,"description":"The group properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_group_properties_for_flags","code":"\n\n// set group properties for flags\nposthog.setGroupPropertiesForFlags({'company': {'property1': 'value', property2: 'value2'}})\n\n\n\n","name":"set group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets group properties for feature flag evaluation.\nThese properties are automatically attached to the current group (set via posthog.group()). When you change the group, these properties are reset."},{"id":"setPersistedProperty","path":"dist/posthog-rn.d.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""},{"name":"value","type":"T | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"setpersistedproperty","code":"// Generated example for setPersistedProperty\nposthog.setPersistedProperty();","name":"Generated example for setPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"setPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Record<string, string>","isOptional":false,"description":"The person properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_person_properties_for_flags","code":"\n\n// set person properties for flags\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n\n","name":"set person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"unregister","path":"dist/posthog-rn.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":null,"category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('icecream pref')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"autocapture","path":"dist/posthog-rn.d.ts","title":"autocapture","params":[{"name":"eventType","type":"string","isOptional":false,"description":""},{"name":"elements","type":"PostHogAutocaptureElement[]","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"autocapture","code":"// Generated example for autocapture\nposthog.autocapture();","name":"Generated example for autocapture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"capture","path":"dist/posthog-rn.d.ts","title":"capture","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capture","code":"// Generated example for capture\nposthog.capture();","name":"Generated example for capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureTraceFeedback","path":"dist/posthog-rn.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"dist/posthog-rn.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"flagsAsync","path":"dist/posthog-rn.d.ts","title":"flagsAsync","params":[{"name":"sendAnonDistinctId","type":"boolean","isOptional":true,"description":""},{"name":"fetchConfig","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"flagsasync","code":"// Generated example for flagsAsync\nposthog.flagsAsync();","name":"Generated example for flagsAsync"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse | undefined>","name":"Promise<PostHogFlagsResponse | undefined>"},"description":"* ** FEATURE FLAGS *"},{"id":"getAnonymousId","path":"dist/posthog-rn.d.ts","title":"getAnonymousId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_the_anonymous_id","code":"\n\n// get the anonymous ID\nconst anonId = posthog.getAnonymousId()\nconsole.log('Anonymous ID:', anonId)\n\n\n\n","name":"get the anonymous ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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."},{"id":"getFeatureFlagDetails","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetails","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagdetails","code":"// Generated example for getFeatureFlagDetails\nposthog.getFeatureFlagDetails();","name":"Generated example for getFeatureFlagDetails"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFeatureFlagDetails | undefined","name":"PostHogFeatureFlagDetails | undefined"}},{"id":"getFeatureFlagPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloads","code":"// Generated example for getFeatureFlagPayloads\nposthog.getFeatureFlagPayloads();","name":"Generated example for getFeatureFlagPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlagPayloads'] | undefined","name":"PostHogFlagsResponse['featureFlagPayloads'] | undefined"}},{"id":"getFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflags","code":"// Generated example for getFeatureFlags\nposthog.getFeatureFlags();","name":"Generated example for getFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"getFeatureFlagsAndPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloads","code":"// Generated example for getFeatureFlagsAndPayloads\nposthog.getFeatureFlagsAndPayloads();","name":"Generated example for getFeatureFlagsAndPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }","name":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }"}},{"id":"getKnownFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getKnownFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getknownfeatureflags","code":"// Generated example for getKnownFeatureFlags\nposthog.getKnownFeatureFlags();","name":"Generated example for getKnownFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"groupIdentify","path":"dist/posthog-rn.d.ts","title":"groupIdentify","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentify","code":"// Generated example for groupIdentify\nposthog.groupIdentify();","name":"Generated example for groupIdentify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"groups","path":"dist/posthog-rn.d.ts","title":"groups","params":[{"name":"groups","type":"PostHogGroupProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"groups","code":"// Generated example for groups\nposthog.groups();","name":"Generated example for groups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"on","path":"dist/posthog-rn.d.ts","title":"on","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"on","code":"// Generated example for on\nposthog.on();","name":"Generated example for on"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlag","path":"dist/posthog-rn.d.ts","title":"onFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(value: FeatureFlagValue) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflag","code":"// Generated example for onFeatureFlag\nposthog.onFeatureFlag();","name":"Generated example for onFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlags","path":"dist/posthog-rn.d.ts","title":"onFeatureFlags","params":[{"name":"cb","type":"(flags: PostHogFlagsResponse['featureFlags']) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflags","code":"// Generated example for onFeatureFlags\nposthog.onFeatureFlags();","name":"Generated example for onFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"overrideFeatureFlag","path":"dist/posthog-rn.d.ts","title":"overrideFeatureFlag","params":[{"name":"flags","type":"PostHogFlagsResponse['featureFlags'] | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"overridefeatureflag","code":"// Generated example for overrideFeatureFlag\nposthog.overrideFeatureFlag();","name":"Generated example for overrideFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"registerForSession","path":"dist/posthog-rn.d.ts","title":"registerForSession","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"registerforsession","code":"// Generated example for registerForSession\nposthog.registerForSession();","name":"Generated example for registerForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"reloadRemoteConfigAsync","path":"dist/posthog-rn.d.ts","title":"reloadRemoteConfigAsync","params":[],"details":null,"category":"","examples":[{"id":"reloadremoteconfigasync","code":"// Generated example for reloadRemoteConfigAsync\nposthog.reloadRemoteConfigAsync();","name":"Generated example for reloadRemoteConfigAsync"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"setupBootstrap","path":"dist/posthog-rn.d.ts","title":"setupBootstrap","params":[{"name":"options","type":"Partial<PostHogCoreOptions>","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"setupbootstrap","code":"// Generated example for setupBootstrap\nposthog.setupBootstrap();","name":"Generated example for setupBootstrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"unregisterForSession","path":"dist/posthog-rn.d.ts","title":"unregisterForSession","params":[{"name":"property","type":"string","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"unregisterforsession","code":"// Generated example for unregisterForSession\nposthog.unregisterForSession();","name":"Generated example for unregisterForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"addPendingPromise","path":"dist/posthog-rn.d.ts","title":"addPendingPromise","params":[{"name":"promise","type":"Promise<T>","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"addpendingpromise","code":"// Generated example for addPendingPromise\nposthog.addPendingPromise();","name":"Generated example for addPendingPromise"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<T>","name":"Promise<T>"}},{"id":"aliasStateless","path":"dist/posthog-rn.d.ts","title":"aliasStateless","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstateless","code":"// Generated example for aliasStateless\nposthog.aliasStateless();","name":"Generated example for aliasStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"aliasStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"aliasStatelessImmediate","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstatelessimmediate","code":"// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();","name":"Generated example for aliasStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"captureStateless","path":"dist/posthog-rn.d.ts","title":"captureStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestateless","code":"// Generated example for captureStateless\nposthog.captureStateless();","name":"Generated example for captureStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"captureStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestatelessimmediate","code":"// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();","name":"Generated example for captureStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"debug","path":"dist/posthog-rn.d.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":""}],"details":"Debug mode logs all PostHog calls to the console for troubleshooting. This is useful during development to understand what data is being sent.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"enqueue","path":"dist/posthog-rn.d.ts","title":"enqueue","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"enqueue","code":"// Generated example for enqueue\nposthog.enqueue();","name":"Generated example for enqueue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** QUEUEING AND FLUSHING *"},{"id":"getCustomHeaders","path":"dist/posthog-rn.d.ts","title":"getCustomHeaders","params":[],"details":null,"category":"","examples":[{"id":"getcustomheaders","code":"// Generated example for getCustomHeaders\nposthog.getCustomHeaders();","name":"Generated example for getCustomHeaders"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        [key: string]: string;\n    }","name":"{\n        [key: string]: string;\n    }"}},{"id":"getFeatureFlagDetailsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailsstateless","code":"// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();","name":"Generated example for getFeatureFlagDetailsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFeatureFlagDetails | undefined>","name":"Promise<PostHogFeatureFlagDetails | undefined>"}},{"id":"getFeatureFlagDetailStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailstateless","code":"// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();","name":"Generated example for getFeatureFlagDetailStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>","name":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>"}},{"id":"getFeatureFlagPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadsstateless","code":"// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();","name":"Generated example for getFeatureFlagPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>","name":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>"}},{"id":"getFeatureFlagPayloadStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadstateless","code":"// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();","name":"Generated example for getFeatureFlagPayloadStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"}},{"id":"getFeatureFlagsAndPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloadsstateless","code":"// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();","name":"Generated example for getFeatureFlagsAndPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsstateless","code":"// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();","name":"Generated example for getFeatureFlagsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagstateless","code":"// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();","name":"Generated example for getFeatureFlagStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>","name":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>"}},{"id":"getFlags","path":"dist/posthog-rn.d.ts","title":"getFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"extraPayload","type":"Record<string, any>","isOptional":true,"description":""},{"name":"fetchConfig","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getflags","code":"// Generated example for getFlags\nposthog.getFlags();","name":"Generated example for getFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse | undefined>","name":"Promise<PostHogFlagsResponse | undefined>"},"description":"* ** FEATURE FLAGS *"},{"id":"getRemoteConfig","path":"dist/posthog-rn.d.ts","title":"getRemoteConfig","params":[],"details":null,"category":"","examples":[{"id":"getremoteconfig","code":"// Generated example for getRemoteConfig\nposthog.getRemoteConfig();","name":"Generated example for getRemoteConfig"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"getSurveysStateless","path":"dist/posthog-rn.d.ts","title":"getSurveysStateless","params":[],"details":null,"category":"","examples":[{"id":"getsurveysstateless","code":"// Generated example for getSurveysStateless\nposthog.getSurveysStateless();","name":"Generated example for getSurveysStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"},"description":"* ** SURVEYS *"},{"id":"groupIdentifyStateless","path":"dist/posthog-rn.d.ts","title":"groupIdentifyStateless","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""},{"name":"distinctId","type":"string","isOptional":true,"description":""},{"name":"eventProperties","type":"PostHogEventProperties","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentifystateless","code":"// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();","name":"Generated example for groupIdentifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"identifyStateless","path":"dist/posthog-rn.d.ts","title":"identifyStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystateless","code":"// Generated example for identifyStateless\nposthog.identifyStateless();","name":"Generated example for identifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** TRACKING *"},{"id":"identifyStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"identifyStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystatelessimmediate","code":"// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();","name":"Generated example for identifyStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"logMsgIfDebug","path":"dist/posthog-rn.d.ts","title":"logMsgIfDebug","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"logmsgifdebug","code":"// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();","name":"Generated example for logMsgIfDebug"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"sendImmediate","path":"dist/posthog-rn.d.ts","title":"sendImmediate","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"sendimmediate","code":"// Generated example for sendImmediate\nposthog.sendImmediate();","name":"Generated example for sendImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"shutdown","path":"dist/posthog-rn.d.ts","title":"shutdown","params":[{"name":"shutdownTimeoutMs","type":"number","isOptional":true,"description":"Maximum time to wait for shutdown in milliseconds"}],"details":null,"category":"Initialization","examples":[{"id":"shutdown_before_process_exit","code":"\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n  await posthog.shutdown()\n  process.exit(0)\n})\n\n\n\n","name":"shutdown before process exit"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Shuts down the PostHog 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 PostHog instance after calling it. Use flush() for per-request cleanup instead."},{"id":"wrap","path":"dist/posthog-rn.d.ts","title":"wrap","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"wrap","code":"// Generated example for wrap\nposthog.wrap();","name":"Generated example for wrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}}]}],"version":"4.10.1","categories":["Initialization","Identification","Capture","Error tracking","Feature flags","Group analytics","Privacy","LLM analytics"],"referenceId":"posthog-react-native"},"createdAt":"2025-10-25T22:45:02.144Z","updatedAt":"2025-10-25T22:45:02.144Z","publishedAt":"2025-10-25T22:45:02.138Z"}},{"id":21,"attributes":{"referenceId":"posthog-react-native","version":"4.10.2","data":{"id":"posthog-react-native-4.10.2","info":{"id":"posthog-react-native","title":"PostHog React Native SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"4.10.2","slugPrefix":"posthog-react-native","description":"PostHog React Native SDK allows you to capture events and send them to PostHog from your React Native applications."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"../core/src/types.ts","properties":[{"name":"Contains","type":"\"contains\""},{"name":"Exact","type":"\"exact\""},{"name":"Regex","type":"\"regex\""}]},{"id":"ActionStepType","name":"ActionStepType","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}","properties":[]},{"id":"AutocaptureOptions","name":"AutocaptureOptions","path":"dist/error-tracking/index.d.ts","properties":[{"name":"console","type":"boolean | LogLevel[]"},{"name":"uncaughtExceptions","type":"boolean"},{"name":"unhandledRejections","type":"boolean"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Open;\n}","properties":[]},{"id":"Compression","name":"Compression","path":"../core/src/types.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"EndBranching","name":"EndBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.End;\n}","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"dist/error-tracking/index.d.ts","properties":[{"name":"autocapture","type":"AutocaptureOptions | boolean"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"../core/src/types.ts","example":"{\n    code: string | undefined;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","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}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"../core/src/types.ts","example":"{\n    id: number | undefined;\n    version: number | undefined;\n    description: string | undefined;\n    payload: string | undefined;\n}","properties":[]},{"id":"FeatureFlagValue","name":"FeatureFlagValue","path":"../core/src/types.ts","example":"string | boolean","properties":[]},{"id":"FeatureFlagWithPayload","name":"FeatureFlagWithPayload","path":"dist/hooks/useFeatureFlag.d.ts","example":"[FeatureFlagValue | undefined, JsonType | undefined]","properties":[]},{"id":"JsonType","name":"JsonType","path":"../core/src/types.ts","example":"string | number | boolean | null | {\n    [key: string]: JsonType;\n} | Array<JsonType> | JsonType[]","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Link;\n    link?: string;\n}","properties":[]},{"id":"Logger","name":"Logger","path":"../core/src/types.ts","example":"{\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}","properties":[]},{"id":"LogLevel","name":"LogLevel","path":"dist/error-tracking/index.d.ts","example":"\"debug\" | \"log\" | \"info\" | \"warn\" | \"error\"","properties":[]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n    choices: string[];\n    hasOpenChoice?: boolean;\n    shuffleOptions?: boolean;\n}","properties":[]},{"id":"NextQuestionBranching","name":"NextQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.NextQuestion;\n}","properties":[]},{"id":"PartialWithRequired","name":"PartialWithRequired","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}","properties":[]},{"id":"PostHogAutocaptureElement","name":"PostHogAutocaptureElement","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} & PostHogEventProperties","properties":[]},{"id":"PostHogAutocaptureNavigationTrackerOptions","name":"PostHogAutocaptureNavigationTrackerOptions","path":"dist/types.d.ts","example":"{\n    routeToName?: (name: string, params: any) => string;\n    routeToProperties?: (name: string, params: any) => Record<string, any>;\n}","properties":[]},{"id":"PostHogAutocaptureOptions","name":"PostHogAutocaptureOptions","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?: PostHogAutocaptureNavigationTrackerOptions;\n    navigationRef?: PostHogNavigationRef;\n}","properties":[]},{"id":"PostHogCaptureOptions","name":"PostHogCaptureOptions","path":"../core/src/types.ts","example":"{\n    uuid?: string;\n    timestamp?: Date;\n    disableGeoip?: boolean;\n}","properties":[]},{"id":"PostHogCoreOptions","name":"PostHogCoreOptions","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    evaluationEnvironments?: readonly string[];\n}","properties":[]},{"id":"PostHogCustomAppProperties","name":"PostHogCustomAppProperties","path":"dist/types.d.ts","properties":[{"name":"$app_build","type":"string | null","description":"Build number like \"1.2.2\" or \"122\""},{"name":"$app_name","type":"string | null","description":"Name of the app as displayed below the icon like \"PostHog\""},{"name":"$app_namespace","type":"string | null","description":"Namespace of the app usually like \"com.posthog.app\""},{"name":"$app_version","type":"string | null","description":"Human friendly app version like what a user would see in the app store like \"1.2.2\""},{"name":"$device_manufacturer","type":"string | null","description":"Manufacturer like \"Apple\", \"Samsung\" or \"Android\""},{"name":"$device_model","type":"string | null","description":"Model identifier like \"iPhone13,2\" or \"SM-S921B\""},{"name":"$device_name","type":"string | null","description":"Readable model name like \"iPhone 12\" or \"Samsung Galaxy S24\""},{"name":"$device_type","type":"string | null","description":"Device type (\"Mobile\" | \"Desktop\" | \"Web\")"},{"name":"$locale","type":"string | null","description":"Locale (language) of the device like \"en-US\""},{"name":"$os_name","type":"string | null","description":"Operating system name like iOS or Android"},{"name":"$os_version","type":"string | null","description":"Operating system version \"14.0\""},{"name":"$timezone","type":"string | null","description":"Timezone of the device like \"Europe/Berlin\""}]},{"id":"PostHogCustomStorage","name":"PostHogCustomStorage","path":"dist/types.d.ts","properties":[{"name":"getItem","type":"(key: string) => string | null | Promise<string | null>"},{"name":"setItem","type":"(key: string, value: string) => void | Promise<void>"}]},{"id":"PostHogEventProperties","name":"PostHogEventProperties","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: 'user@example.com',\n        name: 'John Doe'\n    }\n}","properties":[]},{"id":"PostHogFeatureFlagDetails","name":"PostHogFeatureFlagDetails","path":"../core/src/types.ts","example":"\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"","properties":[]},{"id":"PostHogFetchOptions","name":"PostHogFetchOptions","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}","properties":[]},{"id":"PostHogFetchResponse","name":"PostHogFetchResponse","path":"../core/src/types.ts","example":"{\n    status: number;\n    text: () => Promise<string>;\n    json: () => Promise<any>;\n}","properties":[]},{"id":"PostHogFlagsResponse","name":"PostHogFlagsResponse","path":"../core/src/types.ts","example":"Omit<PostHogRemoteConfig, '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}","properties":[]},{"id":"PostHogGroupProperties","name":"PostHogGroupProperties","path":"../core/src/types.ts","example":"{\n    [type: string]: string | number;\n}","properties":[]},{"id":"PostHogNavigationRef","name":"PostHogNavigationRef","path":"dist/types.d.ts","example":"{\n    getCurrentRoute(): any | undefined;\n    isReady: () => boolean;\n    current?: PostHogNavigationRef | any | undefined;\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"dist/posthog-rn.d.ts","properties":[{"name":"captureAppLifecycleEvents","type":"boolean","description":"Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded. By default is false. Application Installed and Application Updated events are not supported with persistence set to 'memory'."},{"name":"customAppProperties","type":"PostHogCustomAppProperties | ((properties: PostHogCustomAppProperties) => PostHogCustomAppProperties)","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"},{"name":"customStorage","type":"PostHogCustomStorage","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, PostHog 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."},{"name":"enablePersistSessionIdAcrossRestart","type":"boolean","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. Defaults to false"},{"name":"enableSessionReplay","type":"boolean","description":"Enable Recording of Session Replays for Android and iOS Requires Record user sessions to be enabled in the PostHog Project Settings Defaults to false"},{"name":"errorTracking","type":"ErrorTrackingOptions","description":"Error Tracking Configuration"},{"name":"persistence","type":"'memory' | 'file'","description":"Allows you to provide the storage type. By default 'file'. 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage."},{"name":"sessionReplayConfig","type":"PostHogSessionReplayConfig","description":"Configuration for Session Replay"}]},{"id":"PostHogPersistedProperty","name":"PostHogPersistedProperty","path":"../core/src/types.ts","properties":[{"name":"AnonymousId","type":"\"anonymous_id\""},{"name":"BootstrapFeatureFlagDetails","type":"\"bootstrap_feature_flag_details\""},{"name":"BootstrapFeatureFlagPayloads","type":"\"bootstrap_feature_flag_payloads\""},{"name":"BootstrapFeatureFlags","type":"\"bootstrap_feature_flags\""},{"name":"DistinctId","type":"\"distinct_id\""},{"name":"FeatureFlagDetails","type":"\"feature_flag_details\""},{"name":"FeatureFlagPayloads","type":"\"feature_flag_payloads\""},{"name":"FeatureFlags","type":"\"feature_flags\""},{"name":"FlagsEndpointWasHit","type":"\"flags_endpoint_was_hit\""},{"name":"GroupProperties","type":"\"group_properties\""},{"name":"InstalledAppBuild","type":"\"installed_app_build\""},{"name":"InstalledAppVersion","type":"\"installed_app_version\""},{"name":"OptedOut","type":"\"opted_out\""},{"name":"OverrideFeatureFlags","type":"\"override_feature_flags\""},{"name":"PersonProperties","type":"\"person_properties\""},{"name":"Props","type":"\"props\""},{"name":"Queue","type":"\"queue\""},{"name":"RemoteConfig","type":"\"remote_config\""},{"name":"SessionId","type":"\"session_id\""},{"name":"SessionLastTimestamp","type":"\"session_timestamp\""},{"name":"SessionReplay","type":"\"session_replay\""},{"name":"SessionStartTimestamp","type":"\"session_start_timestamp\""},{"name":"SurveyLastSeenDate","type":"\"survey_last_seen_date\""},{"name":"Surveys","type":"\"surveys\""},{"name":"SurveysSeen","type":"\"surveys_seen\""}]},{"id":"PostHogProviderProps","name":"PostHogProviderProps","path":"dist/PostHogProvider.d.ts","properties":[{"name":"apiKey","type":"string","description":"Your PostHog API key"},{"name":"autocapture","type":"boolean | PostHogAutocaptureOptions","description":"Autocapture configuration - can be a boolean or detailed options"},{"name":"children","type":"React.ReactNode","description":"The child components to render within the PostHog context"},{"name":"client","type":"PostHog","description":"An existing PostHog client instance"},{"name":"debug","type":"boolean","description":"Enable debug mode for additional logging"},{"name":"options","type":"PostHogOptions","description":"PostHog configuration options"},{"name":"style","type":"StyleProp<ViewStyle>","description":"Custom styles for the provider wrapper View"}]},{"id":"PostHogRemoteConfig","name":"PostHogRemoteConfig","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}","properties":[]},{"id":"PostHogSessionReplayConfig","name":"PostHogSessionReplayConfig","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}","properties":[]},{"id":"PostHogSurveyProviderProps","name":"PostHogSurveyProviderProps","path":"dist/surveys/PostHogSurveyProvider.d.ts","example":"{\n    defaultSurveyAppearance?: SurveyAppearance;\n    overrideAppearanceWithDefault?: boolean;\n    client?: PostHog;\n    children: React.ReactNode;\n}","properties":[]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Rating;\n    display: SurveyRatingDisplay;\n    scale: 3 | 5 | 7 | 10;\n    lowerBoundLabel: string;\n    upperBoundLabel: string;\n}","properties":[]},{"id":"ResponseBasedBranching","name":"ResponseBasedBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.ResponseBased;\n    responseValues: Record<string, any>;\n}","properties":[]},{"id":"RetriableOptions","name":"RetriableOptions","path":"../core/src/utils/index.ts","properties":[{"name":"retryCheck","type":"(err: unknown) => boolean"},{"name":"retryCount","type":"number"},{"name":"retryDelay","type":"number"}]},{"id":"SpecificQuestionBranching","name":"SpecificQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.SpecificQuestion;\n    index: number;\n}","properties":[]},{"id":"Survey","name":"Survey","path":"../core/src/types.ts","example":"{\n    id: string;\n    name: string;\n    description?: string;\n    type: SurveyType;\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}","properties":[]},{"id":"SurveyActionType","name":"SurveyActionType","path":"../core/src/types.ts","example":"{\n    id: number;\n    name?: string;\n    steps?: ActionStepType[];\n}","properties":[]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"../core/src/types.ts","example":"{\n    backgroundColor?: string;\n    submitButtonColor?: string;\n    submitButtonText?: string;\n    submitButtonTextColor?: string;\n    ratingButtonColor?: string;\n    ratingButtonActiveColor?: 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}","properties":[]},{"id":"SurveyAppearanceTheme","name":"SurveyAppearanceTheme","path":"dist/surveys/surveys-utils.d.ts","example":"\"widgetSelector\" | \"widgetType\" | \"widgetColor\" | \"widgetLabel\" | \"shuffleQuestions\"","properties":[]},{"id":"SurveyMatchType","name":"SurveyMatchType","path":"../core/src/types.ts","properties":[{"name":"Exact","type":"\"exact\""},{"name":"Icontains","type":"\"icontains\""},{"name":"IsNot","type":"\"is_not\""},{"name":"NotIcontains","type":"\"not_icontains\""},{"name":"NotRegex","type":"\"not_regex\""},{"name":"Regex","type":"\"regex\""}]},{"id":"SurveyModalProps","name":"SurveyModalProps","path":"dist/surveys/components/SurveyModal.d.ts","example":"{\n    survey: Survey;\n    appearance: SurveyAppearanceTheme;\n    onShow: () => void;\n    onClose: (submitted: boolean) => void;\n}","properties":[]},{"id":"SurveyPosition","name":"SurveyPosition","path":"../core/src/types.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"../core/src/types.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBase","name":"SurveyQuestionBase","path":"../core/src/types.ts","example":"{\n    question: string;\n    id: string;\n    description?: string;\n    descriptionContentType?: SurveyQuestionDescriptionContentType;\n    optional?: boolean;\n    buttonText?: string;\n    originalQuestionIndex: number;\n    branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n}","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"../core/src/types.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"../core/src/types.ts","properties":[{"name":"Html","type":"\"html\""},{"name":"Text","type":"\"text\""}]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"../core/src/types.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRatingDisplay","name":"SurveyRatingDisplay","path":"../core/src/types.ts","properties":[{"name":"Emoji","type":"\"emoji\""},{"name":"Number","type":"\"number\""}]},{"id":"SurveyResponse","name":"SurveyResponse","path":"../core/src/types.ts","example":"{\n    surveys: Survey[];\n}","properties":[]},{"id":"SurveyType","name":"SurveyType","path":"../core/src/types.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"../core/src/types.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHogProvider","title":"PostHogProvider","params":[{"name":"{ children, client, options, apiKey, autocapture, style, debug, }","type":"PostHogProviderProps","isOptional":false,"description":""}],"details":null,"category":"Initialization","examples":[{"id":"add_to_app.(js|ts)","code":"\n\n// Add to App.(js|ts)\nimport { usePostHog, PostHogProvider } from 'posthog-react-native'\n\nexport function MyApp() {\n    return (\n        <PostHogProvider apiKey=\"<ph_project_api_key>\" options={{\n            host: '<ph_client_api_host>',\n        }}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n// And access the PostHog client via the usePostHog hook\nimport { usePostHog } from 'posthog-react-native'\n\nconst MyComponent = () => {\n    const posthog = usePostHog()\n\n    useEffect(() => {\n        posthog.capture(\"event_name\")\n    }, [posthog])\n}\n\n\n\n","name":"Add to App.(js|ts)"},{"id":"using_with_existing_client","code":"\n\n// Using with existing client\nimport { PostHog } from 'posthog-react-native'\n\nconst posthog = new PostHog('<ph_project_api_key>', {\n    host: '<ph_client_api_host>'\n})\n\nexport function MyApp() {\n    return (\n        <PostHogProvider client={posthog}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n\n\n","name":"Using with existing client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JSX.Element | null","name":"JSX.Element | null"},"description":"PostHogProvider is a React component that provides PostHog functionality to your React Native app. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nAutocapturing navigation requires further configuration. See the [React Native SDK navigation docs](https://posthog.com/docs/libraries/react-native#capturing-screen-views) for more information about autocapturing navigation.\nThis is the recommended way to set up PostHog for React Native. This utilizes the Context API to pass the PostHog client around, enable autocapture."},{"id":"PostHog","path":"dist/posthog-rn.d.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"PostHog configuration options"}],"details":null,"category":"Initialization","examples":[{"id":"posthog.ts","code":"\n\n// posthog.ts\nimport PostHog from 'posthog-react-native'\n\nexport const posthog = new PostHog('<ph_project_api_key>', {\n  host: '<ph_client_api_host>'\n})\n\n// Then you can access PostHog by importing your instance\n// Another file:\nimport { posthog } from './posthog'\n\nexport function MyApp1() {\n    useEffect(async () => {\n        posthog.capture('event_name')\n    }, [posthog])\n\n    return <View>Your app code</View>\n}\n\n\n\n","name":"posthog.ts"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Creates a new PostHog instance for React Native. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nIf you prefer not to use the PostHogProvider, you can initialize PostHog in its own file and import the instance from there."},{"id":"alias","path":"dist/posthog-rn.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"The alias to assign to the current user"}],"details":null,"category":"Identification","examples":[{"id":"set_alias_for_current_user","code":"\n\n// set alias for current user\nposthog.alias('distinct_id')\n\n\n\n","name":"set alias for current user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"captureException","path":"dist/posthog-rn.d.ts","title":"captureException","params":[{"name":"error","type":"Error | unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"PostHogEventProperties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a caught exception manually"},{"id":"fetch","path":"dist/posthog-rn.d.ts","title":"fetch","params":[{"name":"url","type":"string","isOptional":false,"description":""},{"name":"options","type":"PostHogFetchOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"fetch","code":"// Generated example for fetch\nposthog.fetch();","name":"Generated example for fetch"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFetchResponse>","name":"Promise<PostHogFetchResponse>"}},{"id":"flush","path":"dist/posthog-rn.d.ts","title":"flush","params":[],"details":null,"category":"Capture","examples":[{"id":"manually_flush_the_queue","code":"\n\n// manually flush the queue\nawait posthog.flush()\n\n\n\n","name":"manually flush the queue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"getCommonEventProperties","path":"dist/posthog-rn.d.ts","title":"getCommonEventProperties","params":[],"details":null,"category":"","examples":[{"id":"getcommoneventproperties","code":"// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();","name":"Generated example for getCommonEventProperties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogEventProperties","name":"PostHogEventProperties"}},{"id":"getCustomUserAgent","path":"dist/posthog-rn.d.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"","examples":[{"id":"getcustomuseragent","code":"// Generated example for getCustomUserAgent\nposthog.getCustomUserAgent();","name":"Generated example for getCustomUserAgent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getDistinctId","path":"dist/posthog-rn.d.ts","title":"getDistinctId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_current_distinct_id","code":"\n\n// get current distinct ID\nconst distinctId = posthog.getDistinctId()\n\n\n\n","name":"get current distinct ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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 PostHog or the ID that has been passed by a call to identify()."},{"id":"getFeatureFlag","path":"dist/posthog-rn.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_value","code":"\n\n// get feature flag value\nconst value = posthog.getFeatureFlag('key-for-your-boolean-flag')\n\n\n\n","name":"get feature flag value"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"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."},{"id":"getFeatureFlagPayload","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_payload","code":"\n\n// get feature flag payload\nconst payload = posthog.getFeatureFlagPayload('key-for-your-multivariate-flag')\n\n\n\n","name":"get feature flag payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType | undefined","name":"JsonType | undefined"},"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."},{"id":"getLibraryId","path":"dist/posthog-rn.d.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getLibraryVersion","path":"dist/posthog-rn.d.ts","title":"getLibraryVersion","params":[],"details":null,"category":"","examples":[{"id":"getlibraryversion","code":"// Generated example for getLibraryVersion\nposthog.getLibraryVersion();","name":"Generated example for getLibraryVersion"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getPersistedProperty","path":"dist/posthog-rn.d.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"getpersistedproperty","code":"// Generated example for getPersistedProperty\nposthog.getPersistedProperty();","name":"Generated example for getPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"T | undefined","name":"T | undefined"}},{"id":"getSessionId","path":"dist/posthog-rn.d.ts","title":"getSessionId","params":[],"details":null,"category":"","examples":[{"id":"getsessionid","code":"// Generated example for getSessionId\nposthog.getSessionId();","name":"Generated example for getSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getSurveys","path":"dist/posthog-rn.d.ts","title":"getSurveys","params":[],"details":null,"category":"","examples":[{"id":"getsurveys","code":"// Generated example for getSurveys\nposthog.getSurveys();","name":"Generated example for getSurveys"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"}},{"id":"group","path":"dist/posthog-rn.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"The type of group (e.g. 'company', 'team')"},{"name":"groupKey","type":"string","isOptional":false,"description":"The unique identifier for the group"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to set for the group"}],"details":null,"category":"Group analytics","examples":[{"id":"associate_with_a_group","code":"\n\n// associate with a group\nposthog.group('company', 'company_id_in_your_db')\n\n\n","name":"associate with a group"},{"id":"associate_with_a_group_and_update_properties","code":"\n\n// associate with a group and update properties\nposthog.group('company', 'company_id_in_your_db', {\n  name: 'Awesome Inc.',\n  employees: 11,\n})\n\n\n\n","name":"associate with a group and update properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"identify","path":"dist/posthog-rn.d.ts","title":"identify","params":[{"name":"distinctId","type":"string","isOptional":true,"description":"A unique identifier for your user. Typically either their email or database ID."},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional dictionary with key:value pairs to set the person properties"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"details":null,"category":"Identification","examples":[{"id":"basic_identify","code":"\n\n// Basic identify\nposthog.identify('distinctID', {\n  email: 'user@posthog.com',\n  name: 'My Name'\n})\n\n\n","name":"Basic identify"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nposthog.identify('distinctID', {\n  $set: {\n    email: 'user@posthog.com',\n    name: 'My Name'\n  },\n  $set_once: {\n    date_of_first_log_in: '2024-03-01'\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates events with a specific user. Learn more about [identifying users](https://posthog.com/docs/product-analytics/identify)"},{"id":"initReactNativeNavigation","path":"dist/posthog-rn.d.ts","title":"initReactNativeNavigation","params":[{"name":"options","type":"PostHogAutocaptureOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"initreactnativenavigation","code":"// Generated example for initReactNativeNavigation\nposthog.initReactNativeNavigation();","name":"Generated example for initReactNativeNavigation"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"}},{"id":"isFeatureEnabled","path":"dist/posthog-rn.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"check_if_feature_flag_is_enabled","code":"\n\n// check if feature flag is enabled\nconst isEnabled = posthog.isFeatureEnabled('key-for-your-boolean-flag')\n\n\n\n","name":"check if feature flag is enabled"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"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."},{"id":"optIn","path":"dist/posthog-rn.d.ts","title":"optIn","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_in_to_tracking","code":"\n\n// opt in to tracking\nposthog.optIn()\n\n\n\n","name":"opt in to tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Opts the user in to data capture.\nBy default, PostHog 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."},{"id":"optOut","path":"dist/posthog-rn.d.ts","title":"optOut","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_out_of_tracking","code":"\n\n// opt out of tracking\nposthog.optOut()\n\n\n\n","name":"opt out of tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"register","path":"dist/posthog-rn.d.ts","title":"register","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":"An associative array of properties to store about the user"}],"details":null,"category":"Capture","examples":[{"id":"register_super_properties","code":"\n\n// register super properties\nposthog.register({\n    'icecream pref': 'vanilla',\n    team_id: 22,\n})\n\n\n\n","name":"register super properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"reloadFeatureFlags","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags","code":"\n\n// reload feature flags\nposthog.reloadFeatureFlags()\n\n\n\n","name":"reload feature flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Reloads feature flags from the server.\nPostHog 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."},{"id":"reloadFeatureFlagsAsync","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlagsAsync","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags_and_get_result","code":"\n\n// reload feature flags and get result\nposthog.reloadFeatureFlagsAsync().then((refreshedFlags) => console.log(refreshedFlags))\n\n\n\n","name":"reload feature flags and get result"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, boolean | string> | undefined>","name":"Promise<Record<string, boolean | string> | undefined>"},"description":"Reloads feature flags from the server asynchronously.\nPostHog 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."},{"id":"reset","path":"dist/posthog-rn.d.ts","title":"reset","params":[],"details":null,"category":"Identification","examples":[{"id":"reset_after_logout","code":"\n\n// reset after logout\nposthog.reset()\n\n\n\n","name":"reset after logout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"resetGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetGroupPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_group_properties_for_flags","code":"\n\n// reset group properties for flags\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":"reset group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets group properties for feature flag evaluation."},{"id":"resetPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_person_properties_for_flags","code":"\n\n// reset person properties for flags\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":"reset person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets person properties for feature flag evaluation."},{"id":"resetSessionId","path":"dist/posthog-rn.d.ts","title":"resetSessionId","params":[],"details":null,"category":"","examples":[{"id":"resetsessionid","code":"// Generated example for resetSessionId\nposthog.resetSessionId();","name":"Generated example for resetSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"screen","path":"dist/posthog-rn.d.ts","title":"screen","params":[{"name":"name","type":"string","isOptional":false,"description":"The name of the screen"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to include with the screen event"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"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.","category":"Capture","examples":[{"id":"basic_screen_capture","code":"\n\n// Basic screen capture\nposthog.screen('dashboard')\n\n\n","name":"Basic screen capture"},{"id":"screen_capture_with_properties","code":"\n\n// Screen capture with properties\nposthog.screen('dashboard', {\n    background: 'blue',\n    hero: 'superhog',\n})\n\n\n\n","name":"Screen capture with properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Captures a screen view event."},{"id":"setGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"Record<string, Record<string, string>>","isOptional":false,"description":"The group properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_group_properties_for_flags","code":"\n\n// set group properties for flags\nposthog.setGroupPropertiesForFlags({'company': {'property1': 'value', property2: 'value2'}})\n\n\n\n","name":"set group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets group properties for feature flag evaluation.\nThese properties are automatically attached to the current group (set via posthog.group()). When you change the group, these properties are reset."},{"id":"setPersistedProperty","path":"dist/posthog-rn.d.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""},{"name":"value","type":"T | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"setpersistedproperty","code":"// Generated example for setPersistedProperty\nposthog.setPersistedProperty();","name":"Generated example for setPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"setPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Record<string, string>","isOptional":false,"description":"The person properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_person_properties_for_flags","code":"\n\n// set person properties for flags\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n\n","name":"set person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"unregister","path":"dist/posthog-rn.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":null,"category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('icecream pref')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"autocapture","path":"dist/posthog-rn.d.ts","title":"autocapture","params":[{"name":"eventType","type":"string","isOptional":false,"description":""},{"name":"elements","type":"PostHogAutocaptureElement[]","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"autocapture","code":"// Generated example for autocapture\nposthog.autocapture();","name":"Generated example for autocapture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"capture","path":"dist/posthog-rn.d.ts","title":"capture","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capture","code":"// Generated example for capture\nposthog.capture();","name":"Generated example for capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureTraceFeedback","path":"dist/posthog-rn.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"dist/posthog-rn.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"flagsAsync","path":"dist/posthog-rn.d.ts","title":"flagsAsync","params":[{"name":"sendAnonDistinctId","type":"boolean","isOptional":true,"description":""},{"name":"fetchConfig","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"flagsasync","code":"// Generated example for flagsAsync\nposthog.flagsAsync();","name":"Generated example for flagsAsync"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse | undefined>","name":"Promise<PostHogFlagsResponse | undefined>"},"description":"* ** FEATURE FLAGS *"},{"id":"getAnonymousId","path":"dist/posthog-rn.d.ts","title":"getAnonymousId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_the_anonymous_id","code":"\n\n// get the anonymous ID\nconst anonId = posthog.getAnonymousId()\nconsole.log('Anonymous ID:', anonId)\n\n\n\n","name":"get the anonymous ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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."},{"id":"getFeatureFlagDetails","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetails","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagdetails","code":"// Generated example for getFeatureFlagDetails\nposthog.getFeatureFlagDetails();","name":"Generated example for getFeatureFlagDetails"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFeatureFlagDetails | undefined","name":"PostHogFeatureFlagDetails | undefined"}},{"id":"getFeatureFlagPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloads","code":"// Generated example for getFeatureFlagPayloads\nposthog.getFeatureFlagPayloads();","name":"Generated example for getFeatureFlagPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlagPayloads'] | undefined","name":"PostHogFlagsResponse['featureFlagPayloads'] | undefined"}},{"id":"getFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflags","code":"// Generated example for getFeatureFlags\nposthog.getFeatureFlags();","name":"Generated example for getFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"getFeatureFlagsAndPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloads","code":"// Generated example for getFeatureFlagsAndPayloads\nposthog.getFeatureFlagsAndPayloads();","name":"Generated example for getFeatureFlagsAndPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }","name":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }"}},{"id":"getKnownFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getKnownFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getknownfeatureflags","code":"// Generated example for getKnownFeatureFlags\nposthog.getKnownFeatureFlags();","name":"Generated example for getKnownFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"groupIdentify","path":"dist/posthog-rn.d.ts","title":"groupIdentify","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentify","code":"// Generated example for groupIdentify\nposthog.groupIdentify();","name":"Generated example for groupIdentify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"groups","path":"dist/posthog-rn.d.ts","title":"groups","params":[{"name":"groups","type":"PostHogGroupProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"groups","code":"// Generated example for groups\nposthog.groups();","name":"Generated example for groups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"on","path":"dist/posthog-rn.d.ts","title":"on","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"on","code":"// Generated example for on\nposthog.on();","name":"Generated example for on"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlag","path":"dist/posthog-rn.d.ts","title":"onFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(value: FeatureFlagValue) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflag","code":"// Generated example for onFeatureFlag\nposthog.onFeatureFlag();","name":"Generated example for onFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlags","path":"dist/posthog-rn.d.ts","title":"onFeatureFlags","params":[{"name":"cb","type":"(flags: PostHogFlagsResponse['featureFlags']) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflags","code":"// Generated example for onFeatureFlags\nposthog.onFeatureFlags();","name":"Generated example for onFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"overrideFeatureFlag","path":"dist/posthog-rn.d.ts","title":"overrideFeatureFlag","params":[{"name":"flags","type":"PostHogFlagsResponse['featureFlags'] | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"overridefeatureflag","code":"// Generated example for overrideFeatureFlag\nposthog.overrideFeatureFlag();","name":"Generated example for overrideFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"registerForSession","path":"dist/posthog-rn.d.ts","title":"registerForSession","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"registerforsession","code":"// Generated example for registerForSession\nposthog.registerForSession();","name":"Generated example for registerForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"reloadRemoteConfigAsync","path":"dist/posthog-rn.d.ts","title":"reloadRemoteConfigAsync","params":[],"details":null,"category":"","examples":[{"id":"reloadremoteconfigasync","code":"// Generated example for reloadRemoteConfigAsync\nposthog.reloadRemoteConfigAsync();","name":"Generated example for reloadRemoteConfigAsync"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"setupBootstrap","path":"dist/posthog-rn.d.ts","title":"setupBootstrap","params":[{"name":"options","type":"Partial<PostHogCoreOptions>","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"setupbootstrap","code":"// Generated example for setupBootstrap\nposthog.setupBootstrap();","name":"Generated example for setupBootstrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"unregisterForSession","path":"dist/posthog-rn.d.ts","title":"unregisterForSession","params":[{"name":"property","type":"string","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"unregisterforsession","code":"// Generated example for unregisterForSession\nposthog.unregisterForSession();","name":"Generated example for unregisterForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"addPendingPromise","path":"dist/posthog-rn.d.ts","title":"addPendingPromise","params":[{"name":"promise","type":"Promise<T>","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"addpendingpromise","code":"// Generated example for addPendingPromise\nposthog.addPendingPromise();","name":"Generated example for addPendingPromise"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<T>","name":"Promise<T>"}},{"id":"aliasStateless","path":"dist/posthog-rn.d.ts","title":"aliasStateless","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstateless","code":"// Generated example for aliasStateless\nposthog.aliasStateless();","name":"Generated example for aliasStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"aliasStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"aliasStatelessImmediate","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstatelessimmediate","code":"// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();","name":"Generated example for aliasStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"captureStateless","path":"dist/posthog-rn.d.ts","title":"captureStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestateless","code":"// Generated example for captureStateless\nposthog.captureStateless();","name":"Generated example for captureStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"captureStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestatelessimmediate","code":"// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();","name":"Generated example for captureStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"debug","path":"dist/posthog-rn.d.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":""}],"details":"Debug mode logs all PostHog calls to the console for troubleshooting. This is useful during development to understand what data is being sent.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"enqueue","path":"dist/posthog-rn.d.ts","title":"enqueue","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"enqueue","code":"// Generated example for enqueue\nposthog.enqueue();","name":"Generated example for enqueue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** QUEUEING AND FLUSHING *"},{"id":"getCustomHeaders","path":"dist/posthog-rn.d.ts","title":"getCustomHeaders","params":[],"details":null,"category":"","examples":[{"id":"getcustomheaders","code":"// Generated example for getCustomHeaders\nposthog.getCustomHeaders();","name":"Generated example for getCustomHeaders"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        [key: string]: string;\n    }","name":"{\n        [key: string]: string;\n    }"}},{"id":"getFeatureFlagDetailsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailsstateless","code":"// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();","name":"Generated example for getFeatureFlagDetailsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFeatureFlagDetails | undefined>","name":"Promise<PostHogFeatureFlagDetails | undefined>"}},{"id":"getFeatureFlagDetailStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailstateless","code":"// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();","name":"Generated example for getFeatureFlagDetailStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>","name":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>"}},{"id":"getFeatureFlagPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadsstateless","code":"// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();","name":"Generated example for getFeatureFlagPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>","name":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>"}},{"id":"getFeatureFlagPayloadStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadstateless","code":"// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();","name":"Generated example for getFeatureFlagPayloadStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"}},{"id":"getFeatureFlagsAndPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloadsstateless","code":"// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();","name":"Generated example for getFeatureFlagsAndPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsstateless","code":"// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();","name":"Generated example for getFeatureFlagsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagstateless","code":"// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();","name":"Generated example for getFeatureFlagStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>","name":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>"}},{"id":"getFlags","path":"dist/posthog-rn.d.ts","title":"getFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"extraPayload","type":"Record<string, any>","isOptional":true,"description":""},{"name":"fetchConfig","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getflags","code":"// Generated example for getFlags\nposthog.getFlags();","name":"Generated example for getFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse | undefined>","name":"Promise<PostHogFlagsResponse | undefined>"},"description":"* ** FEATURE FLAGS *"},{"id":"getRemoteConfig","path":"dist/posthog-rn.d.ts","title":"getRemoteConfig","params":[],"details":null,"category":"","examples":[{"id":"getremoteconfig","code":"// Generated example for getRemoteConfig\nposthog.getRemoteConfig();","name":"Generated example for getRemoteConfig"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"getSurveysStateless","path":"dist/posthog-rn.d.ts","title":"getSurveysStateless","params":[],"details":null,"category":"","examples":[{"id":"getsurveysstateless","code":"// Generated example for getSurveysStateless\nposthog.getSurveysStateless();","name":"Generated example for getSurveysStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"},"description":"* ** SURVEYS *"},{"id":"groupIdentifyStateless","path":"dist/posthog-rn.d.ts","title":"groupIdentifyStateless","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""},{"name":"distinctId","type":"string","isOptional":true,"description":""},{"name":"eventProperties","type":"PostHogEventProperties","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentifystateless","code":"// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();","name":"Generated example for groupIdentifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"identifyStateless","path":"dist/posthog-rn.d.ts","title":"identifyStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystateless","code":"// Generated example for identifyStateless\nposthog.identifyStateless();","name":"Generated example for identifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** TRACKING *"},{"id":"identifyStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"identifyStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystatelessimmediate","code":"// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();","name":"Generated example for identifyStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"logMsgIfDebug","path":"dist/posthog-rn.d.ts","title":"logMsgIfDebug","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"logmsgifdebug","code":"// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();","name":"Generated example for logMsgIfDebug"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"sendImmediate","path":"dist/posthog-rn.d.ts","title":"sendImmediate","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"sendimmediate","code":"// Generated example for sendImmediate\nposthog.sendImmediate();","name":"Generated example for sendImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"shutdown","path":"dist/posthog-rn.d.ts","title":"shutdown","params":[{"name":"shutdownTimeoutMs","type":"number","isOptional":true,"description":"Maximum time to wait for shutdown in milliseconds"}],"details":null,"category":"Initialization","examples":[{"id":"shutdown_before_process_exit","code":"\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n  await posthog.shutdown()\n  process.exit(0)\n})\n\n\n\n","name":"shutdown before process exit"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Shuts down the PostHog 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 PostHog instance after calling it. Use flush() for per-request cleanup instead."},{"id":"wrap","path":"dist/posthog-rn.d.ts","title":"wrap","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"wrap","code":"// Generated example for wrap\nposthog.wrap();","name":"Generated example for wrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}}]}],"version":"4.10.2","categories":["Initialization","Identification","Capture","Error tracking","Feature flags","Group analytics","Privacy","LLM analytics"],"referenceId":"posthog-react-native"},"createdAt":"2025-10-25T22:45:02.203Z","updatedAt":"2025-10-25T22:45:02.203Z","publishedAt":"2025-10-25T22:45:02.199Z"}},{"id":22,"attributes":{"referenceId":"posthog-react-native","version":"4.10.4","data":{"id":"posthog-react-native-4.10.4","info":{"id":"posthog-react-native","title":"PostHog React Native SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"4.10.4","slugPrefix":"posthog-react-native","description":"PostHog React Native SDK allows you to capture events and send them to PostHog from your React Native applications."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"../core/src/types.ts","properties":[{"name":"Contains","type":"\"contains\""},{"name":"Exact","type":"\"exact\""},{"name":"Regex","type":"\"regex\""}]},{"id":"ActionStepType","name":"ActionStepType","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}","properties":[]},{"id":"AutocaptureOptions","name":"AutocaptureOptions","path":"dist/error-tracking/index.d.ts","properties":[{"name":"console","type":"boolean | LogLevel[]"},{"name":"uncaughtExceptions","type":"boolean"},{"name":"unhandledRejections","type":"boolean"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Open;\n}","properties":[]},{"id":"Compression","name":"Compression","path":"../core/src/types.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"EndBranching","name":"EndBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.End;\n}","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"dist/error-tracking/index.d.ts","properties":[{"name":"autocapture","type":"AutocaptureOptions | boolean"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"../core/src/types.ts","example":"{\n    code: string | undefined;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","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}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"../core/src/types.ts","example":"{\n    id: number | undefined;\n    version: number | undefined;\n    description: string | undefined;\n    payload: string | undefined;\n}","properties":[]},{"id":"FeatureFlagValue","name":"FeatureFlagValue","path":"../core/src/types.ts","example":"string | boolean","properties":[]},{"id":"FeatureFlagWithPayload","name":"FeatureFlagWithPayload","path":"dist/hooks/useFeatureFlag.d.ts","example":"[FeatureFlagValue | undefined, JsonType | undefined]","properties":[]},{"id":"JsonType","name":"JsonType","path":"../core/src/types.ts","example":"string | number | boolean | null | {\n    [key: string]: JsonType;\n} | Array<JsonType> | JsonType[]","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Link;\n    link?: string;\n}","properties":[]},{"id":"Logger","name":"Logger","path":"../core/src/types.ts","example":"{\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}","properties":[]},{"id":"LogLevel","name":"LogLevel","path":"dist/error-tracking/index.d.ts","example":"\"debug\" | \"log\" | \"info\" | \"warn\" | \"error\"","properties":[]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n    choices: string[];\n    hasOpenChoice?: boolean;\n    shuffleOptions?: boolean;\n}","properties":[]},{"id":"NextQuestionBranching","name":"NextQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.NextQuestion;\n}","properties":[]},{"id":"PartialWithRequired","name":"PartialWithRequired","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}","properties":[]},{"id":"PostHogAutocaptureElement","name":"PostHogAutocaptureElement","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} & PostHogEventProperties","properties":[]},{"id":"PostHogAutocaptureNavigationTrackerOptions","name":"PostHogAutocaptureNavigationTrackerOptions","path":"dist/types.d.ts","example":"{\n    routeToName?: (name: string, params: any) => string;\n    routeToProperties?: (name: string, params: any) => Record<string, any>;\n}","properties":[]},{"id":"PostHogAutocaptureOptions","name":"PostHogAutocaptureOptions","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?: PostHogAutocaptureNavigationTrackerOptions;\n    navigationRef?: PostHogNavigationRef;\n}","properties":[]},{"id":"PostHogCaptureOptions","name":"PostHogCaptureOptions","path":"../core/src/types.ts","example":"{\n    uuid?: string;\n    timestamp?: Date;\n    disableGeoip?: boolean;\n}","properties":[]},{"id":"PostHogCoreOptions","name":"PostHogCoreOptions","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    evaluationEnvironments?: readonly string[];\n}","properties":[]},{"id":"PostHogCustomAppProperties","name":"PostHogCustomAppProperties","path":"dist/types.d.ts","properties":[{"name":"$app_build","type":"string | null","description":"Build number like \"1.2.2\" or \"122\""},{"name":"$app_name","type":"string | null","description":"Name of the app as displayed below the icon like \"PostHog\""},{"name":"$app_namespace","type":"string | null","description":"Namespace of the app usually like \"com.posthog.app\""},{"name":"$app_version","type":"string | null","description":"Human friendly app version like what a user would see in the app store like \"1.2.2\""},{"name":"$device_manufacturer","type":"string | null","description":"Manufacturer like \"Apple\", \"Samsung\" or \"Android\""},{"name":"$device_model","type":"string | null","description":"Model identifier like \"iPhone13,2\" or \"SM-S921B\""},{"name":"$device_name","type":"string | null","description":"Readable model name like \"iPhone 12\" or \"Samsung Galaxy S24\""},{"name":"$device_type","type":"string | null","description":"Device type (\"Mobile\" | \"Desktop\" | \"Web\")"},{"name":"$locale","type":"string | null","description":"Locale (language) of the device like \"en-US\""},{"name":"$os_name","type":"string | null","description":"Operating system name like iOS or Android"},{"name":"$os_version","type":"string | null","description":"Operating system version \"14.0\""},{"name":"$timezone","type":"string | null","description":"Timezone of the device like \"Europe/Berlin\""}]},{"id":"PostHogCustomStorage","name":"PostHogCustomStorage","path":"dist/types.d.ts","properties":[{"name":"getItem","type":"(key: string) => string | null | Promise<string | null>"},{"name":"setItem","type":"(key: string, value: string) => void | Promise<void>"}]},{"id":"PostHogEventProperties","name":"PostHogEventProperties","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: 'user@example.com',\n        name: 'John Doe'\n    }\n}","properties":[]},{"id":"PostHogFeatureFlagDetails","name":"PostHogFeatureFlagDetails","path":"../core/src/types.ts","example":"\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"","properties":[]},{"id":"PostHogFetchOptions","name":"PostHogFetchOptions","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}","properties":[]},{"id":"PostHogFetchResponse","name":"PostHogFetchResponse","path":"../core/src/types.ts","example":"{\n    status: number;\n    text: () => Promise<string>;\n    json: () => Promise<any>;\n}","properties":[]},{"id":"PostHogFlagsResponse","name":"PostHogFlagsResponse","path":"../core/src/types.ts","example":"Omit<PostHogRemoteConfig, '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}","properties":[]},{"id":"PostHogGroupProperties","name":"PostHogGroupProperties","path":"../core/src/types.ts","example":"{\n    [type: string]: string | number;\n}","properties":[]},{"id":"PostHogNavigationRef","name":"PostHogNavigationRef","path":"dist/types.d.ts","example":"{\n    getCurrentRoute(): any | undefined;\n    isReady: () => boolean;\n    current?: PostHogNavigationRef | any | undefined;\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"dist/posthog-rn.d.ts","properties":[{"name":"captureAppLifecycleEvents","type":"boolean","description":"Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded. By default is false. Application Installed and Application Updated events are not supported with persistence set to 'memory'."},{"name":"customAppProperties","type":"PostHogCustomAppProperties | ((properties: PostHogCustomAppProperties) => PostHogCustomAppProperties)","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"},{"name":"customStorage","type":"PostHogCustomStorage","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, PostHog 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."},{"name":"enablePersistSessionIdAcrossRestart","type":"boolean","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. Defaults to false"},{"name":"enableSessionReplay","type":"boolean","description":"Enable Recording of Session Replays for Android and iOS Requires Record user sessions to be enabled in the PostHog Project Settings Defaults to false"},{"name":"errorTracking","type":"ErrorTrackingOptions","description":"Error Tracking Configuration"},{"name":"persistence","type":"'memory' | 'file'","description":"Allows you to provide the storage type. By default 'file'. 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage."},{"name":"sessionReplayConfig","type":"PostHogSessionReplayConfig","description":"Configuration for Session Replay"}]},{"id":"PostHogPersistedProperty","name":"PostHogPersistedProperty","path":"../core/src/types.ts","properties":[{"name":"AnonymousId","type":"\"anonymous_id\""},{"name":"BootstrapFeatureFlagDetails","type":"\"bootstrap_feature_flag_details\""},{"name":"BootstrapFeatureFlagPayloads","type":"\"bootstrap_feature_flag_payloads\""},{"name":"BootstrapFeatureFlags","type":"\"bootstrap_feature_flags\""},{"name":"DistinctId","type":"\"distinct_id\""},{"name":"FeatureFlagDetails","type":"\"feature_flag_details\""},{"name":"FeatureFlagPayloads","type":"\"feature_flag_payloads\""},{"name":"FeatureFlags","type":"\"feature_flags\""},{"name":"FlagsEndpointWasHit","type":"\"flags_endpoint_was_hit\""},{"name":"GroupProperties","type":"\"group_properties\""},{"name":"InstalledAppBuild","type":"\"installed_app_build\""},{"name":"InstalledAppVersion","type":"\"installed_app_version\""},{"name":"OptedOut","type":"\"opted_out\""},{"name":"OverrideFeatureFlags","type":"\"override_feature_flags\""},{"name":"PersonProperties","type":"\"person_properties\""},{"name":"Props","type":"\"props\""},{"name":"Queue","type":"\"queue\""},{"name":"RemoteConfig","type":"\"remote_config\""},{"name":"SessionId","type":"\"session_id\""},{"name":"SessionLastTimestamp","type":"\"session_timestamp\""},{"name":"SessionReplay","type":"\"session_replay\""},{"name":"SessionStartTimestamp","type":"\"session_start_timestamp\""},{"name":"SurveyLastSeenDate","type":"\"survey_last_seen_date\""},{"name":"Surveys","type":"\"surveys\""},{"name":"SurveysSeen","type":"\"surveys_seen\""}]},{"id":"PostHogProviderProps","name":"PostHogProviderProps","path":"dist/PostHogProvider.d.ts","properties":[{"name":"apiKey","type":"string","description":"Your PostHog API key"},{"name":"autocapture","type":"boolean | PostHogAutocaptureOptions","description":"Autocapture configuration - can be a boolean or detailed options"},{"name":"children","type":"React.ReactNode","description":"The child components to render within the PostHog context"},{"name":"client","type":"PostHog","description":"An existing PostHog client instance"},{"name":"debug","type":"boolean","description":"Enable debug mode for additional logging"},{"name":"options","type":"PostHogOptions","description":"PostHog configuration options"},{"name":"style","type":"StyleProp<ViewStyle>","description":"Custom styles for the provider wrapper View"}]},{"id":"PostHogRemoteConfig","name":"PostHogRemoteConfig","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}","properties":[]},{"id":"PostHogSessionReplayConfig","name":"PostHogSessionReplayConfig","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}","properties":[]},{"id":"PostHogSurveyProviderProps","name":"PostHogSurveyProviderProps","path":"dist/surveys/PostHogSurveyProvider.d.ts","example":"{\n    defaultSurveyAppearance?: SurveyAppearance;\n    overrideAppearanceWithDefault?: boolean;\n    client?: PostHog;\n    children: React.ReactNode;\n}","properties":[]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Rating;\n    display: SurveyRatingDisplay;\n    scale: 3 | 5 | 7 | 10;\n    lowerBoundLabel: string;\n    upperBoundLabel: string;\n}","properties":[]},{"id":"ResponseBasedBranching","name":"ResponseBasedBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.ResponseBased;\n    responseValues: Record<string, any>;\n}","properties":[]},{"id":"RetriableOptions","name":"RetriableOptions","path":"../core/src/utils/index.ts","properties":[{"name":"retryCheck","type":"(err: unknown) => boolean"},{"name":"retryCount","type":"number"},{"name":"retryDelay","type":"number"}]},{"id":"SpecificQuestionBranching","name":"SpecificQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.SpecificQuestion;\n    index: number;\n}","properties":[]},{"id":"Survey","name":"Survey","path":"../core/src/types.ts","example":"{\n    id: string;\n    name: string;\n    description?: string;\n    type: SurveyType;\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}","properties":[]},{"id":"SurveyActionType","name":"SurveyActionType","path":"../core/src/types.ts","example":"{\n    id: number;\n    name?: string;\n    steps?: ActionStepType[];\n}","properties":[]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"../core/src/types.ts","example":"{\n    backgroundColor?: string;\n    submitButtonColor?: string;\n    submitButtonText?: string;\n    submitButtonTextColor?: string;\n    ratingButtonColor?: string;\n    ratingButtonActiveColor?: 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}","properties":[]},{"id":"SurveyAppearanceTheme","name":"SurveyAppearanceTheme","path":"dist/surveys/surveys-utils.d.ts","example":"\"widgetSelector\" | \"widgetType\" | \"widgetColor\" | \"widgetLabel\" | \"shuffleQuestions\"","properties":[]},{"id":"SurveyMatchType","name":"SurveyMatchType","path":"../core/src/types.ts","properties":[{"name":"Exact","type":"\"exact\""},{"name":"Icontains","type":"\"icontains\""},{"name":"IsNot","type":"\"is_not\""},{"name":"NotIcontains","type":"\"not_icontains\""},{"name":"NotRegex","type":"\"not_regex\""},{"name":"Regex","type":"\"regex\""}]},{"id":"SurveyModalProps","name":"SurveyModalProps","path":"dist/surveys/components/SurveyModal.d.ts","example":"{\n    survey: Survey;\n    appearance: SurveyAppearanceTheme;\n    onShow: () => void;\n    onClose: (submitted: boolean) => void;\n}","properties":[]},{"id":"SurveyPosition","name":"SurveyPosition","path":"../core/src/types.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"../core/src/types.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBase","name":"SurveyQuestionBase","path":"../core/src/types.ts","example":"{\n    question: string;\n    id: string;\n    description?: string;\n    descriptionContentType?: SurveyQuestionDescriptionContentType;\n    optional?: boolean;\n    buttonText?: string;\n    originalQuestionIndex: number;\n    branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n}","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"../core/src/types.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"../core/src/types.ts","properties":[{"name":"Html","type":"\"html\""},{"name":"Text","type":"\"text\""}]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"../core/src/types.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRatingDisplay","name":"SurveyRatingDisplay","path":"../core/src/types.ts","properties":[{"name":"Emoji","type":"\"emoji\""},{"name":"Number","type":"\"number\""}]},{"id":"SurveyResponse","name":"SurveyResponse","path":"../core/src/types.ts","example":"{\n    surveys: Survey[];\n}","properties":[]},{"id":"SurveyType","name":"SurveyType","path":"../core/src/types.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"../core/src/types.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHogProvider","title":"PostHogProvider","params":[{"name":"{ children, client, options, apiKey, autocapture, style, debug, }","type":"PostHogProviderProps","isOptional":false,"description":""}],"details":null,"category":"Initialization","examples":[{"id":"add_to_app.(js|ts)","code":"\n\n// Add to App.(js|ts)\nimport { usePostHog, PostHogProvider } from 'posthog-react-native'\n\nexport function MyApp() {\n    return (\n        <PostHogProvider apiKey=\"<ph_project_api_key>\" options={{\n            host: '<ph_client_api_host>',\n        }}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n// And access the PostHog client via the usePostHog hook\nimport { usePostHog } from 'posthog-react-native'\n\nconst MyComponent = () => {\n    const posthog = usePostHog()\n\n    useEffect(() => {\n        posthog.capture(\"event_name\")\n    }, [posthog])\n}\n\n\n\n","name":"Add to App.(js|ts)"},{"id":"using_with_existing_client","code":"\n\n// Using with existing client\nimport { PostHog } from 'posthog-react-native'\n\nconst posthog = new PostHog('<ph_project_api_key>', {\n    host: '<ph_client_api_host>'\n})\n\nexport function MyApp() {\n    return (\n        <PostHogProvider client={posthog}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n\n\n","name":"Using with existing client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JSX.Element | null","name":"JSX.Element | null"},"description":"PostHogProvider is a React component that provides PostHog functionality to your React Native app. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nAutocapturing navigation requires further configuration. See the [React Native SDK navigation docs](https://posthog.com/docs/libraries/react-native#capturing-screen-views) for more information about autocapturing navigation.\nThis is the recommended way to set up PostHog for React Native. This utilizes the Context API to pass the PostHog client around, enable autocapture."},{"id":"PostHog","path":"dist/posthog-rn.d.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"PostHog configuration options"}],"details":null,"category":"Initialization","examples":[{"id":"posthog.ts","code":"\n\n// posthog.ts\nimport PostHog from 'posthog-react-native'\n\nexport const posthog = new PostHog('<ph_project_api_key>', {\n  host: '<ph_client_api_host>'\n})\n\n// Then you can access PostHog by importing your instance\n// Another file:\nimport { posthog } from './posthog'\n\nexport function MyApp1() {\n    useEffect(async () => {\n        posthog.capture('event_name')\n    }, [posthog])\n\n    return <View>Your app code</View>\n}\n\n\n\n","name":"posthog.ts"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Creates a new PostHog instance for React Native. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nIf you prefer not to use the PostHogProvider, you can initialize PostHog in its own file and import the instance from there."},{"id":"alias","path":"dist/posthog-rn.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"The alias to assign to the current user"}],"details":null,"category":"Identification","examples":[{"id":"set_alias_for_current_user","code":"\n\n// set alias for current user\nposthog.alias('distinct_id')\n\n\n\n","name":"set alias for current user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"captureException","path":"dist/posthog-rn.d.ts","title":"captureException","params":[{"name":"error","type":"Error | unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"PostHogEventProperties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a caught exception manually"},{"id":"fetch","path":"dist/posthog-rn.d.ts","title":"fetch","params":[{"name":"url","type":"string","isOptional":false,"description":""},{"name":"options","type":"PostHogFetchOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"fetch","code":"// Generated example for fetch\nposthog.fetch();","name":"Generated example for fetch"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFetchResponse>","name":"Promise<PostHogFetchResponse>"}},{"id":"flush","path":"dist/posthog-rn.d.ts","title":"flush","params":[],"details":null,"category":"Capture","examples":[{"id":"manually_flush_the_queue","code":"\n\n// manually flush the queue\nawait posthog.flush()\n\n\n\n","name":"manually flush the queue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"getCommonEventProperties","path":"dist/posthog-rn.d.ts","title":"getCommonEventProperties","params":[],"details":null,"category":"","examples":[{"id":"getcommoneventproperties","code":"// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();","name":"Generated example for getCommonEventProperties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogEventProperties","name":"PostHogEventProperties"}},{"id":"getCustomUserAgent","path":"dist/posthog-rn.d.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"","examples":[{"id":"getcustomuseragent","code":"// Generated example for getCustomUserAgent\nposthog.getCustomUserAgent();","name":"Generated example for getCustomUserAgent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getDistinctId","path":"dist/posthog-rn.d.ts","title":"getDistinctId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_current_distinct_id","code":"\n\n// get current distinct ID\nconst distinctId = posthog.getDistinctId()\n\n\n\n","name":"get current distinct ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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 PostHog or the ID that has been passed by a call to identify()."},{"id":"getFeatureFlag","path":"dist/posthog-rn.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_value","code":"\n\n// get feature flag value\nconst value = posthog.getFeatureFlag('key-for-your-boolean-flag')\n\n\n\n","name":"get feature flag value"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"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."},{"id":"getFeatureFlagPayload","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_payload","code":"\n\n// get feature flag payload\nconst payload = posthog.getFeatureFlagPayload('key-for-your-multivariate-flag')\n\n\n\n","name":"get feature flag payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType | undefined","name":"JsonType | undefined"},"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."},{"id":"getLibraryId","path":"dist/posthog-rn.d.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getLibraryVersion","path":"dist/posthog-rn.d.ts","title":"getLibraryVersion","params":[],"details":null,"category":"","examples":[{"id":"getlibraryversion","code":"// Generated example for getLibraryVersion\nposthog.getLibraryVersion();","name":"Generated example for getLibraryVersion"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getPersistedProperty","path":"dist/posthog-rn.d.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"getpersistedproperty","code":"// Generated example for getPersistedProperty\nposthog.getPersistedProperty();","name":"Generated example for getPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"T | undefined","name":"T | undefined"}},{"id":"getSessionId","path":"dist/posthog-rn.d.ts","title":"getSessionId","params":[],"details":null,"category":"","examples":[{"id":"getsessionid","code":"// Generated example for getSessionId\nposthog.getSessionId();","name":"Generated example for getSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getSurveys","path":"dist/posthog-rn.d.ts","title":"getSurveys","params":[],"details":null,"category":"","examples":[{"id":"getsurveys","code":"// Generated example for getSurveys\nposthog.getSurveys();","name":"Generated example for getSurveys"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"}},{"id":"group","path":"dist/posthog-rn.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"The type of group (e.g. 'company', 'team')"},{"name":"groupKey","type":"string","isOptional":false,"description":"The unique identifier for the group"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to set for the group"}],"details":null,"category":"Group analytics","examples":[{"id":"associate_with_a_group","code":"\n\n// associate with a group\nposthog.group('company', 'company_id_in_your_db')\n\n\n","name":"associate with a group"},{"id":"associate_with_a_group_and_update_properties","code":"\n\n// associate with a group and update properties\nposthog.group('company', 'company_id_in_your_db', {\n  name: 'Awesome Inc.',\n  employees: 11,\n})\n\n\n\n","name":"associate with a group and update properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"identify","path":"dist/posthog-rn.d.ts","title":"identify","params":[{"name":"distinctId","type":"string","isOptional":true,"description":"A unique identifier for your user. Typically either their email or database ID."},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional dictionary with key:value pairs to set the person properties"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"details":null,"category":"Identification","examples":[{"id":"basic_identify","code":"\n\n// Basic identify\nposthog.identify('distinctID', {\n  email: 'user@posthog.com',\n  name: 'My Name'\n})\n\n\n","name":"Basic identify"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nposthog.identify('distinctID', {\n  $set: {\n    email: 'user@posthog.com',\n    name: 'My Name'\n  },\n  $set_once: {\n    date_of_first_log_in: '2024-03-01'\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates events with a specific user. Learn more about [identifying users](https://posthog.com/docs/product-analytics/identify)"},{"id":"initReactNativeNavigation","path":"dist/posthog-rn.d.ts","title":"initReactNativeNavigation","params":[{"name":"options","type":"PostHogAutocaptureOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"initreactnativenavigation","code":"// Generated example for initReactNativeNavigation\nposthog.initReactNativeNavigation();","name":"Generated example for initReactNativeNavigation"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"}},{"id":"isFeatureEnabled","path":"dist/posthog-rn.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"check_if_feature_flag_is_enabled","code":"\n\n// check if feature flag is enabled\nconst isEnabled = posthog.isFeatureEnabled('key-for-your-boolean-flag')\n\n\n\n","name":"check if feature flag is enabled"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"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."},{"id":"optIn","path":"dist/posthog-rn.d.ts","title":"optIn","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_in_to_tracking","code":"\n\n// opt in to tracking\nposthog.optIn()\n\n\n\n","name":"opt in to tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Opts the user in to data capture.\nBy default, PostHog 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."},{"id":"optOut","path":"dist/posthog-rn.d.ts","title":"optOut","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_out_of_tracking","code":"\n\n// opt out of tracking\nposthog.optOut()\n\n\n\n","name":"opt out of tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"register","path":"dist/posthog-rn.d.ts","title":"register","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":"An associative array of properties to store about the user"}],"details":null,"category":"Capture","examples":[{"id":"register_super_properties","code":"\n\n// register super properties\nposthog.register({\n    'icecream pref': 'vanilla',\n    team_id: 22,\n})\n\n\n\n","name":"register super properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"reloadFeatureFlags","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags","code":"\n\n// reload feature flags\nposthog.reloadFeatureFlags()\n\n\n\n","name":"reload feature flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Reloads feature flags from the server.\nPostHog 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."},{"id":"reloadFeatureFlagsAsync","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlagsAsync","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags_and_get_result","code":"\n\n// reload feature flags and get result\nposthog.reloadFeatureFlagsAsync().then((refreshedFlags) => console.log(refreshedFlags))\n\n\n\n","name":"reload feature flags and get result"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, boolean | string> | undefined>","name":"Promise<Record<string, boolean | string> | undefined>"},"description":"Reloads feature flags from the server asynchronously.\nPostHog 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."},{"id":"reset","path":"dist/posthog-rn.d.ts","title":"reset","params":[],"details":null,"category":"Identification","examples":[{"id":"reset_after_logout","code":"\n\n// reset after logout\nposthog.reset()\n\n\n\n","name":"reset after logout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"resetGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetGroupPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_group_properties_for_flags","code":"\n\n// reset group properties for flags\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":"reset group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets group properties for feature flag evaluation."},{"id":"resetPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_person_properties_for_flags","code":"\n\n// reset person properties for flags\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":"reset person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets person properties for feature flag evaluation."},{"id":"resetSessionId","path":"dist/posthog-rn.d.ts","title":"resetSessionId","params":[],"details":null,"category":"","examples":[{"id":"resetsessionid","code":"// Generated example for resetSessionId\nposthog.resetSessionId();","name":"Generated example for resetSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"screen","path":"dist/posthog-rn.d.ts","title":"screen","params":[{"name":"name","type":"string","isOptional":false,"description":"The name of the screen"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to include with the screen event"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"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.","category":"Capture","examples":[{"id":"basic_screen_capture","code":"\n\n// Basic screen capture\nposthog.screen('dashboard')\n\n\n","name":"Basic screen capture"},{"id":"screen_capture_with_properties","code":"\n\n// Screen capture with properties\nposthog.screen('dashboard', {\n    background: 'blue',\n    hero: 'superhog',\n})\n\n\n\n","name":"Screen capture with properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Captures a screen view event."},{"id":"setGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"Record<string, Record<string, string>>","isOptional":false,"description":"The group properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_group_properties_for_flags","code":"\n\n// set group properties for flags\nposthog.setGroupPropertiesForFlags({'company': {'property1': 'value', property2: 'value2'}})\n\n\n\n","name":"set group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets group properties for feature flag evaluation.\nThese properties are automatically attached to the current group (set via posthog.group()). When you change the group, these properties are reset."},{"id":"setPersistedProperty","path":"dist/posthog-rn.d.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""},{"name":"value","type":"T | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"setpersistedproperty","code":"// Generated example for setPersistedProperty\nposthog.setPersistedProperty();","name":"Generated example for setPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"setPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Record<string, string>","isOptional":false,"description":"The person properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_person_properties_for_flags","code":"\n\n// set person properties for flags\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n\n","name":"set person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"unregister","path":"dist/posthog-rn.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":null,"category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('icecream pref')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"autocapture","path":"dist/posthog-rn.d.ts","title":"autocapture","params":[{"name":"eventType","type":"string","isOptional":false,"description":""},{"name":"elements","type":"PostHogAutocaptureElement[]","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"autocapture","code":"// Generated example for autocapture\nposthog.autocapture();","name":"Generated example for autocapture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"capture","path":"dist/posthog-rn.d.ts","title":"capture","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capture","code":"// Generated example for capture\nposthog.capture();","name":"Generated example for capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureTraceFeedback","path":"dist/posthog-rn.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"dist/posthog-rn.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"flagsAsync","path":"dist/posthog-rn.d.ts","title":"flagsAsync","params":[{"name":"sendAnonDistinctId","type":"boolean","isOptional":true,"description":""},{"name":"fetchConfig","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"flagsasync","code":"// Generated example for flagsAsync\nposthog.flagsAsync();","name":"Generated example for flagsAsync"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse | undefined>","name":"Promise<PostHogFlagsResponse | undefined>"},"description":"* ** FEATURE FLAGS *"},{"id":"getAnonymousId","path":"dist/posthog-rn.d.ts","title":"getAnonymousId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_the_anonymous_id","code":"\n\n// get the anonymous ID\nconst anonId = posthog.getAnonymousId()\nconsole.log('Anonymous ID:', anonId)\n\n\n\n","name":"get the anonymous ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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."},{"id":"getFeatureFlagDetails","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetails","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagdetails","code":"// Generated example for getFeatureFlagDetails\nposthog.getFeatureFlagDetails();","name":"Generated example for getFeatureFlagDetails"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFeatureFlagDetails | undefined","name":"PostHogFeatureFlagDetails | undefined"}},{"id":"getFeatureFlagPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloads","code":"// Generated example for getFeatureFlagPayloads\nposthog.getFeatureFlagPayloads();","name":"Generated example for getFeatureFlagPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlagPayloads'] | undefined","name":"PostHogFlagsResponse['featureFlagPayloads'] | undefined"}},{"id":"getFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflags","code":"// Generated example for getFeatureFlags\nposthog.getFeatureFlags();","name":"Generated example for getFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"getFeatureFlagsAndPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloads","code":"// Generated example for getFeatureFlagsAndPayloads\nposthog.getFeatureFlagsAndPayloads();","name":"Generated example for getFeatureFlagsAndPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }","name":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }"}},{"id":"getKnownFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getKnownFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getknownfeatureflags","code":"// Generated example for getKnownFeatureFlags\nposthog.getKnownFeatureFlags();","name":"Generated example for getKnownFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"groupIdentify","path":"dist/posthog-rn.d.ts","title":"groupIdentify","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentify","code":"// Generated example for groupIdentify\nposthog.groupIdentify();","name":"Generated example for groupIdentify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"groups","path":"dist/posthog-rn.d.ts","title":"groups","params":[{"name":"groups","type":"PostHogGroupProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"groups","code":"// Generated example for groups\nposthog.groups();","name":"Generated example for groups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"on","path":"dist/posthog-rn.d.ts","title":"on","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"on","code":"// Generated example for on\nposthog.on();","name":"Generated example for on"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlag","path":"dist/posthog-rn.d.ts","title":"onFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(value: FeatureFlagValue) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflag","code":"// Generated example for onFeatureFlag\nposthog.onFeatureFlag();","name":"Generated example for onFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlags","path":"dist/posthog-rn.d.ts","title":"onFeatureFlags","params":[{"name":"cb","type":"(flags: PostHogFlagsResponse['featureFlags']) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflags","code":"// Generated example for onFeatureFlags\nposthog.onFeatureFlags();","name":"Generated example for onFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"overrideFeatureFlag","path":"dist/posthog-rn.d.ts","title":"overrideFeatureFlag","params":[{"name":"flags","type":"PostHogFlagsResponse['featureFlags'] | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"overridefeatureflag","code":"// Generated example for overrideFeatureFlag\nposthog.overrideFeatureFlag();","name":"Generated example for overrideFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"registerForSession","path":"dist/posthog-rn.d.ts","title":"registerForSession","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"registerforsession","code":"// Generated example for registerForSession\nposthog.registerForSession();","name":"Generated example for registerForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"reloadRemoteConfigAsync","path":"dist/posthog-rn.d.ts","title":"reloadRemoteConfigAsync","params":[],"details":null,"category":"","examples":[{"id":"reloadremoteconfigasync","code":"// Generated example for reloadRemoteConfigAsync\nposthog.reloadRemoteConfigAsync();","name":"Generated example for reloadRemoteConfigAsync"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"setupBootstrap","path":"dist/posthog-rn.d.ts","title":"setupBootstrap","params":[{"name":"options","type":"Partial<PostHogCoreOptions>","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"setupbootstrap","code":"// Generated example for setupBootstrap\nposthog.setupBootstrap();","name":"Generated example for setupBootstrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"unregisterForSession","path":"dist/posthog-rn.d.ts","title":"unregisterForSession","params":[{"name":"property","type":"string","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"unregisterforsession","code":"// Generated example for unregisterForSession\nposthog.unregisterForSession();","name":"Generated example for unregisterForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"addPendingPromise","path":"dist/posthog-rn.d.ts","title":"addPendingPromise","params":[{"name":"promise","type":"Promise<T>","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"addpendingpromise","code":"// Generated example for addPendingPromise\nposthog.addPendingPromise();","name":"Generated example for addPendingPromise"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<T>","name":"Promise<T>"}},{"id":"aliasStateless","path":"dist/posthog-rn.d.ts","title":"aliasStateless","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstateless","code":"// Generated example for aliasStateless\nposthog.aliasStateless();","name":"Generated example for aliasStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"aliasStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"aliasStatelessImmediate","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstatelessimmediate","code":"// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();","name":"Generated example for aliasStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"captureStateless","path":"dist/posthog-rn.d.ts","title":"captureStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestateless","code":"// Generated example for captureStateless\nposthog.captureStateless();","name":"Generated example for captureStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"captureStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestatelessimmediate","code":"// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();","name":"Generated example for captureStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"debug","path":"dist/posthog-rn.d.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":""}],"details":"Debug mode logs all PostHog calls to the console for troubleshooting. This is useful during development to understand what data is being sent.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"enqueue","path":"dist/posthog-rn.d.ts","title":"enqueue","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"enqueue","code":"// Generated example for enqueue\nposthog.enqueue();","name":"Generated example for enqueue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** QUEUEING AND FLUSHING *"},{"id":"getCustomHeaders","path":"dist/posthog-rn.d.ts","title":"getCustomHeaders","params":[],"details":null,"category":"","examples":[{"id":"getcustomheaders","code":"// Generated example for getCustomHeaders\nposthog.getCustomHeaders();","name":"Generated example for getCustomHeaders"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        [key: string]: string;\n    }","name":"{\n        [key: string]: string;\n    }"}},{"id":"getFeatureFlagDetailsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailsstateless","code":"// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();","name":"Generated example for getFeatureFlagDetailsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFeatureFlagDetails | undefined>","name":"Promise<PostHogFeatureFlagDetails | undefined>"}},{"id":"getFeatureFlagDetailStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailstateless","code":"// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();","name":"Generated example for getFeatureFlagDetailStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>","name":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>"}},{"id":"getFeatureFlagPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadsstateless","code":"// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();","name":"Generated example for getFeatureFlagPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>","name":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>"}},{"id":"getFeatureFlagPayloadStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadstateless","code":"// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();","name":"Generated example for getFeatureFlagPayloadStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"}},{"id":"getFeatureFlagsAndPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloadsstateless","code":"// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();","name":"Generated example for getFeatureFlagsAndPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsstateless","code":"// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();","name":"Generated example for getFeatureFlagsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagstateless","code":"// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();","name":"Generated example for getFeatureFlagStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>","name":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>"}},{"id":"getFlags","path":"dist/posthog-rn.d.ts","title":"getFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"extraPayload","type":"Record<string, any>","isOptional":true,"description":""},{"name":"fetchConfig","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getflags","code":"// Generated example for getFlags\nposthog.getFlags();","name":"Generated example for getFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse | undefined>","name":"Promise<PostHogFlagsResponse | undefined>"},"description":"* ** FEATURE FLAGS *"},{"id":"getRemoteConfig","path":"dist/posthog-rn.d.ts","title":"getRemoteConfig","params":[],"details":null,"category":"","examples":[{"id":"getremoteconfig","code":"// Generated example for getRemoteConfig\nposthog.getRemoteConfig();","name":"Generated example for getRemoteConfig"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"getSurveysStateless","path":"dist/posthog-rn.d.ts","title":"getSurveysStateless","params":[],"details":null,"category":"","examples":[{"id":"getsurveysstateless","code":"// Generated example for getSurveysStateless\nposthog.getSurveysStateless();","name":"Generated example for getSurveysStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"},"description":"* ** SURVEYS *"},{"id":"groupIdentifyStateless","path":"dist/posthog-rn.d.ts","title":"groupIdentifyStateless","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""},{"name":"distinctId","type":"string","isOptional":true,"description":""},{"name":"eventProperties","type":"PostHogEventProperties","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentifystateless","code":"// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();","name":"Generated example for groupIdentifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"identifyStateless","path":"dist/posthog-rn.d.ts","title":"identifyStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystateless","code":"// Generated example for identifyStateless\nposthog.identifyStateless();","name":"Generated example for identifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** TRACKING *"},{"id":"identifyStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"identifyStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystatelessimmediate","code":"// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();","name":"Generated example for identifyStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"logMsgIfDebug","path":"dist/posthog-rn.d.ts","title":"logMsgIfDebug","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"logmsgifdebug","code":"// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();","name":"Generated example for logMsgIfDebug"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"sendImmediate","path":"dist/posthog-rn.d.ts","title":"sendImmediate","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"sendimmediate","code":"// Generated example for sendImmediate\nposthog.sendImmediate();","name":"Generated example for sendImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"shutdown","path":"dist/posthog-rn.d.ts","title":"shutdown","params":[{"name":"shutdownTimeoutMs","type":"number","isOptional":true,"description":"Maximum time to wait for shutdown in milliseconds"}],"details":null,"category":"Initialization","examples":[{"id":"shutdown_before_process_exit","code":"\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n  await posthog.shutdown()\n  process.exit(0)\n})\n\n\n\n","name":"shutdown before process exit"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Shuts down the PostHog 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 PostHog instance after calling it. Use flush() for per-request cleanup instead."},{"id":"wrap","path":"dist/posthog-rn.d.ts","title":"wrap","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"wrap","code":"// Generated example for wrap\nposthog.wrap();","name":"Generated example for wrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}}]}],"version":"4.10.4","categories":["Initialization","Identification","Capture","Error tracking","Feature flags","Group analytics","Privacy","LLM analytics"],"referenceId":"posthog-react-native"},"createdAt":"2025-10-25T22:45:02.221Z","updatedAt":"2025-10-25T22:45:02.221Z","publishedAt":"2025-10-25T22:45:02.218Z"}},{"id":23,"attributes":{"referenceId":"posthog-react-native","version":"4.7.0","data":{"id":"posthog-react-native-4.7.0","info":{"id":"posthog-react-native","title":"PostHog React Native SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"4.7.0","slugPrefix":"posthog-react-native","description":"PostHog React Native SDK allows you to capture events and send them to PostHog from your React Native applications."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"../core/src/types.ts","properties":[{"name":"Contains","type":"\"contains\""},{"name":"Exact","type":"\"exact\""},{"name":"Regex","type":"\"regex\""}]},{"id":"ActionStepType","name":"ActionStepType","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}","properties":[]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Open;\n}","properties":[]},{"id":"Compression","name":"Compression","path":"../core/src/types.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"EndBranching","name":"EndBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.End;\n}","properties":[]},{"id":"EvaluationReason","name":"EvaluationReason","path":"../core/src/types.ts","example":"{\n    code: string | undefined;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","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}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"../core/src/types.ts","example":"{\n    id: number | undefined;\n    version: number | undefined;\n    description: string | undefined;\n    payload: string | undefined;\n}","properties":[]},{"id":"FeatureFlagValue","name":"FeatureFlagValue","path":"../core/src/types.ts","example":"string | boolean","properties":[]},{"id":"FeatureFlagWithPayload","name":"FeatureFlagWithPayload","path":"dist/hooks/useFeatureFlag.d.ts","example":"[FeatureFlagValue | undefined, JsonType | undefined]","properties":[]},{"id":"JsonType","name":"JsonType","path":"../core/src/types.ts","example":"string | number | boolean | null | {\n    [key: string]: JsonType;\n} | Array<JsonType> | JsonType[]","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Link;\n    link?: string;\n}","properties":[]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n    choices: string[];\n    hasOpenChoice?: boolean;\n    shuffleOptions?: boolean;\n}","properties":[]},{"id":"NextQuestionBranching","name":"NextQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.NextQuestion;\n}","properties":[]},{"id":"PartialWithRequired","name":"PartialWithRequired","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}","properties":[]},{"id":"PostHogAutocaptureElement","name":"PostHogAutocaptureElement","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} & PostHogEventProperties","properties":[]},{"id":"PostHogAutocaptureNavigationTrackerOptions","name":"PostHogAutocaptureNavigationTrackerOptions","path":"dist/types.d.ts","example":"{\n    routeToName?: (name: string, params: any) => string;\n    routeToProperties?: (name: string, params: any) => Record<string, any>;\n}","properties":[]},{"id":"PostHogAutocaptureOptions","name":"PostHogAutocaptureOptions","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?: PostHogAutocaptureNavigationTrackerOptions;\n    navigationRef?: PostHogNavigationRef;\n}","properties":[]},{"id":"PostHogCaptureOptions","name":"PostHogCaptureOptions","path":"../core/src/types.ts","example":"{\n    uuid?: string;\n    timestamp?: Date;\n    disableGeoip?: boolean;\n}","properties":[]},{"id":"PostHogCoreOptions","name":"PostHogCoreOptions","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}","properties":[]},{"id":"PostHogCustomAppProperties","name":"PostHogCustomAppProperties","path":"dist/types.d.ts","properties":[{"name":"$app_build","type":"string | null","description":"Build number like \"1.2.2\" or \"122\""},{"name":"$app_name","type":"string | null","description":"Name of the app as displayed below the icon like \"PostHog\""},{"name":"$app_namespace","type":"string | null","description":"Namespace of the app usually like \"com.posthog.app\""},{"name":"$app_version","type":"string | null","description":"Human friendly app version like what a user would see in the app store like \"1.2.2\""},{"name":"$device_manufacturer","type":"string | null","description":"Manufacturer like \"Apple\", \"Samsung\" or \"Android\""},{"name":"$device_model","type":"string | null","description":"Model identifier like \"iPhone13,2\" or \"SM-S921B\""},{"name":"$device_name","type":"string | null","description":"Readable model name like \"iPhone 12\" or \"Samsung Galaxy S24\""},{"name":"$device_type","type":"string | null","description":"Device type (\"Mobile\" | \"Desktop\" | \"Web\")"},{"name":"$locale","type":"string | null","description":"Locale (language) of the device like \"en-US\""},{"name":"$os_name","type":"string | null","description":"Operating system name like iOS or Android"},{"name":"$os_version","type":"string | null","description":"Operating system version \"14.0\""},{"name":"$timezone","type":"string | null","description":"Timezone of the device like \"Europe/Berlin\""}]},{"id":"PostHogCustomStorage","name":"PostHogCustomStorage","path":"dist/types.d.ts","properties":[{"name":"getItem","type":"(key: string) => string | null | Promise<string | null>"},{"name":"setItem","type":"(key: string, value: string) => void | Promise<void>"}]},{"id":"PostHogEventProperties","name":"PostHogEventProperties","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: 'user@example.com',\n        name: 'John Doe'\n    }\n}","properties":[]},{"id":"PostHogFeatureFlagDetails","name":"PostHogFeatureFlagDetails","path":"../core/src/types.ts","example":"\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"","properties":[]},{"id":"PostHogFetchOptions","name":"PostHogFetchOptions","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}","properties":[]},{"id":"PostHogFetchResponse","name":"PostHogFetchResponse","path":"../core/src/types.ts","example":"{\n    status: number;\n    text: () => Promise<string>;\n    json: () => Promise<any>;\n}","properties":[]},{"id":"PostHogFlagsResponse","name":"PostHogFlagsResponse","path":"../core/src/types.ts","example":"Omit<PostHogRemoteConfig, 'surveys' | '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}","properties":[]},{"id":"PostHogGroupProperties","name":"PostHogGroupProperties","path":"../core/src/types.ts","example":"{\n    [type: string]: string | number;\n}","properties":[]},{"id":"PostHogNavigationRef","name":"PostHogNavigationRef","path":"dist/types.d.ts","example":"{\n    getCurrentRoute(): any | undefined;\n    isReady: () => boolean;\n    current?: PostHogNavigationRef | any | undefined;\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"dist/posthog-rn.d.ts","example":"PostHogCoreOptions & {\n    persistence?: 'memory' | 'file';\n    customAppProperties?: PostHogCustomAppProperties | ((properties: PostHogCustomAppProperties) => PostHogCustomAppProperties);\n    customStorage?: PostHogCustomStorage;\n    captureAppLifecycleEvents?: boolean;\n    enableSessionReplay?: boolean;\n    sessionReplayConfig?: PostHogSessionReplayConfig;\n    enablePersistSessionIdAcrossRestart?: boolean;\n}","properties":[]},{"id":"PostHogPersistedProperty","name":"PostHogPersistedProperty","path":"../core/src/types.ts","properties":[{"name":"AnonymousId","type":"\"anonymous_id\""},{"name":"BootstrapFeatureFlagDetails","type":"\"bootstrap_feature_flag_details\""},{"name":"BootstrapFeatureFlagPayloads","type":"\"bootstrap_feature_flag_payloads\""},{"name":"BootstrapFeatureFlags","type":"\"bootstrap_feature_flags\""},{"name":"DistinctId","type":"\"distinct_id\""},{"name":"FeatureFlagDetails","type":"\"feature_flag_details\""},{"name":"FeatureFlagPayloads","type":"\"feature_flag_payloads\""},{"name":"FeatureFlags","type":"\"feature_flags\""},{"name":"FlagsEndpointWasHit","type":"\"flags_endpoint_was_hit\""},{"name":"GroupProperties","type":"\"group_properties\""},{"name":"InstalledAppBuild","type":"\"installed_app_build\""},{"name":"InstalledAppVersion","type":"\"installed_app_version\""},{"name":"OptedOut","type":"\"opted_out\""},{"name":"OverrideFeatureFlags","type":"\"override_feature_flags\""},{"name":"PersonProperties","type":"\"person_properties\""},{"name":"Props","type":"\"props\""},{"name":"Queue","type":"\"queue\""},{"name":"RemoteConfig","type":"\"remote_config\""},{"name":"SessionId","type":"\"session_id\""},{"name":"SessionLastTimestamp","type":"\"session_timestamp\""},{"name":"SessionReplay","type":"\"session_replay\""},{"name":"SessionStartTimestamp","type":"\"session_start_timestamp\""},{"name":"SurveyLastSeenDate","type":"\"survey_last_seen_date\""},{"name":"Surveys","type":"\"surveys\""},{"name":"SurveysSeen","type":"\"surveys_seen\""}]},{"id":"PostHogProviderProps","name":"PostHogProviderProps","path":"dist/PostHogProvider.d.ts","properties":[{"name":"apiKey","type":"string","description":"Your PostHog API key"},{"name":"autocapture","type":"boolean | PostHogAutocaptureOptions","description":"Autocapture configuration - can be a boolean or detailed options"},{"name":"children","type":"React.ReactNode","description":"The child components to render within the PostHog context"},{"name":"client","type":"PostHog","description":"An existing PostHog client instance"},{"name":"debug","type":"boolean","description":"Enable debug mode for additional logging"},{"name":"options","type":"PostHogOptions","description":"PostHog configuration options"},{"name":"style","type":"StyleProp<ViewStyle>","description":"Custom styles for the provider wrapper View"}]},{"id":"PostHogRemoteConfig","name":"PostHogRemoteConfig","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}","properties":[]},{"id":"PostHogSessionReplayConfig","name":"PostHogSessionReplayConfig","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}","properties":[]},{"id":"PostHogSurveyProviderProps","name":"PostHogSurveyProviderProps","path":"dist/surveys/PostHogSurveyProvider.d.ts","example":"{\n    defaultSurveyAppearance?: SurveyAppearance;\n    overrideAppearanceWithDefault?: boolean;\n    client?: PostHog;\n    children: React.ReactNode;\n}","properties":[]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Rating;\n    display: SurveyRatingDisplay;\n    scale: 3 | 5 | 7 | 10;\n    lowerBoundLabel: string;\n    upperBoundLabel: string;\n}","properties":[]},{"id":"ResponseBasedBranching","name":"ResponseBasedBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.ResponseBased;\n    responseValues: Record<string, any>;\n}","properties":[]},{"id":"RetriableOptions","name":"RetriableOptions","path":"../core/src/utils/index.ts","properties":[{"name":"retryCheck","type":"(err: unknown) => boolean"},{"name":"retryCount","type":"number"},{"name":"retryDelay","type":"number"}]},{"id":"SpecificQuestionBranching","name":"SpecificQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.SpecificQuestion;\n    index: number;\n}","properties":[]},{"id":"Survey","name":"Survey","path":"../core/src/types.ts","example":"{\n    id: string;\n    name: string;\n    description?: string;\n    type: SurveyType;\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}","properties":[]},{"id":"SurveyActionType","name":"SurveyActionType","path":"../core/src/types.ts","example":"{\n    id: number;\n    name?: string;\n    steps?: ActionStepType[];\n}","properties":[]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"../core/src/types.ts","example":"{\n    backgroundColor?: string;\n    submitButtonColor?: string;\n    submitButtonText?: string;\n    submitButtonTextColor?: string;\n    ratingButtonColor?: string;\n    ratingButtonActiveColor?: 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}","properties":[]},{"id":"SurveyAppearanceTheme","name":"SurveyAppearanceTheme","path":"dist/surveys/surveys-utils.d.ts","example":"\"widgetSelector\" | \"widgetType\" | \"widgetColor\" | \"widgetLabel\" | \"shuffleQuestions\"","properties":[]},{"id":"SurveyMatchType","name":"SurveyMatchType","path":"../core/src/types.ts","properties":[{"name":"Exact","type":"\"exact\""},{"name":"Icontains","type":"\"icontains\""},{"name":"IsNot","type":"\"is_not\""},{"name":"NotIcontains","type":"\"not_icontains\""},{"name":"NotRegex","type":"\"not_regex\""},{"name":"Regex","type":"\"regex\""}]},{"id":"SurveyModalProps","name":"SurveyModalProps","path":"dist/surveys/components/SurveyModal.d.ts","example":"{\n    survey: Survey;\n    appearance: SurveyAppearanceTheme;\n    onShow: () => void;\n    onClose: (submitted: boolean) => void;\n}","properties":[]},{"id":"SurveyPosition","name":"SurveyPosition","path":"../core/src/types.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"../core/src/types.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBase","name":"SurveyQuestionBase","path":"../core/src/types.ts","example":"{\n    question: string;\n    id: string;\n    description?: string;\n    descriptionContentType?: SurveyQuestionDescriptionContentType;\n    optional?: boolean;\n    buttonText?: string;\n    originalQuestionIndex: number;\n    branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n}","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"../core/src/types.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"../core/src/types.ts","properties":[{"name":"Html","type":"\"html\""},{"name":"Text","type":"\"text\""}]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"../core/src/types.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRatingDisplay","name":"SurveyRatingDisplay","path":"../core/src/types.ts","properties":[{"name":"Emoji","type":"\"emoji\""},{"name":"Number","type":"\"number\""}]},{"id":"SurveyResponse","name":"SurveyResponse","path":"../core/src/types.ts","example":"{\n    surveys: Survey[];\n}","properties":[]},{"id":"SurveyType","name":"SurveyType","path":"../core/src/types.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"../core/src/types.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHogProvider","title":"PostHogProvider","params":[{"name":"{ children, client, options, apiKey, autocapture, style, debug, }","type":"PostHogProviderProps","isOptional":false,"description":""}],"details":null,"category":"Initialization","examples":[{"id":"add_to_app.(js|ts)","code":"\n\n// Add to App.(js|ts)\nimport { usePostHog, PostHogProvider } from 'posthog-react-native'\n\nexport function MyApp() {\n    return (\n        <PostHogProvider apiKey=\"<ph_project_api_key>\" options={{\n            host: '<ph_client_api_host>',\n        }}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n// And access the PostHog client via the usePostHog hook\nimport { usePostHog } from 'posthog-react-native'\n\nconst MyComponent = () => {\n    const posthog = usePostHog()\n\n    useEffect(() => {\n        posthog.capture(\"event_name\")\n    }, [posthog])\n}\n\n\n\n","name":"Add to App.(js|ts)"},{"id":"using_with_existing_client","code":"\n\n// Using with existing client\nimport { PostHog } from 'posthog-react-native'\n\nconst posthog = new PostHog('<ph_project_api_key>', {\n    host: '<ph_client_api_host>'\n})\n\nexport function MyApp() {\n    return (\n        <PostHogProvider client={posthog}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n\n\n","name":"Using with existing client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JSX.Element | null","name":"JSX.Element | null"},"description":"PostHogProvider is a React component that provides PostHog functionality to your React Native app. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nAutocapturing navigation requires further configuration. See the [React Native SDK navigation docs](https://posthog.com/docs/libraries/react-native#capturing-screen-views) for more information about autocapturing navigation.\nThis is the recommended way to set up PostHog for React Native. This utilizes the Context API to pass the PostHog client around, enable autocapture."},{"id":"PostHog","path":"dist/posthog-rn.d.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"PostHog configuration options"}],"details":null,"category":"Initialization","examples":[{"id":"posthog.ts","code":"\n\n// posthog.ts\nimport PostHog from 'posthog-react-native'\n\nexport const posthog = new PostHog('<ph_project_api_key>', {\n  host: '<ph_client_api_host>'\n})\n\n// Then you can access PostHog by importing your instance\n// Another file:\nimport { posthog } from './posthog'\n\nexport function MyApp1() {\n    useEffect(async () => {\n        posthog.capture('event_name')\n    }, [posthog])\n\n    return <View>Your app code</View>\n}\n\n\n\n","name":"posthog.ts"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Creates a new PostHog instance for React Native. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nIf you prefer not to use the PostHogProvider, you can initialize PostHog in its own file and import the instance from there."},{"id":"alias","path":"dist/posthog-rn.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"The alias to assign to the current user"}],"details":null,"category":"Identification","examples":[{"id":"set_alias_for_current_user","code":"\n\n// set alias for current user\nposthog.alias('distinct_id')\n\n\n\n","name":"set alias for current user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"fetch","path":"dist/posthog-rn.d.ts","title":"fetch","params":[{"name":"url","type":"string","isOptional":false,"description":""},{"name":"options","type":"PostHogFetchOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"fetch","code":"// Generated example for fetch\nposthog.fetch();","name":"Generated example for fetch"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFetchResponse>","name":"Promise<PostHogFetchResponse>"}},{"id":"flush","path":"dist/posthog-rn.d.ts","title":"flush","params":[],"details":null,"category":"Capture","examples":[{"id":"manually_flush_the_queue","code":"\n\n// manually flush the queue\nawait posthog.flush()\n\n\n\n","name":"manually flush the queue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"getCommonEventProperties","path":"dist/posthog-rn.d.ts","title":"getCommonEventProperties","params":[],"details":null,"category":"","examples":[{"id":"getcommoneventproperties","code":"// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();","name":"Generated example for getCommonEventProperties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogEventProperties","name":"PostHogEventProperties"}},{"id":"getCustomUserAgent","path":"dist/posthog-rn.d.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"","examples":[{"id":"getcustomuseragent","code":"// Generated example for getCustomUserAgent\nposthog.getCustomUserAgent();","name":"Generated example for getCustomUserAgent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getDistinctId","path":"dist/posthog-rn.d.ts","title":"getDistinctId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_current_distinct_id","code":"\n\n// get current distinct ID\nconst distinctId = posthog.getDistinctId()\n\n\n\n","name":"get current distinct ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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 PostHog or the ID that has been passed by a call to identify()."},{"id":"getFeatureFlag","path":"dist/posthog-rn.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_value","code":"\n\n// get feature flag value\nconst value = posthog.getFeatureFlag('key-for-your-boolean-flag')\n\n\n\n","name":"get feature flag value"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"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."},{"id":"getFeatureFlagPayload","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_payload","code":"\n\n// get feature flag payload\nconst payload = posthog.getFeatureFlagPayload('key-for-your-multivariate-flag')\n\n\n\n","name":"get feature flag payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType | undefined","name":"JsonType | undefined"},"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."},{"id":"getLibraryId","path":"dist/posthog-rn.d.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getLibraryVersion","path":"dist/posthog-rn.d.ts","title":"getLibraryVersion","params":[],"details":null,"category":"","examples":[{"id":"getlibraryversion","code":"// Generated example for getLibraryVersion\nposthog.getLibraryVersion();","name":"Generated example for getLibraryVersion"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getPersistedProperty","path":"dist/posthog-rn.d.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"getpersistedproperty","code":"// Generated example for getPersistedProperty\nposthog.getPersistedProperty();","name":"Generated example for getPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"T | undefined","name":"T | undefined"}},{"id":"getSessionId","path":"dist/posthog-rn.d.ts","title":"getSessionId","params":[],"details":null,"category":"","examples":[{"id":"getsessionid","code":"// Generated example for getSessionId\nposthog.getSessionId();","name":"Generated example for getSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getSurveys","path":"dist/posthog-rn.d.ts","title":"getSurveys","params":[],"details":null,"category":"","examples":[{"id":"getsurveys","code":"// Generated example for getSurveys\nposthog.getSurveys();","name":"Generated example for getSurveys"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"}},{"id":"group","path":"dist/posthog-rn.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"The type of group (e.g. 'company', 'team')"},{"name":"groupKey","type":"string","isOptional":false,"description":"The unique identifier for the group"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to set for the group"}],"details":null,"category":"Group analytics","examples":[{"id":"associate_with_a_group","code":"\n\n// associate with a group\nposthog.group('company', 'company_id_in_your_db')\n\n\n","name":"associate with a group"},{"id":"associate_with_a_group_and_update_properties","code":"\n\n// associate with a group and update properties\nposthog.group('company', 'company_id_in_your_db', {\n  name: 'Awesome Inc.',\n  employees: 11,\n})\n\n\n\n","name":"associate with a group and update properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"identify","path":"dist/posthog-rn.d.ts","title":"identify","params":[{"name":"distinctId","type":"string","isOptional":true,"description":"A unique identifier for your user. Typically either their email or database ID."},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional dictionary with key:value pairs to set the person properties"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"details":null,"category":"Identification","examples":[{"id":"basic_identify","code":"\n\n// Basic identify\nposthog.identify('distinctID', {\n  email: 'user@posthog.com',\n  name: 'My Name'\n})\n\n\n","name":"Basic identify"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nposthog.identify('distinctID', {\n  $set: {\n    email: 'user@posthog.com',\n    name: 'My Name'\n  },\n  $set_once: {\n    date_of_first_log_in: '2024-03-01'\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates events with a specific user. Learn more about [identifying users](https://posthog.com/docs/product-analytics/identify)"},{"id":"initReactNativeNavigation","path":"dist/posthog-rn.d.ts","title":"initReactNativeNavigation","params":[{"name":"options","type":"PostHogAutocaptureOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"initreactnativenavigation","code":"// Generated example for initReactNativeNavigation\nposthog.initReactNativeNavigation();","name":"Generated example for initReactNativeNavigation"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"}},{"id":"isFeatureEnabled","path":"dist/posthog-rn.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"check_if_feature_flag_is_enabled","code":"\n\n// check if feature flag is enabled\nconst isEnabled = posthog.isFeatureEnabled('key-for-your-boolean-flag')\n\n\n\n","name":"check if feature flag is enabled"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"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."},{"id":"optIn","path":"dist/posthog-rn.d.ts","title":"optIn","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_in_to_tracking","code":"\n\n// opt in to tracking\nposthog.optIn()\n\n\n\n","name":"opt in to tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Opts the user in to data capture.\nBy default, PostHog 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."},{"id":"optOut","path":"dist/posthog-rn.d.ts","title":"optOut","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_out_of_tracking","code":"\n\n// opt out of tracking\nposthog.optOut()\n\n\n\n","name":"opt out of tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"register","path":"dist/posthog-rn.d.ts","title":"register","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":"An associative array of properties to store about the user"}],"details":null,"category":"Capture","examples":[{"id":"register_super_properties","code":"\n\n// register super properties\nposthog.register({\n    'icecream pref': 'vanilla',\n    team_id: 22,\n})\n\n\n\n","name":"register super properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"reloadFeatureFlags","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags","code":"\n\n// reload feature flags\nposthog.reloadFeatureFlags()\n\n\n\n","name":"reload feature flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Reloads feature flags from the server.\nPostHog 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."},{"id":"reloadFeatureFlagsAsync","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlagsAsync","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags_and_get_result","code":"\n\n// reload feature flags and get result\nposthog.reloadFeatureFlagsAsync().then((refreshedFlags) => console.log(refreshedFlags))\n\n\n\n","name":"reload feature flags and get result"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, boolean | string> | undefined>","name":"Promise<Record<string, boolean | string> | undefined>"},"description":"Reloads feature flags from the server asynchronously.\nPostHog 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."},{"id":"reset","path":"dist/posthog-rn.d.ts","title":"reset","params":[],"details":null,"category":"Identification","examples":[{"id":"reset_after_logout","code":"\n\n// reset after logout\nposthog.reset()\n\n\n\n","name":"reset after logout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"resetGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetGroupPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_group_properties_for_flags","code":"\n\n// reset group properties for flags\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":"reset group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets group properties for feature flag evaluation."},{"id":"resetPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_person_properties_for_flags","code":"\n\n// reset person properties for flags\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":"reset person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets person properties for feature flag evaluation."},{"id":"resetSessionId","path":"dist/posthog-rn.d.ts","title":"resetSessionId","params":[],"details":null,"category":"","examples":[{"id":"resetsessionid","code":"// Generated example for resetSessionId\nposthog.resetSessionId();","name":"Generated example for resetSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"screen","path":"dist/posthog-rn.d.ts","title":"screen","params":[{"name":"name","type":"string","isOptional":false,"description":"The name of the screen"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to include with the screen event"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"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.","category":"Capture","examples":[{"id":"basic_screen_capture","code":"\n\n// Basic screen capture\nposthog.screen('dashboard')\n\n\n","name":"Basic screen capture"},{"id":"screen_capture_with_properties","code":"\n\n// Screen capture with properties\nposthog.screen('dashboard', {\n    background: 'blue',\n    hero: 'superhog',\n})\n\n\n\n","name":"Screen capture with properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Captures a screen view event."},{"id":"setGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"Record<string, Record<string, string>>","isOptional":false,"description":"The group properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_group_properties_for_flags","code":"\n\n// set group properties for flags\nposthog.setGroupPropertiesForFlags({'company': {'property1': 'value', property2: 'value2'}})\n\n\n\n","name":"set group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets group properties for feature flag evaluation.\nThese properties are automatically attached to the current group (set via posthog.group()). When you change the group, these properties are reset."},{"id":"setPersistedProperty","path":"dist/posthog-rn.d.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""},{"name":"value","type":"T | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"setpersistedproperty","code":"// Generated example for setPersistedProperty\nposthog.setPersistedProperty();","name":"Generated example for setPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"setPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Record<string, string>","isOptional":false,"description":"The person properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_person_properties_for_flags","code":"\n\n// set person properties for flags\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n\n","name":"set person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"unregister","path":"dist/posthog-rn.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":null,"category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('icecream pref')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"autocapture","path":"dist/posthog-rn.d.ts","title":"autocapture","params":[{"name":"eventType","type":"string","isOptional":false,"description":""},{"name":"elements","type":"PostHogAutocaptureElement[]","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"autocapture","code":"// Generated example for autocapture\nposthog.autocapture();","name":"Generated example for autocapture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"capture","path":"dist/posthog-rn.d.ts","title":"capture","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capture","code":"// Generated example for capture\nposthog.capture();","name":"Generated example for capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureException","path":"dist/posthog-rn.d.ts","title":"captureException","params":[{"name":"error","type":"unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"PostHogEventProperties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a caught exception manually"},{"id":"captureTraceFeedback","path":"dist/posthog-rn.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"dist/posthog-rn.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"getAnonymousId","path":"dist/posthog-rn.d.ts","title":"getAnonymousId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_the_anonymous_id","code":"\n\n// get the anonymous ID\nconst anonId = posthog.getAnonymousId()\nconsole.log('Anonymous ID:', anonId)\n\n\n\n","name":"get the anonymous ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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."},{"id":"getFeatureFlagDetails","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetails","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagdetails","code":"// Generated example for getFeatureFlagDetails\nposthog.getFeatureFlagDetails();","name":"Generated example for getFeatureFlagDetails"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFeatureFlagDetails | undefined","name":"PostHogFeatureFlagDetails | undefined"}},{"id":"getFeatureFlagPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloads","code":"// Generated example for getFeatureFlagPayloads\nposthog.getFeatureFlagPayloads();","name":"Generated example for getFeatureFlagPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlagPayloads'] | undefined","name":"PostHogFlagsResponse['featureFlagPayloads'] | undefined"}},{"id":"getFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflags","code":"// Generated example for getFeatureFlags\nposthog.getFeatureFlags();","name":"Generated example for getFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"getFeatureFlagsAndPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloads","code":"// Generated example for getFeatureFlagsAndPayloads\nposthog.getFeatureFlagsAndPayloads();","name":"Generated example for getFeatureFlagsAndPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }","name":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }"}},{"id":"getKnownFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getKnownFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getknownfeatureflags","code":"// Generated example for getKnownFeatureFlags\nposthog.getKnownFeatureFlags();","name":"Generated example for getKnownFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"groupIdentify","path":"dist/posthog-rn.d.ts","title":"groupIdentify","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentify","code":"// Generated example for groupIdentify\nposthog.groupIdentify();","name":"Generated example for groupIdentify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"groups","path":"dist/posthog-rn.d.ts","title":"groups","params":[{"name":"groups","type":"PostHogGroupProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"groups","code":"// Generated example for groups\nposthog.groups();","name":"Generated example for groups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"on","path":"dist/posthog-rn.d.ts","title":"on","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"on","code":"// Generated example for on\nposthog.on();","name":"Generated example for on"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlag","path":"dist/posthog-rn.d.ts","title":"onFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(value: FeatureFlagValue) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflag","code":"// Generated example for onFeatureFlag\nposthog.onFeatureFlag();","name":"Generated example for onFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlags","path":"dist/posthog-rn.d.ts","title":"onFeatureFlags","params":[{"name":"cb","type":"(flags: PostHogFlagsResponse['featureFlags']) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflags","code":"// Generated example for onFeatureFlags\nposthog.onFeatureFlags();","name":"Generated example for onFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"overrideFeatureFlag","path":"dist/posthog-rn.d.ts","title":"overrideFeatureFlag","params":[{"name":"flags","type":"PostHogFlagsResponse['featureFlags'] | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"overridefeatureflag","code":"// Generated example for overrideFeatureFlag\nposthog.overrideFeatureFlag();","name":"Generated example for overrideFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"registerForSession","path":"dist/posthog-rn.d.ts","title":"registerForSession","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"registerforsession","code":"// Generated example for registerForSession\nposthog.registerForSession();","name":"Generated example for registerForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"reloadRemoteConfigAsync","path":"dist/posthog-rn.d.ts","title":"reloadRemoteConfigAsync","params":[],"details":null,"category":"","examples":[{"id":"reloadremoteconfigasync","code":"// Generated example for reloadRemoteConfigAsync\nposthog.reloadRemoteConfigAsync();","name":"Generated example for reloadRemoteConfigAsync"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"setupBootstrap","path":"dist/posthog-rn.d.ts","title":"setupBootstrap","params":[{"name":"options","type":"Partial<PostHogCoreOptions>","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"setupbootstrap","code":"// Generated example for setupBootstrap\nposthog.setupBootstrap();","name":"Generated example for setupBootstrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"unregisterForSession","path":"dist/posthog-rn.d.ts","title":"unregisterForSession","params":[{"name":"property","type":"string","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"unregisterforsession","code":"// Generated example for unregisterForSession\nposthog.unregisterForSession();","name":"Generated example for unregisterForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"addPendingPromise","path":"dist/posthog-rn.d.ts","title":"addPendingPromise","params":[{"name":"promise","type":"Promise<T>","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"addpendingpromise","code":"// Generated example for addPendingPromise\nposthog.addPendingPromise();","name":"Generated example for addPendingPromise"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<T>","name":"Promise<T>"}},{"id":"aliasStateless","path":"dist/posthog-rn.d.ts","title":"aliasStateless","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstateless","code":"// Generated example for aliasStateless\nposthog.aliasStateless();","name":"Generated example for aliasStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"aliasStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"aliasStatelessImmediate","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstatelessimmediate","code":"// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();","name":"Generated example for aliasStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"captureStateless","path":"dist/posthog-rn.d.ts","title":"captureStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestateless","code":"// Generated example for captureStateless\nposthog.captureStateless();","name":"Generated example for captureStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"captureStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestatelessimmediate","code":"// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();","name":"Generated example for captureStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"debug","path":"dist/posthog-rn.d.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":""}],"details":"Debug mode logs all PostHog calls to the console for troubleshooting. This is useful during development to understand what data is being sent.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"enqueue","path":"dist/posthog-rn.d.ts","title":"enqueue","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"enqueue","code":"// Generated example for enqueue\nposthog.enqueue();","name":"Generated example for enqueue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** QUEUEING AND FLUSHING *"},{"id":"getCustomHeaders","path":"dist/posthog-rn.d.ts","title":"getCustomHeaders","params":[],"details":null,"category":"","examples":[{"id":"getcustomheaders","code":"// Generated example for getCustomHeaders\nposthog.getCustomHeaders();","name":"Generated example for getCustomHeaders"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        [key: string]: string;\n    }","name":"{\n        [key: string]: string;\n    }"}},{"id":"getFeatureFlagDetailsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailsstateless","code":"// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();","name":"Generated example for getFeatureFlagDetailsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFeatureFlagDetails | undefined>","name":"Promise<PostHogFeatureFlagDetails | undefined>"}},{"id":"getFeatureFlagDetailStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailstateless","code":"// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();","name":"Generated example for getFeatureFlagDetailStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>","name":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>"}},{"id":"getFeatureFlagPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadsstateless","code":"// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();","name":"Generated example for getFeatureFlagPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>","name":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>"}},{"id":"getFeatureFlagPayloadStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadstateless","code":"// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();","name":"Generated example for getFeatureFlagPayloadStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"}},{"id":"getFeatureFlagsAndPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloadsstateless","code":"// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();","name":"Generated example for getFeatureFlagsAndPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsstateless","code":"// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();","name":"Generated example for getFeatureFlagsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagstateless","code":"// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();","name":"Generated example for getFeatureFlagStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>","name":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>"}},{"id":"getFlags","path":"dist/posthog-rn.d.ts","title":"getFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"extraPayload","type":"Record<string, any>","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getflags","code":"// Generated example for getFlags\nposthog.getFlags();","name":"Generated example for getFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse | undefined>","name":"Promise<PostHogFlagsResponse | undefined>"},"description":"* ** FEATURE FLAGS *"},{"id":"getRemoteConfig","path":"dist/posthog-rn.d.ts","title":"getRemoteConfig","params":[],"details":null,"category":"","examples":[{"id":"getremoteconfig","code":"// Generated example for getRemoteConfig\nposthog.getRemoteConfig();","name":"Generated example for getRemoteConfig"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"getSurveysStateless","path":"dist/posthog-rn.d.ts","title":"getSurveysStateless","params":[],"details":null,"category":"","examples":[{"id":"getsurveysstateless","code":"// Generated example for getSurveysStateless\nposthog.getSurveysStateless();","name":"Generated example for getSurveysStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"},"description":"* ** SURVEYS *"},{"id":"groupIdentifyStateless","path":"dist/posthog-rn.d.ts","title":"groupIdentifyStateless","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""},{"name":"distinctId","type":"string","isOptional":true,"description":""},{"name":"eventProperties","type":"PostHogEventProperties","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentifystateless","code":"// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();","name":"Generated example for groupIdentifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"identifyStateless","path":"dist/posthog-rn.d.ts","title":"identifyStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystateless","code":"// Generated example for identifyStateless\nposthog.identifyStateless();","name":"Generated example for identifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** TRACKING *"},{"id":"identifyStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"identifyStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystatelessimmediate","code":"// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();","name":"Generated example for identifyStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"logMsgIfDebug","path":"dist/posthog-rn.d.ts","title":"logMsgIfDebug","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"logmsgifdebug","code":"// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();","name":"Generated example for logMsgIfDebug"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"sendImmediate","path":"dist/posthog-rn.d.ts","title":"sendImmediate","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"sendimmediate","code":"// Generated example for sendImmediate\nposthog.sendImmediate();","name":"Generated example for sendImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"shutdown","path":"dist/posthog-rn.d.ts","title":"shutdown","params":[{"name":"shutdownTimeoutMs","type":"number","isOptional":true,"description":"Maximum time to wait for shutdown in milliseconds"}],"details":null,"category":"Initialization","examples":[{"id":"shutdown_before_process_exit","code":"\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n  await posthog.shutdown()\n  process.exit(0)\n})\n\n\n\n","name":"shutdown before process exit"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Shuts down the PostHog 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 PostHog instance after calling it. Use flush() for per-request cleanup instead."},{"id":"wrap","path":"dist/posthog-rn.d.ts","title":"wrap","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"wrap","code":"// Generated example for wrap\nposthog.wrap();","name":"Generated example for wrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}}]}],"version":"4.7.0","categories":["Initialization","Identification","Capture","Feature flags","Group analytics","Privacy","Error tracking","LLM analytics"],"referenceId":"posthog-react-native"},"createdAt":"2025-10-25T22:45:02.237Z","updatedAt":"2025-10-25T22:45:02.237Z","publishedAt":"2025-10-25T22:45:02.234Z"}},{"id":25,"attributes":{"referenceId":"posthog-react-native","version":"4.10.5","data":{"id":"posthog-react-native-4.10.5","info":{"id":"posthog-react-native","title":"PostHog React Native SDK","specUrl":"https://github.com/PostHog/posthog-js","version":"4.10.5","slugPrefix":"posthog-react-native","description":"PostHog React Native SDK allows you to capture events and send them to PostHog from your React Native applications."},"types":[{"id":"ActionStepStringMatching","name":"ActionStepStringMatching","path":"../core/src/types.ts","properties":[{"name":"Contains","type":"\"contains\""},{"name":"Exact","type":"\"exact\""},{"name":"Regex","type":"\"regex\""}]},{"id":"ActionStepType","name":"ActionStepType","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}","properties":[]},{"id":"AutocaptureOptions","name":"AutocaptureOptions","path":"dist/error-tracking/index.d.ts","properties":[{"name":"console","type":"boolean | LogLevel[]"},{"name":"uncaughtExceptions","type":"boolean"},{"name":"unhandledRejections","type":"boolean"}]},{"id":"BasicSurveyQuestion","name":"BasicSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Open;\n}","properties":[]},{"id":"Compression","name":"Compression","path":"../core/src/types.ts","properties":[{"name":"Base64","type":"\"base64\""},{"name":"GZipJS","type":"\"gzip-js\""}]},{"id":"EndBranching","name":"EndBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.End;\n}","properties":[]},{"id":"ErrorTrackingOptions","name":"ErrorTrackingOptions","path":"dist/error-tracking/index.d.ts","properties":[{"name":"autocapture","type":"AutocaptureOptions | boolean"}]},{"id":"EvaluationReason","name":"EvaluationReason","path":"../core/src/types.ts","example":"{\n    code: string | undefined;\n    condition_index: number | undefined;\n    description: string | undefined;\n}","properties":[]},{"id":"FeatureFlagDetail","name":"FeatureFlagDetail","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}","properties":[]},{"id":"FeatureFlagMetadata","name":"FeatureFlagMetadata","path":"../core/src/types.ts","example":"{\n    id: number | undefined;\n    version: number | undefined;\n    description: string | undefined;\n    payload: string | undefined;\n}","properties":[]},{"id":"FeatureFlagValue","name":"FeatureFlagValue","path":"../core/src/types.ts","example":"string | boolean","properties":[]},{"id":"FeatureFlagWithPayload","name":"FeatureFlagWithPayload","path":"dist/hooks/useFeatureFlag.d.ts","example":"[FeatureFlagValue | undefined, JsonType | undefined]","properties":[]},{"id":"JsonType","name":"JsonType","path":"../core/src/types.ts","example":"string | number | boolean | null | {\n    [key: string]: JsonType;\n} | Array<JsonType> | JsonType[]","properties":[]},{"id":"LinkSurveyQuestion","name":"LinkSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Link;\n    link?: string;\n}","properties":[]},{"id":"Logger","name":"Logger","path":"../core/src/types.ts","example":"{\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}","properties":[]},{"id":"LogLevel","name":"LogLevel","path":"dist/error-tracking/index.d.ts","example":"\"debug\" | \"log\" | \"info\" | \"warn\" | \"error\"","properties":[]},{"id":"MultipleSurveyQuestion","name":"MultipleSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.SingleChoice | SurveyQuestionType.MultipleChoice;\n    choices: string[];\n    hasOpenChoice?: boolean;\n    shuffleOptions?: boolean;\n}","properties":[]},{"id":"NextQuestionBranching","name":"NextQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.NextQuestion;\n}","properties":[]},{"id":"PartialWithRequired","name":"PartialWithRequired","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}","properties":[]},{"id":"PostHogAutocaptureElement","name":"PostHogAutocaptureElement","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} & PostHogEventProperties","properties":[]},{"id":"PostHogAutocaptureNavigationTrackerOptions","name":"PostHogAutocaptureNavigationTrackerOptions","path":"dist/types.d.ts","example":"{\n    routeToName?: (name: string, params: any) => string;\n    routeToProperties?: (name: string, params: any) => Record<string, any>;\n}","properties":[]},{"id":"PostHogAutocaptureOptions","name":"PostHogAutocaptureOptions","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?: PostHogAutocaptureNavigationTrackerOptions;\n    navigationRef?: PostHogNavigationRef;\n}","properties":[]},{"id":"PostHogCaptureOptions","name":"PostHogCaptureOptions","path":"../core/src/types.ts","example":"{\n    uuid?: string;\n    timestamp?: Date;\n    disableGeoip?: boolean;\n}","properties":[]},{"id":"PostHogCoreOptions","name":"PostHogCoreOptions","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    evaluationEnvironments?: readonly string[];\n}","properties":[]},{"id":"PostHogCustomAppProperties","name":"PostHogCustomAppProperties","path":"dist/types.d.ts","properties":[{"name":"$app_build","type":"string | null","description":"Build number like \"1.2.2\" or \"122\""},{"name":"$app_name","type":"string | null","description":"Name of the app as displayed below the icon like \"PostHog\""},{"name":"$app_namespace","type":"string | null","description":"Namespace of the app usually like \"com.posthog.app\""},{"name":"$app_version","type":"string | null","description":"Human friendly app version like what a user would see in the app store like \"1.2.2\""},{"name":"$device_manufacturer","type":"string | null","description":"Manufacturer like \"Apple\", \"Samsung\" or \"Android\""},{"name":"$device_model","type":"string | null","description":"Model identifier like \"iPhone13,2\" or \"SM-S921B\""},{"name":"$device_name","type":"string | null","description":"Readable model name like \"iPhone 12\" or \"Samsung Galaxy S24\""},{"name":"$device_type","type":"string | null","description":"Device type (\"Mobile\" | \"Desktop\" | \"Web\")"},{"name":"$locale","type":"string | null","description":"Locale (language) of the device like \"en-US\""},{"name":"$os_name","type":"string | null","description":"Operating system name like iOS or Android"},{"name":"$os_version","type":"string | null","description":"Operating system version \"14.0\""},{"name":"$timezone","type":"string | null","description":"Timezone of the device like \"Europe/Berlin\""}]},{"id":"PostHogCustomStorage","name":"PostHogCustomStorage","path":"dist/types.d.ts","properties":[{"name":"getItem","type":"(key: string) => string | null | Promise<string | null>"},{"name":"setItem","type":"(key: string, value: string) => void | Promise<void>"}]},{"id":"PostHogEventProperties","name":"PostHogEventProperties","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: 'user@example.com',\n        name: 'John Doe'\n    }\n}","properties":[]},{"id":"PostHogFeatureFlagDetails","name":"PostHogFeatureFlagDetails","path":"../core/src/types.ts","example":"\"flags\" | \"featureFlags\" | \"featureFlagPayloads\" | \"requestId\"","properties":[]},{"id":"PostHogFetchOptions","name":"PostHogFetchOptions","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}","properties":[]},{"id":"PostHogFetchResponse","name":"PostHogFetchResponse","path":"../core/src/types.ts","example":"{\n    status: number;\n    text: () => Promise<string>;\n    json: () => Promise<any>;\n}","properties":[]},{"id":"PostHogFlagsResponse","name":"PostHogFlagsResponse","path":"../core/src/types.ts","example":"Omit<PostHogRemoteConfig, '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}","properties":[]},{"id":"PostHogGroupProperties","name":"PostHogGroupProperties","path":"../core/src/types.ts","example":"{\n    [type: string]: string | number;\n}","properties":[]},{"id":"PostHogNavigationRef","name":"PostHogNavigationRef","path":"dist/types.d.ts","example":"{\n    getCurrentRoute(): any | undefined;\n    isReady: () => boolean;\n    current?: PostHogNavigationRef | any | undefined;\n}","properties":[]},{"id":"PostHogOptions","name":"PostHogOptions","path":"dist/posthog-rn.d.ts","properties":[{"name":"captureAppLifecycleEvents","type":"boolean","description":"Captures app lifecycle events such as Application Installed, Application Updated, Application Opened, Application Became Active and Application Backgrounded. By default is false. Application Installed and Application Updated events are not supported with persistence set to 'memory'."},{"name":"customAppProperties","type":"PostHogCustomAppProperties | ((properties: PostHogCustomAppProperties) => PostHogCustomAppProperties)","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"},{"name":"customStorage","type":"PostHogCustomStorage","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, PostHog 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."},{"name":"enablePersistSessionIdAcrossRestart","type":"boolean","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. Defaults to false"},{"name":"enableSessionReplay","type":"boolean","description":"Enable Recording of Session Replays for Android and iOS Requires Record user sessions to be enabled in the PostHog Project Settings Defaults to false"},{"name":"errorTracking","type":"ErrorTrackingOptions","description":"Error Tracking Configuration"},{"name":"persistence","type":"'memory' | 'file'","description":"Allows you to provide the storage type. By default 'file'. 'file' will try to load the best available storage, the provided 'customStorage', 'customAsyncStorage' or in-memory storage."},{"name":"sessionReplayConfig","type":"PostHogSessionReplayConfig","description":"Configuration for Session Replay"}]},{"id":"PostHogPersistedProperty","name":"PostHogPersistedProperty","path":"../core/src/types.ts","properties":[{"name":"AnonymousId","type":"\"anonymous_id\""},{"name":"BootstrapFeatureFlagDetails","type":"\"bootstrap_feature_flag_details\""},{"name":"BootstrapFeatureFlagPayloads","type":"\"bootstrap_feature_flag_payloads\""},{"name":"BootstrapFeatureFlags","type":"\"bootstrap_feature_flags\""},{"name":"DistinctId","type":"\"distinct_id\""},{"name":"FeatureFlagDetails","type":"\"feature_flag_details\""},{"name":"FeatureFlagPayloads","type":"\"feature_flag_payloads\""},{"name":"FeatureFlags","type":"\"feature_flags\""},{"name":"FlagsEndpointWasHit","type":"\"flags_endpoint_was_hit\""},{"name":"GroupProperties","type":"\"group_properties\""},{"name":"InstalledAppBuild","type":"\"installed_app_build\""},{"name":"InstalledAppVersion","type":"\"installed_app_version\""},{"name":"OptedOut","type":"\"opted_out\""},{"name":"OverrideFeatureFlags","type":"\"override_feature_flags\""},{"name":"PersonProperties","type":"\"person_properties\""},{"name":"Props","type":"\"props\""},{"name":"Queue","type":"\"queue\""},{"name":"RemoteConfig","type":"\"remote_config\""},{"name":"SessionId","type":"\"session_id\""},{"name":"SessionLastTimestamp","type":"\"session_timestamp\""},{"name":"SessionReplay","type":"\"session_replay\""},{"name":"SessionStartTimestamp","type":"\"session_start_timestamp\""},{"name":"SurveyLastSeenDate","type":"\"survey_last_seen_date\""},{"name":"Surveys","type":"\"surveys\""},{"name":"SurveysSeen","type":"\"surveys_seen\""}]},{"id":"PostHogProviderProps","name":"PostHogProviderProps","path":"dist/PostHogProvider.d.ts","properties":[{"name":"apiKey","type":"string","description":"Your PostHog API key"},{"name":"autocapture","type":"boolean | PostHogAutocaptureOptions","description":"Autocapture configuration - can be a boolean or detailed options"},{"name":"children","type":"React.ReactNode","description":"The child components to render within the PostHog context"},{"name":"client","type":"PostHog","description":"An existing PostHog client instance"},{"name":"debug","type":"boolean","description":"Enable debug mode for additional logging"},{"name":"options","type":"PostHogOptions","description":"PostHog configuration options"},{"name":"style","type":"StyleProp<ViewStyle>","description":"Custom styles for the provider wrapper View"}]},{"id":"PostHogRemoteConfig","name":"PostHogRemoteConfig","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}","properties":[]},{"id":"PostHogSessionReplayConfig","name":"PostHogSessionReplayConfig","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}","properties":[]},{"id":"PostHogSurveyProviderProps","name":"PostHogSurveyProviderProps","path":"dist/surveys/PostHogSurveyProvider.d.ts","example":"{\n    defaultSurveyAppearance?: SurveyAppearance;\n    overrideAppearanceWithDefault?: boolean;\n    client?: PostHog;\n    children: React.ReactNode;\n}","properties":[]},{"id":"RatingSurveyQuestion","name":"RatingSurveyQuestion","path":"../core/src/types.ts","example":"SurveyQuestionBase & {\n    type: SurveyQuestionType.Rating;\n    display: SurveyRatingDisplay;\n    scale: 3 | 5 | 7 | 10;\n    lowerBoundLabel: string;\n    upperBoundLabel: string;\n}","properties":[]},{"id":"ResponseBasedBranching","name":"ResponseBasedBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.ResponseBased;\n    responseValues: Record<string, any>;\n}","properties":[]},{"id":"RetriableOptions","name":"RetriableOptions","path":"../core/src/utils/index.ts","properties":[{"name":"retryCheck","type":"(err: unknown) => boolean"},{"name":"retryCount","type":"number"},{"name":"retryDelay","type":"number"}]},{"id":"SpecificQuestionBranching","name":"SpecificQuestionBranching","path":"../core/src/types.ts","example":"{\n    type: SurveyQuestionBranchingType.SpecificQuestion;\n    index: number;\n}","properties":[]},{"id":"Survey","name":"Survey","path":"../core/src/types.ts","example":"{\n    id: string;\n    name: string;\n    description?: string;\n    type: SurveyType;\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}","properties":[]},{"id":"SurveyActionType","name":"SurveyActionType","path":"../core/src/types.ts","example":"{\n    id: number;\n    name?: string;\n    steps?: ActionStepType[];\n}","properties":[]},{"id":"SurveyAppearance","name":"SurveyAppearance","path":"../core/src/types.ts","example":"{\n    backgroundColor?: string;\n    submitButtonColor?: string;\n    submitButtonText?: string;\n    submitButtonTextColor?: string;\n    ratingButtonColor?: string;\n    ratingButtonActiveColor?: 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}","properties":[]},{"id":"SurveyAppearanceTheme","name":"SurveyAppearanceTheme","path":"dist/surveys/surveys-utils.d.ts","example":"\"widgetSelector\" | \"widgetType\" | \"widgetColor\" | \"widgetLabel\" | \"shuffleQuestions\"","properties":[]},{"id":"SurveyMatchType","name":"SurveyMatchType","path":"../core/src/types.ts","properties":[{"name":"Exact","type":"\"exact\""},{"name":"Icontains","type":"\"icontains\""},{"name":"IsNot","type":"\"is_not\""},{"name":"NotIcontains","type":"\"not_icontains\""},{"name":"NotRegex","type":"\"not_regex\""},{"name":"Regex","type":"\"regex\""}]},{"id":"SurveyModalProps","name":"SurveyModalProps","path":"dist/surveys/components/SurveyModal.d.ts","example":"{\n    survey: Survey;\n    appearance: SurveyAppearanceTheme;\n    onShow: () => void;\n    onClose: (submitted: boolean) => void;\n}","properties":[]},{"id":"SurveyPosition","name":"SurveyPosition","path":"../core/src/types.ts","properties":[{"name":"Center","type":"\"center\""},{"name":"Left","type":"\"left\""},{"name":"MiddleCenter","type":"\"middle_center\""},{"name":"MiddleLeft","type":"\"middle_left\""},{"name":"MiddleRight","type":"\"middle_right\""},{"name":"Right","type":"\"right\""},{"name":"TopCenter","type":"\"top_center\""},{"name":"TopLeft","type":"\"top_left\""},{"name":"TopRight","type":"\"top_right\""}]},{"id":"SurveyQuestion","name":"SurveyQuestion","path":"../core/src/types.ts","example":"BasicSurveyQuestion | LinkSurveyQuestion | RatingSurveyQuestion | MultipleSurveyQuestion","properties":[]},{"id":"SurveyQuestionBase","name":"SurveyQuestionBase","path":"../core/src/types.ts","example":"{\n    question: string;\n    id: string;\n    description?: string;\n    descriptionContentType?: SurveyQuestionDescriptionContentType;\n    optional?: boolean;\n    buttonText?: string;\n    originalQuestionIndex: number;\n    branching?: NextQuestionBranching | EndBranching | ResponseBasedBranching | SpecificQuestionBranching;\n}","properties":[]},{"id":"SurveyQuestionBranchingType","name":"SurveyQuestionBranchingType","path":"../core/src/types.ts","properties":[{"name":"End","type":"\"end\""},{"name":"NextQuestion","type":"\"next_question\""},{"name":"ResponseBased","type":"\"response_based\""},{"name":"SpecificQuestion","type":"\"specific_question\""}]},{"id":"SurveyQuestionDescriptionContentType","name":"SurveyQuestionDescriptionContentType","path":"../core/src/types.ts","properties":[{"name":"Html","type":"\"html\""},{"name":"Text","type":"\"text\""}]},{"id":"SurveyQuestionType","name":"SurveyQuestionType","path":"../core/src/types.ts","properties":[{"name":"Link","type":"\"link\""},{"name":"MultipleChoice","type":"\"multiple_choice\""},{"name":"Open","type":"\"open\""},{"name":"Rating","type":"\"rating\""},{"name":"SingleChoice","type":"\"single_choice\""}]},{"id":"SurveyRatingDisplay","name":"SurveyRatingDisplay","path":"../core/src/types.ts","properties":[{"name":"Emoji","type":"\"emoji\""},{"name":"Number","type":"\"number\""}]},{"id":"SurveyResponse","name":"SurveyResponse","path":"../core/src/types.ts","example":"{\n    surveys: Survey[];\n}","properties":[]},{"id":"SurveyType","name":"SurveyType","path":"../core/src/types.ts","properties":[{"name":"API","type":"\"api\""},{"name":"ExternalSurvey","type":"\"external_survey\""},{"name":"Popover","type":"\"popover\""},{"name":"Widget","type":"\"widget\""}]},{"id":"SurveyWidgetType","name":"SurveyWidgetType","path":"../core/src/types.ts","properties":[{"name":"Button","type":"\"button\""},{"name":"Selector","type":"\"selector\""},{"name":"Tab","type":"\"tab\""}]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"PostHogProvider","title":"PostHogProvider","params":[{"name":"{ children, client, options, apiKey, autocapture, style, debug, }","type":"PostHogProviderProps","isOptional":false,"description":""}],"details":null,"category":"Initialization","examples":[{"id":"add_to_app.(js|ts)","code":"\n\n// Add to App.(js|ts)\nimport { usePostHog, PostHogProvider } from 'posthog-react-native'\n\nexport function MyApp() {\n    return (\n        <PostHogProvider apiKey=\"<ph_project_api_key>\" options={{\n            host: '<ph_client_api_host>',\n        }}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n// And access the PostHog client via the usePostHog hook\nimport { usePostHog } from 'posthog-react-native'\n\nconst MyComponent = () => {\n    const posthog = usePostHog()\n\n    useEffect(() => {\n        posthog.capture(\"event_name\")\n    }, [posthog])\n}\n\n\n\n","name":"Add to App.(js|ts)"},{"id":"using_with_existing_client","code":"\n\n// Using with existing client\nimport { PostHog } from 'posthog-react-native'\n\nconst posthog = new PostHog('<ph_project_api_key>', {\n    host: '<ph_client_api_host>'\n})\n\nexport function MyApp() {\n    return (\n        <PostHogProvider client={posthog}>\n            <MyComponent />\n        </PostHogProvider>\n    )\n}\n\n\n\n","name":"Using with existing client"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JSX.Element | null","name":"JSX.Element | null"},"description":"PostHogProvider is a React component that provides PostHog functionality to your React Native app. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nAutocapturing navigation requires further configuration. See the [React Native SDK navigation docs](https://posthog.com/docs/libraries/react-native#capturing-screen-views) for more information about autocapturing navigation.\nThis is the recommended way to set up PostHog for React Native. This utilizes the Context API to pass the PostHog client around, enable autocapture."},{"id":"PostHog","path":"dist/posthog-rn.d.ts","title":"PostHog","params":[{"name":"apiKey","type":"string","isOptional":false,"description":"Your PostHog API key"},{"name":"options","type":"PostHogOptions","isOptional":true,"description":"PostHog configuration options"}],"details":null,"category":"Initialization","examples":[{"id":"posthog.ts","code":"\n\n// posthog.ts\nimport PostHog from 'posthog-react-native'\n\nexport const posthog = new PostHog('<ph_project_api_key>', {\n  host: '<ph_client_api_host>'\n})\n\n// Then you can access PostHog by importing your instance\n// Another file:\nimport { posthog } from './posthog'\n\nexport function MyApp1() {\n    useEffect(async () => {\n        posthog.capture('event_name')\n    }, [posthog])\n\n    return <View>Your app code</View>\n}\n\n\n\n","name":"posthog.ts"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"any","name":"any"},"description":"Creates a new PostHog instance for React Native. You can find all configuration options in the [React Native SDK docs](https://posthog.com/docs/libraries/react-native#configuration-options).\nIf you prefer not to use the PostHogProvider, you can initialize PostHog in its own file and import the instance from there."},{"id":"alias","path":"dist/posthog-rn.d.ts","title":"alias","params":[{"name":"alias","type":"string","isOptional":false,"description":"The alias to assign to the current user"}],"details":null,"category":"Identification","examples":[{"id":"set_alias_for_current_user","code":"\n\n// set alias for current user\nposthog.alias('distinct_id')\n\n\n\n","name":"set alias for current user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"captureException","path":"dist/posthog-rn.d.ts","title":"captureException","params":[{"name":"error","type":"Error | unknown","isOptional":false,"description":"The error to capture"},{"name":"additionalProperties","type":"PostHogEventProperties","isOptional":true,"description":"Any additional properties to add to the error event"}],"details":null,"category":"Error tracking","examples":[{"id":"capture_a_caught_exception","code":"\n\n// Capture a caught exception\ntry {\n  // something that might throw\n} catch (error) {\n  posthog.captureException(error)\n}\n\n\n","name":"Capture a caught exception"},{"id":"with_additional_properties","code":"\n\n// With additional properties\nposthog.captureException(error, {\n  customProperty: 'value',\n  anotherProperty: ['I', 'can be a list'],\n  ...\n})\n\n\n\n","name":"With additional properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a caught exception manually"},{"id":"fetch","path":"dist/posthog-rn.d.ts","title":"fetch","params":[{"name":"url","type":"string","isOptional":false,"description":""},{"name":"options","type":"PostHogFetchOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"fetch","code":"// Generated example for fetch\nposthog.fetch();","name":"Generated example for fetch"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFetchResponse>","name":"Promise<PostHogFetchResponse>"}},{"id":"flush","path":"dist/posthog-rn.d.ts","title":"flush","params":[],"details":null,"category":"Capture","examples":[{"id":"manually_flush_the_queue","code":"\n\n// manually flush the queue\nawait posthog.flush()\n\n\n\n","name":"manually flush the queue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"getCommonEventProperties","path":"dist/posthog-rn.d.ts","title":"getCommonEventProperties","params":[],"details":null,"category":"","examples":[{"id":"getcommoneventproperties","code":"// Generated example for getCommonEventProperties\nposthog.getCommonEventProperties();","name":"Generated example for getCommonEventProperties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogEventProperties","name":"PostHogEventProperties"}},{"id":"getCustomUserAgent","path":"dist/posthog-rn.d.ts","title":"getCustomUserAgent","params":[],"details":null,"category":"","examples":[{"id":"getcustomuseragent","code":"// Generated example for getCustomUserAgent\nposthog.getCustomUserAgent();","name":"Generated example for getCustomUserAgent"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getDistinctId","path":"dist/posthog-rn.d.ts","title":"getDistinctId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_current_distinct_id","code":"\n\n// get current distinct ID\nconst distinctId = posthog.getDistinctId()\n\n\n\n","name":"get current distinct ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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 PostHog or the ID that has been passed by a call to identify()."},{"id":"getFeatureFlag","path":"dist/posthog-rn.d.ts","title":"getFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_value","code":"\n\n// get feature flag value\nconst value = posthog.getFeatureFlag('key-for-your-boolean-flag')\n\n\n\n","name":"get feature flag value"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | string | undefined","name":"boolean | string | undefined"},"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."},{"id":"getFeatureFlagPayload","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayload","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"get_feature_flag_payload","code":"\n\n// get feature flag payload\nconst payload = posthog.getFeatureFlagPayload('key-for-your-multivariate-flag')\n\n\n\n","name":"get feature flag payload"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"JsonType | undefined","name":"JsonType | undefined"},"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."},{"id":"getLibraryId","path":"dist/posthog-rn.d.ts","title":"getLibraryId","params":[],"details":null,"category":"","examples":[{"id":"getlibraryid","code":"// Generated example for getLibraryId\nposthog.getLibraryId();","name":"Generated example for getLibraryId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getLibraryVersion","path":"dist/posthog-rn.d.ts","title":"getLibraryVersion","params":[],"details":null,"category":"","examples":[{"id":"getlibraryversion","code":"// Generated example for getLibraryVersion\nposthog.getLibraryVersion();","name":"Generated example for getLibraryVersion"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getPersistedProperty","path":"dist/posthog-rn.d.ts","title":"getPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"getpersistedproperty","code":"// Generated example for getPersistedProperty\nposthog.getPersistedProperty();","name":"Generated example for getPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"T | undefined","name":"T | undefined"}},{"id":"getSessionId","path":"dist/posthog-rn.d.ts","title":"getSessionId","params":[],"details":null,"category":"","examples":[{"id":"getsessionid","code":"// Generated example for getSessionId\nposthog.getSessionId();","name":"Generated example for getSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"}},{"id":"getSurveys","path":"dist/posthog-rn.d.ts","title":"getSurveys","params":[],"details":null,"category":"","examples":[{"id":"getsurveys","code":"// Generated example for getSurveys\nposthog.getSurveys();","name":"Generated example for getSurveys"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"}},{"id":"group","path":"dist/posthog-rn.d.ts","title":"group","params":[{"name":"groupType","type":"string","isOptional":false,"description":"The type of group (e.g. 'company', 'team')"},{"name":"groupKey","type":"string","isOptional":false,"description":"The unique identifier for the group"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to set for the group"}],"details":null,"category":"Group analytics","examples":[{"id":"associate_with_a_group","code":"\n\n// associate with a group\nposthog.group('company', 'company_id_in_your_db')\n\n\n","name":"associate with a group"},{"id":"associate_with_a_group_and_update_properties","code":"\n\n// associate with a group and update properties\nposthog.group('company', 'company_id_in_your_db', {\n  name: 'Awesome Inc.',\n  employees: 11,\n})\n\n\n\n","name":"associate with a group and update properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"identify","path":"dist/posthog-rn.d.ts","title":"identify","params":[{"name":"distinctId","type":"string","isOptional":true,"description":"A unique identifier for your user. Typically either their email or database ID."},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional dictionary with key:value pairs to set the person properties"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"details":null,"category":"Identification","examples":[{"id":"basic_identify","code":"\n\n// Basic identify\nposthog.identify('distinctID', {\n  email: 'user@posthog.com',\n  name: 'My Name'\n})\n\n\n","name":"Basic identify"},{"id":"using_$set_and_$set_once","code":"\n\n// Using $set and $set_once\nposthog.identify('distinctID', {\n  $set: {\n    email: 'user@posthog.com',\n    name: 'My Name'\n  },\n  $set_once: {\n    date_of_first_log_in: '2024-03-01'\n  }\n})\n\n\n\n","name":"Using $set and $set_once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Associates events with a specific user. Learn more about [identifying users](https://posthog.com/docs/product-analytics/identify)"},{"id":"initReactNativeNavigation","path":"dist/posthog-rn.d.ts","title":"initReactNativeNavigation","params":[{"name":"options","type":"PostHogAutocaptureOptions","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"initreactnativenavigation","code":"// Generated example for initReactNativeNavigation\nposthog.initReactNativeNavigation();","name":"Generated example for initReactNativeNavigation"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean","name":"boolean"}},{"id":"isFeatureEnabled","path":"dist/posthog-rn.d.ts","title":"isFeatureEnabled","params":[{"name":"key","type":"string","isOptional":false,"description":"The feature flag key"}],"details":null,"category":"Feature flags","examples":[{"id":"check_if_feature_flag_is_enabled","code":"\n\n// check if feature flag is enabled\nconst isEnabled = posthog.isFeatureEnabled('key-for-your-boolean-flag')\n\n\n\n","name":"check if feature flag is enabled"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"boolean | undefined","name":"boolean | undefined"},"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."},{"id":"optIn","path":"dist/posthog-rn.d.ts","title":"optIn","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_in_to_tracking","code":"\n\n// opt in to tracking\nposthog.optIn()\n\n\n\n","name":"opt in to tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Opts the user in to data capture.\nBy default, PostHog 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."},{"id":"optOut","path":"dist/posthog-rn.d.ts","title":"optOut","params":[],"details":null,"category":"Privacy","examples":[{"id":"opt_out_of_tracking","code":"\n\n// opt out of tracking\nposthog.optOut()\n\n\n\n","name":"opt out of tracking"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"register","path":"dist/posthog-rn.d.ts","title":"register","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":"An associative array of properties to store about the user"}],"details":null,"category":"Capture","examples":[{"id":"register_super_properties","code":"\n\n// register super properties\nposthog.register({\n    'icecream pref': 'vanilla',\n    team_id: 22,\n})\n\n\n\n","name":"register super properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"reloadFeatureFlags","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags","code":"\n\n// reload feature flags\nposthog.reloadFeatureFlags()\n\n\n\n","name":"reload feature flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Reloads feature flags from the server.\nPostHog 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."},{"id":"reloadFeatureFlagsAsync","path":"dist/posthog-rn.d.ts","title":"reloadFeatureFlagsAsync","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reload_feature_flags_and_get_result","code":"\n\n// reload feature flags and get result\nposthog.reloadFeatureFlagsAsync().then((refreshedFlags) => console.log(refreshedFlags))\n\n\n\n","name":"reload feature flags and get result"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<Record<string, boolean | string> | undefined>","name":"Promise<Record<string, boolean | string> | undefined>"},"description":"Reloads feature flags from the server asynchronously.\nPostHog 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."},{"id":"reset","path":"dist/posthog-rn.d.ts","title":"reset","params":[],"details":null,"category":"Identification","examples":[{"id":"reset_after_logout","code":"\n\n// reset after logout\nposthog.reset()\n\n\n\n","name":"reset after logout"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"resetGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetGroupPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_group_properties_for_flags","code":"\n\n// reset group properties for flags\nposthog.resetGroupPropertiesForFlags()\n\n\n\n","name":"reset group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets group properties for feature flag evaluation."},{"id":"resetPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"resetPersonPropertiesForFlags","params":[],"details":null,"category":"Feature flags","examples":[{"id":"reset_person_properties_for_flags","code":"\n\n// reset person properties for flags\nposthog.resetPersonPropertiesForFlags()\n\n\n\n","name":"reset person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Resets person properties for feature flag evaluation."},{"id":"resetSessionId","path":"dist/posthog-rn.d.ts","title":"resetSessionId","params":[],"details":null,"category":"","examples":[{"id":"resetsessionid","code":"// Generated example for resetSessionId\nposthog.resetSessionId();","name":"Generated example for resetSessionId"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"screen","path":"dist/posthog-rn.d.ts","title":"screen","params":[{"name":"name","type":"string","isOptional":false,"description":"The name of the screen"},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":"Optional properties to include with the screen event"},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":"Optional capture options"}],"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.","category":"Capture","examples":[{"id":"basic_screen_capture","code":"\n\n// Basic screen capture\nposthog.screen('dashboard')\n\n\n","name":"Basic screen capture"},{"id":"screen_capture_with_properties","code":"\n\n// Screen capture with properties\nposthog.screen('dashboard', {\n    background: 'blue',\n    hero: 'superhog',\n})\n\n\n\n","name":"Screen capture with properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Captures a screen view event."},{"id":"setGroupPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setGroupPropertiesForFlags","params":[{"name":"properties","type":"Record<string, Record<string, string>>","isOptional":false,"description":"The group properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_group_properties_for_flags","code":"\n\n// set group properties for flags\nposthog.setGroupPropertiesForFlags({'company': {'property1': 'value', property2: 'value2'}})\n\n\n\n","name":"set group properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Sets group properties for feature flag evaluation.\nThese properties are automatically attached to the current group (set via posthog.group()). When you change the group, these properties are reset."},{"id":"setPersistedProperty","path":"dist/posthog-rn.d.ts","title":"setPersistedProperty","params":[{"name":"key","type":"PostHogPersistedProperty","isOptional":false,"description":""},{"name":"value","type":"T | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"setpersistedproperty","code":"// Generated example for setPersistedProperty\nposthog.setPersistedProperty();","name":"Generated example for setPersistedProperty"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"setPersonPropertiesForFlags","path":"dist/posthog-rn.d.ts","title":"setPersonPropertiesForFlags","params":[{"name":"properties","type":"Record<string, string>","isOptional":false,"description":"The person properties to set for flag evaluation"}],"details":null,"category":"Feature flags","examples":[{"id":"set_person_properties_for_flags","code":"\n\n// set person properties for flags\nposthog.setPersonPropertiesForFlags({'property1': 'value', property2: 'value2'})\n\n\n\n","name":"set person properties for flags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"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."},{"id":"unregister","path":"dist/posthog-rn.d.ts","title":"unregister","params":[{"name":"property","type":"string","isOptional":false,"description":"The name of the super property to remove"}],"details":null,"category":"Capture","examples":[{"id":"remove_a_super_property","code":"\n\n// remove a super property\nposthog.unregister('icecream pref')\n\n\n\n","name":"remove a super property"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"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."},{"id":"autocapture","path":"dist/posthog-rn.d.ts","title":"autocapture","params":[{"name":"eventType","type":"string","isOptional":false,"description":""},{"name":"elements","type":"PostHogAutocaptureElement[]","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"autocapture","code":"// Generated example for autocapture\nposthog.autocapture();","name":"Generated example for autocapture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"capture","path":"dist/posthog-rn.d.ts","title":"capture","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capture","code":"// Generated example for capture\nposthog.capture();","name":"Generated example for capture"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureTraceFeedback","path":"dist/posthog-rn.d.ts","title":"captureTraceFeedback","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture feedback for."},{"name":"userFeedback","type":"string","isOptional":false,"description":"The feedback to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracefeedback","code":"// Generated example for captureTraceFeedback\nposthog.captureTraceFeedback();","name":"Generated example for captureTraceFeedback"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture written user feedback for a LLM trace. Numeric values are converted to strings."},{"id":"captureTraceMetric","path":"dist/posthog-rn.d.ts","title":"captureTraceMetric","params":[{"name":"traceId","type":"string | number","isOptional":false,"description":"The trace ID to capture the metric for."},{"name":"metricName","type":"string","isOptional":false,"description":"The name of the metric to capture."},{"name":"metricValue","type":"string | number | boolean","isOptional":false,"description":"The value of the metric to capture."}],"details":null,"category":"LLM analytics","examples":[{"id":"capturetracemetric","code":"// Generated example for captureTraceMetric\nposthog.captureTraceMetric();","name":"Generated example for captureTraceMetric"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Capture a metric for a LLM trace. Numeric values are converted to strings."},{"id":"flagsAsync","path":"dist/posthog-rn.d.ts","title":"flagsAsync","params":[{"name":"sendAnonDistinctId","type":"boolean","isOptional":true,"description":""},{"name":"fetchConfig","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"flagsasync","code":"// Generated example for flagsAsync\nposthog.flagsAsync();","name":"Generated example for flagsAsync"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse | undefined>","name":"Promise<PostHogFlagsResponse | undefined>"},"description":"* ** FEATURE FLAGS *"},{"id":"getAnonymousId","path":"dist/posthog-rn.d.ts","title":"getAnonymousId","params":[],"details":null,"category":"Identification","examples":[{"id":"get_the_anonymous_id","code":"\n\n// get the anonymous ID\nconst anonId = posthog.getAnonymousId()\nconsole.log('Anonymous ID:', anonId)\n\n\n\n","name":"get the anonymous ID"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"string","name":"string"},"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."},{"id":"getFeatureFlagDetails","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetails","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagdetails","code":"// Generated example for getFeatureFlagDetails\nposthog.getFeatureFlagDetails();","name":"Generated example for getFeatureFlagDetails"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFeatureFlagDetails | undefined","name":"PostHogFeatureFlagDetails | undefined"}},{"id":"getFeatureFlagPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloads","code":"// Generated example for getFeatureFlagPayloads\nposthog.getFeatureFlagPayloads();","name":"Generated example for getFeatureFlagPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlagPayloads'] | undefined","name":"PostHogFlagsResponse['featureFlagPayloads'] | undefined"}},{"id":"getFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflags","code":"// Generated example for getFeatureFlags\nposthog.getFeatureFlags();","name":"Generated example for getFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"getFeatureFlagsAndPayloads","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloads","params":[],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloads","code":"// Generated example for getFeatureFlagsAndPayloads\nposthog.getFeatureFlagsAndPayloads();","name":"Generated example for getFeatureFlagsAndPayloads"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }","name":"{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n    }"}},{"id":"getKnownFeatureFlags","path":"dist/posthog-rn.d.ts","title":"getKnownFeatureFlags","params":[],"details":null,"category":"","examples":[{"id":"getknownfeatureflags","code":"// Generated example for getKnownFeatureFlags\nposthog.getKnownFeatureFlags();","name":"Generated example for getKnownFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"PostHogFlagsResponse['featureFlags'] | undefined","name":"PostHogFlagsResponse['featureFlags'] | undefined"}},{"id":"groupIdentify","path":"dist/posthog-rn.d.ts","title":"groupIdentify","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentify","code":"// Generated example for groupIdentify\nposthog.groupIdentify();","name":"Generated example for groupIdentify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"groups","path":"dist/posthog-rn.d.ts","title":"groups","params":[{"name":"groups","type":"PostHogGroupProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"groups","code":"// Generated example for groups\nposthog.groups();","name":"Generated example for groups"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"on","path":"dist/posthog-rn.d.ts","title":"on","params":[{"name":"event","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(...args: any[]) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"on","code":"// Generated example for on\nposthog.on();","name":"Generated example for on"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlag","path":"dist/posthog-rn.d.ts","title":"onFeatureFlag","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"cb","type":"(value: FeatureFlagValue) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflag","code":"// Generated example for onFeatureFlag\nposthog.onFeatureFlag();","name":"Generated example for onFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"onFeatureFlags","path":"dist/posthog-rn.d.ts","title":"onFeatureFlags","params":[{"name":"cb","type":"(flags: PostHogFlagsResponse['featureFlags']) => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"onfeatureflags","code":"// Generated example for onFeatureFlags\nposthog.onFeatureFlags();","name":"Generated example for onFeatureFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"() => void","name":"() => void"}},{"id":"overrideFeatureFlag","path":"dist/posthog-rn.d.ts","title":"overrideFeatureFlag","params":[{"name":"flags","type":"PostHogFlagsResponse['featureFlags'] | null","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"overridefeatureflag","code":"// Generated example for overrideFeatureFlag\nposthog.overrideFeatureFlag();","name":"Generated example for overrideFeatureFlag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"registerForSession","path":"dist/posthog-rn.d.ts","title":"registerForSession","params":[{"name":"properties","type":"PostHogEventProperties","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"registerforsession","code":"// Generated example for registerForSession\nposthog.registerForSession();","name":"Generated example for registerForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"reloadRemoteConfigAsync","path":"dist/posthog-rn.d.ts","title":"reloadRemoteConfigAsync","params":[],"details":null,"category":"","examples":[{"id":"reloadremoteconfigasync","code":"// Generated example for reloadRemoteConfigAsync\nposthog.reloadRemoteConfigAsync();","name":"Generated example for reloadRemoteConfigAsync"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"setupBootstrap","path":"dist/posthog-rn.d.ts","title":"setupBootstrap","params":[{"name":"options","type":"Partial<PostHogCoreOptions>","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"setupbootstrap","code":"// Generated example for setupBootstrap\nposthog.setupBootstrap();","name":"Generated example for setupBootstrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"unregisterForSession","path":"dist/posthog-rn.d.ts","title":"unregisterForSession","params":[{"name":"property","type":"string","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"unregisterforsession","code":"// Generated example for unregisterForSession\nposthog.unregisterForSession();","name":"Generated example for unregisterForSession"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"addPendingPromise","path":"dist/posthog-rn.d.ts","title":"addPendingPromise","params":[{"name":"promise","type":"Promise<T>","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"addpendingpromise","code":"// Generated example for addPendingPromise\nposthog.addPendingPromise();","name":"Generated example for addPendingPromise"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<T>","name":"Promise<T>"}},{"id":"aliasStateless","path":"dist/posthog-rn.d.ts","title":"aliasStateless","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstateless","code":"// Generated example for aliasStateless\nposthog.aliasStateless();","name":"Generated example for aliasStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"aliasStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"aliasStatelessImmediate","params":[{"name":"alias","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"aliasstatelessimmediate","code":"// Generated example for aliasStatelessImmediate\nposthog.aliasStatelessImmediate();","name":"Generated example for aliasStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"captureStateless","path":"dist/posthog-rn.d.ts","title":"captureStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestateless","code":"// Generated example for captureStateless\nposthog.captureStateless();","name":"Generated example for captureStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"captureStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"captureStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"event","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"capturestatelessimmediate","code":"// Generated example for captureStatelessImmediate\nposthog.captureStatelessImmediate();","name":"Generated example for captureStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"debug","path":"dist/posthog-rn.d.ts","title":"debug","params":[{"name":"enabled","type":"boolean","isOptional":true,"description":""}],"details":"Debug mode logs all PostHog calls to the console for troubleshooting. This is useful during development to understand what data is being sent.","category":"Initialization","examples":[{"id":"enable_debug_mode","code":"\n\n// enable debug mode\nposthog.debug(true)\n\n\n","name":"enable debug mode"},{"id":"disable_debug_mode","code":"\n\n// disable debug mode\nposthog.debug(false)\n\n\n\n","name":"disable debug mode"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"Enables or disables debug mode for detailed logging."},{"id":"enqueue","path":"dist/posthog-rn.d.ts","title":"enqueue","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"enqueue","code":"// Generated example for enqueue\nposthog.enqueue();","name":"Generated example for enqueue"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** QUEUEING AND FLUSHING *"},{"id":"getCustomHeaders","path":"dist/posthog-rn.d.ts","title":"getCustomHeaders","params":[],"details":null,"category":"","examples":[{"id":"getcustomheaders","code":"// Generated example for getCustomHeaders\nposthog.getCustomHeaders();","name":"Generated example for getCustomHeaders"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"{\n        [key: string]: string;\n    }","name":"{\n        [key: string]: string;\n    }"}},{"id":"getFeatureFlagDetailsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailsstateless","code":"// Generated example for getFeatureFlagDetailsStateless\nposthog.getFeatureFlagDetailsStateless();","name":"Generated example for getFeatureFlagDetailsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFeatureFlagDetails | undefined>","name":"Promise<PostHogFeatureFlagDetails | undefined>"}},{"id":"getFeatureFlagDetailStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagDetailStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagdetailstateless","code":"// Generated example for getFeatureFlagDetailStateless\nposthog.getFeatureFlagDetailStateless();","name":"Generated example for getFeatureFlagDetailStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>","name":"Promise<{\n        response: FeatureFlagDetail | undefined;\n        requestId: string | undefined;\n    } | undefined>"}},{"id":"getFeatureFlagPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadsstateless","code":"// Generated example for getFeatureFlagPayloadsStateless\nposthog.getFeatureFlagPayloadsStateless();","name":"Generated example for getFeatureFlagPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>","name":"Promise<PostHogFlagsResponse['featureFlagPayloads'] | undefined>"}},{"id":"getFeatureFlagPayloadStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagPayloadStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagpayloadstateless","code":"// Generated example for getFeatureFlagPayloadStateless\nposthog.getFeatureFlagPayloadStateless();","name":"Generated example for getFeatureFlagPayloadStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<JsonType | undefined>","name":"Promise<JsonType | undefined>"}},{"id":"getFeatureFlagsAndPayloadsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsAndPayloadsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsandpayloadsstateless","code":"// Generated example for getFeatureFlagsAndPayloadsStateless\nposthog.getFeatureFlagsAndPayloadsStateless();","name":"Generated example for getFeatureFlagsAndPayloadsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagsStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagsStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""},{"name":"flagKeysToEvaluate","type":"string[]","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagsstateless","code":"// Generated example for getFeatureFlagsStateless\nposthog.getFeatureFlagsStateless();","name":"Generated example for getFeatureFlagsStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>","name":"Promise<{\n        flags: PostHogFlagsResponse['featureFlags'] | undefined;\n        payloads: PostHogFlagsResponse['featureFlagPayloads'] | undefined;\n        requestId: PostHogFlagsResponse['requestId'] | undefined;\n    }>"}},{"id":"getFeatureFlagStateless","path":"dist/posthog-rn.d.ts","title":"getFeatureFlagStateless","params":[{"name":"key","type":"string","isOptional":false,"description":""},{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"disableGeoip","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getfeatureflagstateless","code":"// Generated example for getFeatureFlagStateless\nposthog.getFeatureFlagStateless();","name":"Generated example for getFeatureFlagStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>","name":"Promise<{\n        response: FeatureFlagValue | undefined;\n        requestId: string | undefined;\n    }>"}},{"id":"getFlags","path":"dist/posthog-rn.d.ts","title":"getFlags","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"groups","type":"Record<string, string | number>","isOptional":true,"description":""},{"name":"personProperties","type":"Record<string, string>","isOptional":true,"description":""},{"name":"groupProperties","type":"Record<string, Record<string, string>>","isOptional":true,"description":""},{"name":"extraPayload","type":"Record<string, any>","isOptional":true,"description":""},{"name":"fetchConfig","type":"boolean","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"getflags","code":"// Generated example for getFlags\nposthog.getFlags();","name":"Generated example for getFlags"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogFlagsResponse | undefined>","name":"Promise<PostHogFlagsResponse | undefined>"},"description":"* ** FEATURE FLAGS *"},{"id":"getRemoteConfig","path":"dist/posthog-rn.d.ts","title":"getRemoteConfig","params":[],"details":null,"category":"","examples":[{"id":"getremoteconfig","code":"// Generated example for getRemoteConfig\nposthog.getRemoteConfig();","name":"Generated example for getRemoteConfig"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<PostHogRemoteConfig | undefined>","name":"Promise<PostHogRemoteConfig | undefined>"}},{"id":"getSurveysStateless","path":"dist/posthog-rn.d.ts","title":"getSurveysStateless","params":[],"details":null,"category":"","examples":[{"id":"getsurveysstateless","code":"// Generated example for getSurveysStateless\nposthog.getSurveysStateless();","name":"Generated example for getSurveysStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<SurveyResponse['surveys']>","name":"Promise<SurveyResponse['surveys']>"},"description":"* ** SURVEYS *"},{"id":"groupIdentifyStateless","path":"dist/posthog-rn.d.ts","title":"groupIdentifyStateless","params":[{"name":"groupType","type":"string","isOptional":false,"description":""},{"name":"groupKey","type":"string | number","isOptional":false,"description":""},{"name":"groupProperties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""},{"name":"distinctId","type":"string","isOptional":true,"description":""},{"name":"eventProperties","type":"PostHogEventProperties","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"groupidentifystateless","code":"// Generated example for groupIdentifyStateless\nposthog.groupIdentifyStateless();","name":"Generated example for groupIdentifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** GROUPS *"},{"id":"identifyStateless","path":"dist/posthog-rn.d.ts","title":"identifyStateless","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystateless","code":"// Generated example for identifyStateless\nposthog.identifyStateless();","name":"Generated example for identifyStateless"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"},"description":"* ** TRACKING *"},{"id":"identifyStatelessImmediate","path":"dist/posthog-rn.d.ts","title":"identifyStatelessImmediate","params":[{"name":"distinctId","type":"string","isOptional":false,"description":""},{"name":"properties","type":"PostHogEventProperties","isOptional":true,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"identifystatelessimmediate","code":"// Generated example for identifyStatelessImmediate\nposthog.identifyStatelessImmediate();","name":"Generated example for identifyStatelessImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"logMsgIfDebug","path":"dist/posthog-rn.d.ts","title":"logMsgIfDebug","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"logmsgifdebug","code":"// Generated example for logMsgIfDebug\nposthog.logMsgIfDebug();","name":"Generated example for logMsgIfDebug"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}},{"id":"sendImmediate","path":"dist/posthog-rn.d.ts","title":"sendImmediate","params":[{"name":"type","type":"string","isOptional":false,"description":""},{"name":"_message","type":"any","isOptional":false,"description":""},{"name":"options","type":"PostHogCaptureOptions","isOptional":true,"description":""}],"details":null,"category":"","examples":[{"id":"sendimmediate","code":"// Generated example for sendImmediate\nposthog.sendImmediate();","name":"Generated example for sendImmediate"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"}},{"id":"shutdown","path":"dist/posthog-rn.d.ts","title":"shutdown","params":[{"name":"shutdownTimeoutMs","type":"number","isOptional":true,"description":"Maximum time to wait for shutdown in milliseconds"}],"details":null,"category":"Initialization","examples":[{"id":"shutdown_before_process_exit","code":"\n\n// shutdown before process exit\nprocess.on('SIGINT', async () => {\n  await posthog.shutdown()\n  process.exit(0)\n})\n\n\n\n","name":"shutdown before process exit"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"Promise<void>","name":"Promise<void>"},"description":"Shuts down the PostHog 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 PostHog instance after calling it. Use flush() for per-request cleanup instead."},{"id":"wrap","path":"dist/posthog-rn.d.ts","title":"wrap","params":[{"name":"fn","type":"() => void","isOptional":false,"description":""}],"details":null,"category":"","examples":[{"id":"wrap","code":"// Generated example for wrap\nposthog.wrap();","name":"Generated example for wrap"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"void","name":"void"}}]}],"version":"4.10.5","categories":["Initialization","Identification","Capture","Error tracking","Feature flags","Group analytics","Privacy","LLM analytics"],"referenceId":"posthog-react-native"},"createdAt":"2025-10-27T15:15:01.500Z","updatedAt":"2025-10-27T15:15:01.500Z","publishedAt":"2025-10-27T15:15:01.494Z"}},{"id":26,"attributes":{"referenceId":"posthog-python","version":"6.7.11","data":{"id":"posthog-python-6.7.11","info":{"id":"posthog-python","title":"PostHog Python SDK","specUrl":"https://github.com/PostHog/posthog-python","version":"6.7.11","slugPrefix":"posthog-python","description":"Integrate PostHog into any python application."},"types":[{"id":"FeatureFlag","name":"FeatureFlag","path":"posthog.types.FeatureFlag","example":"","properties":[{"name":"key","type":"str","description":"Field: key"},{"name":"enabled","type":"bool","description":"Field: enabled"},{"name":"variant","type":"Optional[str]","description":"Field: variant"},{"name":"reason","type":"Optional[FlagReason]","description":"Field: reason"},{"name":"metadata","type":"Union[FlagMetadata, LegacyFlagMetadata]","description":"Field: metadata"}]},{"id":"FeatureFlagResult","name":"FeatureFlagResult","path":"posthog.types.FeatureFlagResult","example":"","properties":[{"name":"key","type":"str","description":"Field: key"},{"name":"enabled","type":"bool","description":"Field: enabled"},{"name":"variant","type":"Optional[str]","description":"Field: variant"},{"name":"payload","type":"Optional[Any]","description":"Field: payload"},{"name":"reason","type":"Optional[str]","description":"Field: reason"}]},{"id":"FlagMetadata","name":"FlagMetadata","path":"posthog.types.FlagMetadata","example":"","properties":[{"name":"id","type":"int","description":"Field: id"},{"name":"payload","type":"Optional[str]","description":"Field: payload"},{"name":"version","type":"int","description":"Field: version"},{"name":"description","type":"str","description":"Field: description"}]},{"id":"FlagReason","name":"FlagReason","path":"posthog.types.FlagReason","example":"","properties":[{"name":"code","type":"str","description":"Field: code"},{"name":"condition_index","type":"Optional[int]","description":"Field: condition_index"},{"name":"description","type":"str","description":"Field: description"}]},{"id":"FlagsAndPayloads","name":"FlagsAndPayloads","path":"posthog.types.FlagsAndPayloads","example":"","properties":[{"name":"featureFlags","type":"Optional[dict[str, Union[bool, str]]]","description":"Field: featureFlags"},{"name":"featureFlagPayloads","type":"Optional[dict[str, Any]]","description":"Field: featureFlagPayloads"}]},{"id":"FlagsResponse","name":"FlagsResponse","path":"posthog.types.FlagsResponse","example":"","properties":[{"name":"flags","type":"dict[str, FeatureFlag]","description":"Field: flags"},{"name":"errorsWhileComputingFlags","type":"bool","description":"Field: errorsWhileComputingFlags"},{"name":"requestId","type":"str","description":"Field: requestId"},{"name":"quotaLimit","type":"Optional[list[str]]","description":"Field: quotaLimit"}]},{"id":"LegacyFlagMetadata","name":"LegacyFlagMetadata","path":"posthog.types.LegacyFlagMetadata","example":"","properties":[{"name":"payload","type":"Any","description":"Field: payload"}]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"posthog.types.SendFeatureFlagsOptions","example":"","properties":[{"name":"should_send","type":"bool","description":"Field: should_send"},{"name":"only_evaluate_locally","type":"Optional[bool]","description":"Field: only_evaluate_locally"},{"name":"person_properties","type":"Optional[dict[str, Any]]","description":"Field: person_properties"},{"name":"group_properties","type":"Optional[dict[str, dict[str, Any]]]","description":"Field: group_properties"},{"name":"flag_keys_filter","type":"Optional[list[str]]","description":"Field: flag_keys_filter"}]},{"id":"OptionalCaptureArgs","name":"OptionalCaptureArgs","path":"posthog.args.OptionalCaptureArgs","example":"","properties":[{"name":"distinct_id","type":"NotRequired[Union[Number, str, UUID, int, any]]","description":"Field: distinct_id"},{"name":"properties","type":"NotRequired[Optional[dict[str, Any]]]","description":"Field: properties"},{"name":"timestamp","type":"NotRequired[Union[datetime, str, any]]","description":"Field: timestamp"},{"name":"uuid","type":"NotRequired[Optional[str]]","description":"Field: uuid"},{"name":"groups","type":"NotRequired[Optional[dict[str, str]]]","description":"Field: groups"},{"name":"send_feature_flags","type":"NotRequired[Union[bool, SendFeatureFlagsOptions, any]]","description":"Field: send_feature_flags"},{"name":"disable_geoip","type":"NotRequired[Optional[bool]]","description":"Field: disable_geoip"}]},{"id":"OptionalSetArgs","name":"OptionalSetArgs","path":"posthog.args.OptionalSetArgs","example":"","properties":[{"name":"distinct_id","type":"NotRequired[Union[Number, str, UUID, int, any]]","description":"Field: distinct_id"},{"name":"properties","type":"NotRequired[Optional[dict[str, Any]]]","description":"Field: properties"},{"name":"timestamp","type":"NotRequired[Union[datetime, str, any]]","description":"Field: timestamp"},{"name":"uuid","type":"NotRequired[Optional[str]]","description":"Field: uuid"},{"name":"disable_geoip","type":"NotRequired[Optional[bool]]","description":"Field: disable_geoip"}]},{"id":"SendFeatureFlagsOptions","name":"SendFeatureFlagsOptions","path":"posthog.types.SendFeatureFlagsOptions","example":"","properties":[{"name":"should_send","type":"bool","description":"Field: should_send"},{"name":"only_evaluate_locally","type":"Optional[bool]","description":"Field: only_evaluate_locally"},{"name":"person_properties","type":"Optional[dict[str, Any]]","description":"Field: person_properties"},{"name":"group_properties","type":"Optional[dict[str, dict[str, Any]]]","description":"Field: group_properties"},{"name":"flag_keys_filter","type":"Optional[list[str]]","description":"Field: flag_keys_filter"}]}],"hogRef":"0.3","classes":[{"id":"PostHog","title":"PostHog","functions":[{"id":"__init__","title":"Client","params":[{"name":"project_api_key","type":"str","isOptional":true,"description":"The project API key."},{"name":"host","type":"any","isOptional":false,"description":"The host to use for the client."},{"name":"debug","type":"bool","isOptional":false,"description":"Whether to enable debug mode."},{"name":"max_queue_size","type":"int","isOptional":false,"description":""},{"name":"send","type":"bool","isOptional":false,"description":""},{"name":"on_error","type":"any","isOptional":false,"description":""},{"name":"flush_at","type":"int","isOptional":false,"description":""},{"name":"flush_interval","type":"float","isOptional":false,"description":""},{"name":"gzip","type":"bool","isOptional":false,"description":""},{"name":"max_retries","type":"int","isOptional":false,"description":""},{"name":"sync_mode","type":"bool","isOptional":false,"description":""},{"name":"timeout","type":"int","isOptional":false,"description":""},{"name":"thread","type":"int","isOptional":false,"description":""},{"name":"poll_interval","type":"int","isOptional":false,"description":""},{"name":"personal_api_key","type":"any","isOptional":false,"description":""},{"name":"disabled","type":"bool","isOptional":false,"description":""},{"name":"disable_geoip","type":"bool","isOptional":false,"description":""},{"name":"historical_migration","type":"bool","isOptional":false,"description":""},{"name":"feature_flags_request_timeout_seconds","type":"int","isOptional":false,"description":""},{"name":"super_properties","type":"any","isOptional":false,"description":""},{"name":"enable_exception_autocapture","type":"bool","isOptional":false,"description":""},{"name":"log_captured_exceptions","type":"bool","isOptional":false,"description":""},{"name":"project_root","type":"any","isOptional":false,"description":""},{"name":"privacy_mode","type":"bool","isOptional":false,"description":""},{"name":"before_send","type":"any","isOptional":false,"description":""},{"name":"flag_fallback_cache_url","type":"any","isOptional":false,"description":""},{"name":"enable_local_evaluation","type":"bool","isOptional":false,"description":""}],"details":"","category":"Initialization","examples":[{"id":"example_1","code":"from posthog import Posthog\n\nposthog = Posthog('<ph_project_api_key>', host='<ph_app_host>')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Initialize a new PostHog client instance."},{"id":"alias","title":"alias","params":[{"name":"previous_id","type":"str","isOptional":true,"description":"The previous distinct ID."},{"name":"distinct_id","type":"str","isOptional":true,"description":"The new distinct ID to alias to."},{"name":"timestamp","type":"any","isOptional":false,"description":"The timestamp of the event."},{"name":"uuid","type":"any","isOptional":false,"description":"A unique identifier for the event."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this event."}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"posthog.alias(previous_id='distinct_id', distinct_id='alias_id')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Create an alias between two distinct IDs."},{"id":"capture","title":"capture","params":[{"name":"event","type":"str","isOptional":true,"description":"The event name to capture."},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"","category":"Capture","examples":[{"id":"example_1","code":"# Anonymous event\nposthog.capture('some-anon-event')","name":"Anonymous event"},{"id":"example_2","code":"# Context usage\nfrom posthog import identify_context, new_context\nwith new_context():\n    identify_context('distinct_id_of_the_user')\n    posthog.capture('user_signed_up')\n    posthog.capture('user_logged_in')\n    posthog.capture('some-custom-action', distinct_id='distinct_id_of_the_user')","name":"Context usage"},{"id":"example_3","code":"# Set event properties\nposthog.capture(\n    \"user_signed_up\",\n    distinct_id=\"distinct_id_of_the_user\",\n    properties={\n        \"login_type\": \"email\",\n        \"is_free_trial\": \"true\"\n    }\n)","name":"Set event properties"},{"id":"example_4","code":"# Page view event\nposthog.capture('$pageview', distinct_id=\"distinct_id_of_the_user\", properties={'$current_url': 'https://example.com'})","name":"Page view event"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Captures an event manually. [Learn about capture best practices](https://posthog.com/docs/product-analytics/capture-events)"},{"id":"capture_exception","title":"capture_exception","params":[{"name":"exception","type":"BaseException","isOptional":true,"description":"The exception to capture."},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"","category":"Error Tracking","examples":[{"id":"example_1","code":"try:\n    # Some code that might fail\n    pass\nexcept Exception as e:\n    posthog.capture_exception(e, 'user_distinct_id', properties=additional_properties)","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Capture an exception for error tracking."},{"id":"feature_enabled","title":"feature_enabled","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"is_my_flag_enabled = posthog.feature_enabled('flag-key', 'distinct_id_of_your_user')\nif is_my_flag_enabled:\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = posthog.get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Check if a feature flag is enabled for a user."},{"id":"flush","title":"flush","params":[],"details":"","category":null,"examples":[{"id":"example_1","code":"posthog.capture('event_name')\nposthog.flush()  # Ensures the event is sent immediately","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Force a flush from the internal queue to the server. Do not use directly, call `shutdown()` instead."},{"id":"get_all_flags","title":"get_all_flags","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"posthog.get_all_flags('distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[dict[str, Union[bool, str]]]"},"description":"Get all feature flags for a user."},{"id":"get_all_flags_and_payloads","title":"get_all_flags_and_payloads","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"posthog.get_all_flags_and_payloads('distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"FlagsAndPayloads"},"description":"Get all feature flags and their payloads for a user."},{"id":"get_feature_flag","title":"get_feature_flag","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"enabled_variant = posthog.get_feature_flag('flag-key', 'distinct_id_of_your_user')\nif enabled_variant == 'variant-key': # replace 'variant-key' with the key of your variant\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = posthog.get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Union[bool, str, any]"},"description":"Get multivariate feature flag value for a user."},{"id":"get_feature_flag_payload","title":"get_feature_flag_payload","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"match_value","type":"bool","isOptional":false,"description":"The specific flag value to get payload for."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"is_my_flag_enabled = posthog.feature_enabled('flag-key', 'distinct_id_of_your_user')\n\nif is_my_flag_enabled:\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = posthog.get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Get the payload for a feature flag."},{"id":"get_feature_flag_result","title":"get_feature_flag_result","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key."},{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to only evaluate locally."},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."}],"details":"","category":null,"examples":[{"id":"example_1","code":"flag_result = posthog.get_feature_flag_result('flag-key', 'distinct_id_of_your_user')\nif flag_result and flag_result.get_value() == 'variant-key':\n    # Do something differently for this user\n    # Optional: fetch the payload\n    matched_flag_payload = flag_result.payload","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[FeatureFlagResult]"},"description":"Get a FeatureFlagResult object which contains the flag result and payload for a key by evaluating locally or remotely depending on whether local evaluation is enabled and the flag can be locally evaluated. This also captures the `$feature_flag_called` event unless `send_feature_flag_events` is `False`."},{"id":"get_feature_flags_and_payloads","title":"get_feature_flags_and_payloads","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"result = posthog.get_feature_flags_and_payloads('<distinct_id>')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"FlagsAndPayloads"},"description":"Get feature flags and payloads for a user by calling decide."},{"id":"get_feature_payloads","title":"get_feature_payloads","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"payloads = posthog.get_feature_payloads('<distinct_id>')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"dict[str, str]"},"description":"Get feature flag payloads for a user by calling decide."},{"id":"get_feature_variants","title":"get_feature_variants","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The distinct ID of the user."},{"name":"groups","type":"any","isOptional":false,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"dict[str, Union[bool, str]]"},"description":"Get feature flag variants for a user by calling decide."},{"id":"get_flags_decision","title":"get_flags_decision","params":[{"name":"distinct_id","type":"Number","isOptional":false,"description":"The distinct ID of the user."},{"name":"groups","type":"dict","isOptional":true,"description":"A dictionary of group information."},{"name":"person_properties","type":"any","isOptional":false,"description":"A dictionary of person properties."},{"name":"group_properties","type":"any","isOptional":false,"description":"A dictionary of group properties."},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP for this request."},{"name":"flag_keys_to_evaluate","type":"list[str]","isOptional":true,"description":"A list of specific flag keys to evaluate. If provided,         only these flags will be evaluated, improving performance."}],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"decision = posthog.get_flags_decision('user123')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"FlagsResponse"},"description":"Get feature flags decision."},{"id":"group_identify","title":"group_identify","params":[{"name":"group_type","type":"str","isOptional":true,"description":"The type of group (e.g., 'company', 'team')."},{"name":"group_key","type":"str","isOptional":true,"description":"The unique identifier for the group."},{"name":"properties","type":"dict[str, Any]","isOptional":true,"description":"A dictionary of properties to set on the group."},{"name":"timestamp","type":"datetime","isOptional":false,"description":"The timestamp of the event."},{"name":"uuid","type":"str","isOptional":true,"description":"A unique identifier for the event."},{"name":"disable_geoip","type":"bool","isOptional":true,"description":"Whether to disable GeoIP for this event."},{"name":"distinct_id","type":"Number","isOptional":false,"description":"The distinct ID of the user performing the action."}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"posthog.group_identify('company', 'company_id_in_your_db', {\n    'name': 'Awesome Inc.',\n    'employees': 11\n})","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Identify a group and set its properties."},{"id":"join","title":"join","params":[],"details":"","category":null,"examples":[{"id":"example_1","code":"posthog.join()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"End the consumer thread once the queue is empty. Do not use directly, call `shutdown()` instead."},{"id":"load_feature_flags","title":"load_feature_flags","params":[],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"posthog.load_feature_flags()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Load feature flags for local evaluation."},{"id":"new_context","title":"new_context","params":[{"name":"fresh","type":"bool","isOptional":false,"description":"Whether to create a fresh context that doesn't inherit from parent."},{"name":"capture_exceptions","type":"bool","isOptional":false,"description":"Whether to automatically capture exceptions in this context."}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"with posthog.new_context():\n    identify_context('<distinct_id>')\n    posthog.capture('event_name')","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Create a new context for managing shared state. Learn more about [contexts](/docs/libraries/python#contexts)."},{"id":"set","title":"set","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"# Set with distinct id\nposthog.capture(\n    'event_name',\n    distinct_id='user-distinct-id',\n    properties={\n        '$set': {'name': 'Max Hedgehog'},\n        '$set_once': {'initial_url': '/blog'}\n    }\n)","name":"Set with distinct id"},{"id":"example_2","code":"# Set using context\nfrom posthog import new_context, identify_context\nwith new_context():\n    identify_context('user-distinct-id')\n    posthog.capture('event_name')","name":"Set using context"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a person profile."},{"id":"set_once","title":"set_once","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"posthog.set_once(distinct_id='user123', properties={'initial_signup_date': '2024-01-01'})","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a person profile only if they haven't been set before."},{"id":"shutdown","title":"shutdown","params":[],"details":"","category":null,"examples":[{"id":"example_1","code":"posthog.shutdown()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Flush all messages and cleanly shutdown the client. Call this before the process ends in serverless environments to avoid data loss."}],"description":"This is the SDK reference for the PostHog Python SDK. You can learn more about example usage in the [Python SDK documentation](/docs/libraries/python). You can also follow [Flask](/docs/libraries/flask) and [Django](/docs/libraries/django) guides to integrate PostHog into your project."},{"id":"PostHogModule","title":"PostHog Module Functions","functions":[{"id":"alias","title":"alias","params":[{"name":"previous_id","type":"any","isOptional":true,"description":"The unique ID of the user before"},{"name":"distinct_id","type":"any","isOptional":true,"description":"The current unique id"},{"name":"timestamp","type":"any","isOptional":false,"description":"Optional timestamp for the event"},{"name":"uuid","type":"any","isOptional":false,"description":"Optional UUID for the event"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"To marry up whatever a user does before they sign up or log in with what they do after you need to make an alias call. This will allow you to answer questions like \"Which marketing channels leads to users churning after a month?\" or \"What do users do on our website before signing up?\". Particularly useful for associating user behaviour before and after they e.g. register, login, or perform some other identifying action.","category":"Identification","examples":[{"id":"example_1","code":"# Alias user\nfrom posthog import alias\nalias(previous_id='distinct_id', distinct_id='alias_id')","name":"Alias user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Associate user behaviour before and after they e.g. register, login, or perform some other identifying action."},{"id":"capture","title":"capture","params":[{"name":"event","type":"str","isOptional":true,"description":"The event name to specify the event     **kwargs: Optional arguments including:"},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"Capture allows you to capture anything a user does within your system, which you can later use in PostHog to find patterns in usage, work out which features to improve or where people are giving up. A capture call requires an event name to specify the event. We recommend using [verb] [noun], like `movie played` or `movie updated` to easily identify what your events mean later on. Capture takes a number of optional arguments, which are defined by the `OptionalCaptureArgs` type.","category":"Events","examples":[{"id":"example_1","code":"# Context and capture usage\nfrom posthog import new_context, identify_context, tag_context, capture\n# Enter a new context (e.g. a request/response cycle, an instance of a background job, etc)\nwith new_context():\n    # Associate this context with some user, by distinct_id\n    identify_context('some user')\n\n    # Capture an event, associated with the context-level distinct ID ('some user')\n    capture('movie started')\n\n    # Capture an event associated with some other user (overriding the context-level distinct ID)\n    capture('movie joined', distinct_id='some-other-user')\n\n    # Capture an event with some properties\n    capture('movie played', properties={'movie_id': '123', 'category': 'romcom'})\n\n    # Capture an event with some properties\n    capture('purchase', properties={'product_id': '123', 'category': 'romcom'})\n    # Capture an event with some associated group\n    capture('purchase', groups={'company': 'id:5'})\n\n    # Adding a tag to the current context will cause it to appear on all subsequent events\n    tag_context('some-tag', 'some-value')\n\n    capture('another-event') # Will be captured with `'some-tag': 'some-value'` in the properties dict","name":"Context and capture usage"},{"id":"example_2","code":"# Set event properties\nfrom posthog import capture\ncapture(\n    \"user_signed_up\",\n    distinct_id=\"distinct_id_of_the_user\",\n    properties={\n        \"login_type\": \"email\",\n        \"is_free_trial\": \"true\"\n    }\n)","name":"Set event properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Capture anything a user does within your system."},{"id":"capture_exception","title":"capture_exception","params":[{"name":"exception","type":"BaseException","isOptional":false,"description":"The exception to capture. If not provided, the current exception is captured via `sys.exc_info()`"},{"name":"kwargs","type":"Unpack[OptionalCaptureArgs]","isOptional":true,"description":""}],"details":"Capture exception is idempotent - if it is called twice with the same exception instance, only a occurrence will be tracked in posthog. This is because, generally, contexts will cause exceptions to be captured automatically. However, to ensure you track an exception, if you catch and do not re-raise it, capturing it manually is recommended, unless you are certain it will have crossed a context boundary (e.g. by existing a `with posthog.new_context():` block already). If the passed exception was raised and caught, the captured stack trace will consist of every frame between where the exception was raised and the point at which it is captured (the \"traceback\"). If the passed exception was never raised, e.g. if you call `posthog.capture_exception(ValueError(\"Some Error\"))`, the stack trace captured will be the full stack trace at the moment the exception was captured. Note that heavy use of contexts will lead to truncated stack traces, as the exception will be captured by the context entered most recently, which may not be the point you catch the exception for the final time in your code. It's recommended to use contexts sparingly, for this reason. `capture_exception` takes the same set of optional arguments as `capture`.","category":"Events","examples":[{"id":"example_1","code":"# Capture exception\nfrom posthog import capture_exception\ntry:\n    risky_operation()\nexcept Exception as e:\n    capture_exception(e)","name":"Capture exception"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Capture exceptions that happen in your code."},{"id":"feature_enabled","title":"feature_enabled","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key"},{"name":"distinct_id","type":"any","isOptional":true,"description":"The user's distinct ID"},{"name":"groups","type":"any","isOptional":false,"description":"Groups mapping"},{"name":"person_properties","type":"any","isOptional":false,"description":"Person properties"},{"name":"group_properties","type":"any","isOptional":false,"description":"Group properties"},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to evaluate only locally"},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"You can call `posthog.load_feature_flags()` before to make sure you're not doing unexpected requests.","category":"Feature flags","examples":[{"id":"example_1","code":"# Boolean feature flag\nfrom posthog import feature_enabled, get_feature_flag_payload\nis_my_flag_enabled = feature_enabled('flag-key', 'distinct_id_of_your_user')\nif is_my_flag_enabled:\n    matched_flag_payload = get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Boolean feature flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Use feature flags to enable or disable features for users."},{"id":"feature_flag_definitions","title":"feature_flag_definitions","params":[],"details":"Returns loaded feature flags, if any. Helpful for debugging what flag information you have loaded.","category":"Feature flags","examples":[{"id":"example_1","code":"from posthog import feature_flag_definitions\ndefinitions = feature_flag_definitions()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Returns loaded feature flags."},{"id":"flush","title":"flush","params":[],"details":"","category":"Client management","examples":[{"id":"example_1","code":"from posthog import flush\nflush()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Tell the client to flush all queued events."},{"id":"get_all_flags","title":"get_all_flags","params":[{"name":"distinct_id","type":"any","isOptional":true,"description":"The user's distinct ID"},{"name":"groups","type":"any","isOptional":false,"description":"Groups mapping"},{"name":"person_properties","type":"any","isOptional":false,"description":"Person properties"},{"name":"group_properties","type":"any","isOptional":false,"description":"Group properties"},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to evaluate only locally"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"Flags are key-value pairs where the key is the flag key and the value is the flag variant, or True, or False.","category":"Feature flags","examples":[{"id":"example_1","code":"# All flags for user\nfrom posthog import get_all_flags\nget_all_flags('distinct_id_of_your_user')","name":"All flags for user"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[dict[str, FeatureFlag]]"},"description":"Get all flags for a given user."},{"id":"get_feature_flag","title":"get_feature_flag","params":[{"name":"key","type":"any","isOptional":true,"description":"The feature flag key"},{"name":"distinct_id","type":"any","isOptional":true,"description":"The user's distinct ID"},{"name":"groups","type":"any","isOptional":false,"description":"Groups mapping from group type to group key"},{"name":"person_properties","type":"any","isOptional":false,"description":"Person properties"},{"name":"group_properties","type":"any","isOptional":false,"description":"Group properties in format { group_type_name: { group_properties } }"},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":"Whether to evaluate only locally"},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":"Whether to send feature flag events"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"`groups` are a mapping from group type to group key. So, if you have a group type of \"organization\" and a group key of \"5\", you would pass groups={\"organization\": \"5\"}. `group_properties` take the format: { group_type_name: { group_properties } }. So, for example, if you have the group type \"organization\" and the group key \"5\", with the properties name, and employee count, you'll send these as: group_properties={\"organization\": {\"name\": \"PostHog\", \"employees\": 11}}.","category":"Feature flags","examples":[{"id":"example_1","code":"# Multivariate feature flag\nfrom posthog import get_feature_flag, get_feature_flag_payload\nenabled_variant = get_feature_flag('flag-key', 'distinct_id_of_your_user')\nif enabled_variant == 'variant-key':\n    matched_flag_payload = get_feature_flag_payload('flag-key', 'distinct_id_of_your_user')","name":"Multivariate feature flag"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[FeatureFlag]"},"description":"Get feature flag variant for users. Used with experiments."},{"id":"get_feature_flag_result","title":"get_feature_flag_result","params":[{"name":"key","type":"any","isOptional":true,"description":""},{"name":"distinct_id","type":"any","isOptional":true,"description":""},{"name":"groups","type":"any","isOptional":false,"description":""},{"name":"person_properties","type":"any","isOptional":false,"description":""},{"name":"group_properties","type":"any","isOptional":false,"description":""},{"name":"only_evaluate_locally","type":"bool","isOptional":false,"description":""},{"name":"send_feature_flag_events","type":"bool","isOptional":false,"description":""},{"name":"disable_geoip","type":"any","isOptional":false,"description":""}],"details":"","category":null,"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Get a FeatureFlagResult object which contains the flag result and payload.  This method evaluates a feature flag and returns a FeatureFlagResult object containing: - enabled: Whether the flag is enabled - variant: The variant value if the flag has variants - payload: The payload associated with the flag (automatically deserialized from JSON) - key: The flag key - reason: Why the flag was enabled/disabled  Example: ```python result = posthog.get_feature_flag_result('beta-feature', 'distinct_id') if result and result.enabled:     # Use the variant and payload     print(f\"Variant: {result.variant}\")     print(f\"Payload: {result.payload}\") ```"},{"id":"get_remote_config_payload","title":"get_remote_config_payload","params":[{"name":"key","type":"any","isOptional":true,"description":"The key of the feature flag"}],"details":"","category":null,"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Get the payload for a remote config feature flag."},{"id":"group_identify","title":"group_identify","params":[{"name":"group_type","type":"any","isOptional":true,"description":"Type of your group"},{"name":"group_key","type":"any","isOptional":true,"description":"Unique identifier of the group"},{"name":"properties","type":"any","isOptional":false,"description":"Properties to set on the group"},{"name":"timestamp","type":"any","isOptional":false,"description":"Optional timestamp for the event"},{"name":"uuid","type":"any","isOptional":false,"description":"Optional UUID for the event"},{"name":"disable_geoip","type":"any","isOptional":false,"description":"Whether to disable GeoIP lookup"}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"# Group identify\nfrom posthog import group_identify\ngroup_identify('company', 'company_id_in_your_db', {\n    'name': 'Awesome Inc.',\n    'employees': 11\n})","name":"Group identify"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Set properties on a group."},{"id":"identify_context","title":"identify_context","params":[{"name":"distinct_id","type":"str","isOptional":true,"description":"The distinct ID to associate with the current context and its children"}],"details":"","category":"Identification","examples":[{"id":"example_1","code":"from posthog import identify_context\nidentify_context(\"user_123\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Identify the current context with a distinct ID."},{"id":"join","title":"join","params":[],"details":"","category":"Client management","examples":[{"id":"example_1","code":"from posthog import join\njoin()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Block program until the client clears the queue. Used during program shutdown. You should use `shutdown()` directly in most cases."},{"id":"load_feature_flags","title":"load_feature_flags","params":[],"details":"","category":"Feature flags","examples":[{"id":"example_1","code":"from posthog import load_feature_flags\nload_feature_flags()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Load feature flag definitions from PostHog."},{"id":"new_context","title":"new_context","params":[{"name":"fresh","type":"bool","isOptional":false,"description":"Whether to start with a fresh context (default: False)"},{"name":"capture_exceptions","type":"bool","isOptional":false,"description":"Whether to capture exceptions raised within the context (default: True)"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import new_context, tag, capture\nwith new_context():\n    tag(\"request_id\", \"123\")\n    capture(\"event_name\", properties={\"property\": \"value\"})","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Create a new context scope that will be active for the duration of the with block."},{"id":"scoped","title":"scoped","params":[{"name":"fresh","type":"bool","isOptional":false,"description":"Whether to start with a fresh context (default: False)"},{"name":"capture_exceptions","type":"bool","isOptional":false,"description":"Whether to capture and track exceptions with posthog error tracking (default: True)"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import scoped, tag, capture\n@scoped()\ndef process_payment(payment_id):\n    tag(\"payment_id\", payment_id)\n    capture(\"payment_started\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Decorator that creates a new context for the function."},{"id":"set","title":"set","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"This will overwrite previous people property values. Generally operates similar to `capture`, with distinct_id being an optional argument, defaulting to the current context's distinct ID. If there is no context-level distinct ID, and no override distinct_id is passed, this function will do nothing. Context tags are folded into $set properties, so tagging the current context and then calling `set` will cause those tags to be set on the user (unlike capture, which causes them to just be set on the event).","category":"Identification","examples":[{"id":"example_1","code":"# Set person properties\nfrom posthog import capture\ncapture(\n    'distinct_id',\n    event='event_name',\n    properties={\n        '$set': {'name': 'Max Hedgehog'},\n        '$set_once': {'initial_url': '/blog'}\n    }\n)","name":"Set person properties"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a user record."},{"id":"set_context_session","title":"set_context_session","params":[{"name":"session_id","type":"str","isOptional":true,"description":"The session ID to associate with the current context and its children"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import set_context_session\nset_context_session(\"session_123\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Set the session ID for the current context."},{"id":"set_once","title":"set_once","params":[{"name":"kwargs","type":"Unpack[OptionalSetArgs]","isOptional":true,"description":""}],"details":"This will not overwrite previous people property values, unlike `set`. Otherwise, operates in an identical manner to `set`.","category":"Identification","examples":[{"id":"example_1","code":"# Set property once\nfrom posthog import capture\ncapture(\n    'distinct_id',\n    event='event_name',\n    properties={\n        '$set': {'name': 'Max Hedgehog'},\n        '$set_once': {'initial_url': '/blog'}\n    }\n)","name":"Set property once"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"Optional[str]"},"description":"Set properties on a user record, only if they do not yet exist."},{"id":"shutdown","title":"shutdown","params":[],"details":"","category":"Client management","examples":[{"id":"example_1","code":"from posthog import shutdown\nshutdown()","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Flush all messages and cleanly shutdown the client."},{"id":"tag","title":"tag","params":[{"name":"name","type":"str","isOptional":true,"description":"The tag key"},{"name":"value","type":"Any","isOptional":true,"description":"The tag value"}],"details":"","category":"Contexts","examples":[{"id":"example_1","code":"from posthog import tag\ntag(\"user_id\", \"123\")","name":"Example 1"}],"showDocs":true,"releaseTag":"public","returnType":{"id":"return_type","name":"None"},"description":"Add a tag to the current context."}],"description":"Global functions available in the PostHog module"}],"version":"6.7.11","categories":["Initialization","Identification","Capture","Error Tracking","Feature flags","Contexts","Events","Client management"],"referenceId":"posthog-python"},"createdAt":"2025-10-28T13:15:01.720Z","updatedAt":"2025-10-28T13:15:01.720Z","publishedAt":"2025-10-28T13:15:01.714Z"}}],"meta":{"pagination":{"page":1,"pageSize":25,"pageCount":20,"total":478}}}