SemVer Flattener

Last updated:

What does the SemVer Flattener do?

The SemVer Flattener splits a valid SemVer version into the following

export interface VersionParts {
major: number
minor: number
patch?: number
preRelease?: string
build?: string
}

And then flattens them onto an event. So, this...

{
properties: {
app_version: '22.7.11'
}
}

Becomes this...

{
properties: {
app_version: '22.7.11'
app_version__major: 22,
app_version__minor: 7,
app_version__patch: 11
}
}

This is especially helpful for comparing versions when filtering in PostHog insights, as it isn't possible to correctly use string comparison in all situations.

What are the requirements for this app?

This app requires either PostHog Cloud, or a self-hosted PostHog instance running version 1.30.0 or later.

Not running 1.30.0? Find out how to update your self-hosted PostHog deployment!

How do I install the SemVer Flattener app?

  1. Visit the 'Apps' page in your instance of PostHog.
  2. Search for 'SemVer Flattener' and select the app, press Install.

That's it!

Is the source code for this app available?

PostHog is open-source and so are all apps on the platform. The source code for the SemVer Flattener is available on GitHub.

Who created this app?

We'd like to thank PostHog team member Paul D'Ambra for creating this app. Cheers, Paul!

Who maintains this app?

This app is maintained by PostHog. If you have issues with the app not functioning as intended, please raise a bug report to let us know!

What if I have feedback on this app?

We love feature requests and feedback! Please create an issue to tell us what you think.

What if my question isn't answered above?

We love answering questions. Ask us anything via our Support page.

You can also join the PostHog Community Slack group to collaborate with others and get advice on developing your own PostHog apps.

Questions?

Was this page useful?