- fix: check if window and fetch are available before using on web env
- Add new debugging property
$feature_flag_bootstrapped_response
,$feature_flag_bootstrapped_payload
and$used_bootstrap_value
to$feature_flag_called
event
- chore: default
captureMode
changed tojson
.- To keep using the
form
mode, just set thecaptureMode
option toform
when initializing the PostHog client.
- To keep using the
- fix: identify method allows passing a $set_once object
- Fixed and error that prevented localstorage from ever being used and instead falling back to sessionstorage for persistence
- chore: change host to new address.
- Prevent double JSON parsing of feature flag payloads, which would convert the payload [1] into 1.
- Adds a
disabled
option and the ability to change it later viaposthog.disabled = true
. Useful for disabling PostHog tracking for example in a testing environment without having complex conditional checking shutdown
takes ashutdownTimeoutMs
param with a default of 30000 (30s). This is the time to wait for flushing events before shutting down the client. If the timeout is reached, the client will be shut down regardless of pending events.- Adds a new
featureFlagsRequestTimeoutMs
timeout parameter for feature flags which defaults to 10 seconds. - Flushes will now try to flush up to
maxBatchSize
(default 100) in one go - Queued events are limited up to
maxQueueSize
(default 1000) and the oldest events are dropped when the limit is reached
- Removes the
enable
option. You can now specifydefaultOptIn: false
to start the SDK opted out of tracking flushAsync
andshutdownAsync
are removed withflush
andshutdown
now being the async methods.
flush
andshutdown
now being async methods.- Many methods such as
capture
andidentify
no longer return thethis
object instead returning nothing
- Fixed an issue where
shutdown
would potentially exit early if a flush was already in progress - Fixes some typos in types
flushAsync
andshutdownAsync
are removed withflush
andshutdown
now being the async methods.- Fixed an issue where
shutdownAsync
would potentially exit early if a flush was already in progress - Flushes will now try to flush up to
maxBatchSize
(default 100) in one go
- Removes the
enable
option. You can now specifydefaultOptIn: false
to start the SDK opted out of tracking - Adds a
disabled
option and the ability to change it later viaposthog.disabled = true
. Useful for disabling PostHog tracking for example in a testing environment without having complex conditional checking - Many methods such as
capture
andidentify
no longer return thethis
object instead returning nothing - Fixes some typos in types
shutdown
andshutdownAsync
takes ashutdownTimeoutMs
param with a default of 30000 (30s). This is the time to wait for flushing events before shutting down the client. If the timeout is reached, the client will be shut down regardless of pending events.- Adds a new
featureFlagsRequestTimeoutMs
timeout parameter for feature flags which defaults to 10 seconds.
- fix: using
captureMode=form
won't throw an error and retry unnecessarily
- Swapped to
uuidv7
for unique ID generation
- Adds support for overriding the event
uuid
via capture options
- Renamed
personProperties
tosetPersonPropertiesForFlags
to matchposthog-js
and more clearly indicated what it does - Renamed
groupProperties
tosetGroupPropertiesForFlags
to matchposthog-js
and more clearly indicated what it does
- Fixes a race condition that could occur when initialising PostHog
- Fixes an issue where feature flags would not be reloaded after a reset
- Some small fixes to incorrect types
- Fixed fetch compatibility by aligning error handling
- Added two errors: PostHogFetchHttpError (non-2xx status) and PostHogFetchNetworkError (fetch network error)
- Added .on('error', (err) => void)
- shutdownAsync now ignores fetch errors. They should be handled with .on('error', ...) from now on.
- Fixes an issue where background network errors would trigger unhandled promise warnings
- Adds support for overriding timestamp of capture events
- uses v3 decide endpoint
- JSON payloads will be returned with feature flags
- Feature flags will gracefully fail and optimistically save evaluated flags if server is down
- Ensures the distinctId used in
.groupIdentify
is the same as the currently identified user