- Adds logging to error responses from the PostHog API so that users can see how a call failed (e.g. rate limiting) from the SDK itself.
- Better string formatting in
poller.Errorf
- The client will fall back to the
/decide
endpoint when evaluating feature flags if the user does not wish to provide a PersonalApiKey. This fixes an issue where users were unable to use this SDK without providing a PersonalApiKey. This fallback will make feature flag usage less performant, but will save users money by not making them pay for public API access.
Breaking changes:
- Minimum PostHog version requirement: 1.38
- Local Evaluation added to IsFeatureEnabled and GetFeatureFlag. These functions now accept person and group properties arguments. The arguments will be used to locally evaluate relevant feature flags.
- Feature flag functions take a payload called
FeatureFlagPayload
when a key is require andFeatureFlagPayloadNoKey
when a key is not required. The payload will handle defaults for all unspecified arguments automatically. - Feature Flag defaults have been removed. If the flag fails for any reason, nil will be returned.
- GetAllFlags argument added. This function returns all flags related to the id.