- Adds a new, optional
distinct_id
parameter to group identify calls which allows specifying the Distinct ID for the event.
- Adds a new
feature_flag_request_timeout_seconds
timeout parameter for feature flags which defaults to 3 seconds, updated from the default 10s for all other API calls.
- Fix memory leak in PostHog::Client.new
- Remove new relative date operators, combine into regular date operators
- Add default properties for feature flags local evaluation, to target flags by distinct id & group keys.
- Numeric property handling for feature flags now does the expected: When passed in a number, we do a numeric comparison. When passed in a string, we do a string comparison. Previously, we always did a string comparison.
- Add support for relative date operators for local evaluation.
- Update option doc string to show personal API Key as an option
- Add support for feature flag payloads
- Remove concurrent gem dependency version limitation
- Add support for datetime operators for local feature flag evaluation
- Add support for variant overrides for local feature flag evaluation
Breaking changes:
- Minimum PostHog version requirement: 1.38
- Regular feature flag evaluation (i.e. by requesting from your PostHog servers) doesn't require a personal API key.
Client
initialisation doesn't take theapi_host
parameter anymore. Instead, it takes thehost
parameter, which needs to be fully qualified. For example:https://api.posthog.com
is valid, whileapi.posthog.com
is not valid.- The log level by default is set to WARN. You can change it to DEBUG if you want to debug the client by running
client.logger.level = Logger::DEBUG
, where client is your initializedPostHog::Client
instance. - Default polling interval for feature flags is now set at 30 seconds. If you don't want local evaluation, don't set a personal API key in the library.
- Feature flag defaults are no more. Now, if a flag fails to compute for whatever reason, it will return
nil
. Otherwise, it returns either true or false. In case ofget_feature_flag
, it may also return a string variant value.
New Changes:
- You can now evaluate feature flags locally (i.e. without sending a request to your PostHog servers) by setting a personal API key, and passing in groups and person properties to
is_feature_enabled
andget_feature_flag
calls. - Introduces a
get_all_flags
method that returns all feature flags. This is useful for when you want to seed your frontend with some initial flags, given a user ID.
- Add support for running the client in "No-op" mode for testing (#15)
- Fix
create_alias
call (#14)
- Fix
present?
call (#12)
- Add ability to disable SSL verification by passing
skip_ssl_verification
(#11)
- Add concurrent-ruby gem dependency (fixes #8)
- Change default domain from
t.posthog.com
toapp.posthog.com