Customer request was basically asking to omit one of the properties we bundle by default. This is currently already possible but only by extending the PostHog class and overriding the property like this:
class CustomPostHog extends PostHog {
getCommonEventProperties(): any {
const properties = super.getCommonEventProperties()
// Filter out or add more properties here
delete properties.$device_name
return properties
}
}
We do provide an option which was intended for providing your own "native" app properties if you don't want to use the libraries we support via native-deps but this becomes a full override, meaning you have to build all the options yourself manually.
PostHog.initAsync("token", { customAppProperties: {
$device_name: 'My own thing',
}})
Changes
Allow customAppProperties to be a function that takes the existing properties
Problem
Customer request was basically asking to omit one of the properties we bundle by default. This is currently already possible but only by extending the
PostHog
class and overriding the property like this:We do provide an option which was intended for providing your own "native" app properties if you don't want to use the libraries we support via native-deps but this becomes a full override, meaning you have to build all the options yourself manually.
Changes
Allow customAppProperties to be a function that takes the existing properties
which feels a lot more client-friendly that overriding the class.
Release info Sub-libraries affected
Bump level
Libraries affected
Changelog notes
options.customAppProperties