PostHog / posthog-node

Official PostHog Node library
MIT License
21 stars 19 forks source link

Add Feature Flags support #29

Closed yakkomajuri closed 3 years ago

yakkomajuri commented 3 years ago

Dear Reviewer

Given prettier was run here, feature-flags.js and test.js are the places to focus most of the energy on.

What this does

  1. Adds support for feature flags
  2. Make everything prettier

What this does not do

  1. Refactor the existing codebase - I was originally doing this but decided to leave this up to a separate PR. Things like consolidating all the requests, etc.

How the feature flags work

This follows the posthog-python implementation almost exactly.

Follow-up work

  1. Documentation
  2. Writing up a feature flags spec - indeed the posthog-python code somewhat serves as this, but we need a place that at least tells us how to correctly calculate simple flags so we don't end up with diverging implementations. I spent some time playing around with crypto to get this right.
  3. Refactor
yakkomajuri commented 3 years ago

@Twixes yeah I do apologize for the prettier changes coming in this PR

yakkomajuri commented 3 years ago

Ready to go

yakkomajuri commented 3 years ago

Also writing docs now

weyert commented 3 years ago

Awesome 🥇