Skip to content

Commit

Permalink
docs: Update README.md to include posthog details
Browse files Browse the repository at this point in the history
  • Loading branch information
arslanashraf7 authored Jan 30, 2025
1 parent b587cb4 commit 7d4b159
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ Refer to the [poetry documentation](https://python-poetry.org/docs/cli/) for par

We are using PostHog for managing the features. PostHog provides many built-in filters/conditions to enable/disable features in the application without any code change or deployment.

_NOTE:_ We are using [olposthog](https://github.com/mitodl/ol-django/tree/main/src/olposthog) which is our own wrapper around PostHog to make things simpler and add caching.
_NOTE:_ We are using [olposthog](https://github.com/mitodl/ol-django/tree/main/src/olposthog) which is our own wrapper around PostHog to make things simpler and add caching. As part of this, we run `./manage.py createcachetable` to create the cache table for the feature flags. So that you know, your application would not work if you haven't created the cache table.

You need below configurations in the application to use PostHog. Once enabled you can manage the feature flags through your PostHog account dashboard.
You need the below configurations in the application to use PostHog. Once enabled, you can manage the feature flags through your PostHog account dashboard.

**\*(Required)**

Expand All @@ -175,3 +175,7 @@ You need below configurations in the application to use PostHog. Once enabled yo

- POSTHOG_FEATURE_FLAG_REQUEST_TIMEOUT_MS (`Default value: 3000`)
- POSTHOG_MAX_RETRIES (`Default value: 3`)

# PostHog Feature Flags

We are using a couple of feature flags for xPRO. All these feature flags are listed in [features.py](https://github.com/mitodl/mitxpro/blob/master/mitxpro/features.py). To work with these flags you need to integrate Posthog as mentioned in the above step. If you don't have the API Key or you do not want to integrate the Posthog but still want to use it, you can use the default return value in the `is_enabled` method which is called for accessing the value of a feature flag.

0 comments on commit 7d4b159

Please sign in to comment.