Hash properties

Hash properties

Hashes sensitive fields with SHA256 using a salt. This helps protect user privacy while maintaining data consistency.

Configuration

OptionDescription
Salt
Type: string
Required: True

A secret salt used for hashing. This should be kept secure and consistent.

Fields to hash
Type: string
Required: True

Comma-separated list of field names to hash. Can include both event properties and top-level event fields like distinct_id.

Also hash $set and $set_once properties
Type: boolean
Required: False

Whether to also hash $set and $set_once properties that are used to update Person properties.

Using our REST API you can create this transformation like so:

Terminal
# Create a new destination
curl --location 'https://us.i.posthog.com/api/environments/:project_id/hog_functions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <POSTHOG_PERSONAL_API_KEY>' \
--data '{
"type": "transformation",
"name": "Hash properties",
"inputs": {
"salt": {
"value": ""
},
"privateFields": {
"value": ""
}
},
"enabled": true,
"template_id": "template-hash-properties"
}'