Skip to content

Create EXPERT_COMMS_BETA_ENABLED feature flag for frontend #7168

@n-lark

Description

@n-lark

EXPERT_COMMS_BETA_ENABLED feature flag added

EXPERT_COMMS_BETA_ENABLED is a per-team PostHog flag. Flip it on for specific teams in the
PostHog UI — no deploy needed.

PostHog flag: EXPERT_COMMS_BETA_ENABLED

Use it in a component

import { mapState } from 'pinia'
import { useAccountSettingsStore } from '@/stores/account-settings.js'

export default {
    computed: {
        ...mapState(useAccountSettingsStore, ['isExpertCommsBetaEnabled'])
    }
}
<div v-if="isExpertCommsBetaEnabled">…beta UI…</div>

The getter updates reactively as PostHog re-evaluates flags.

Enable it for a team

  1. Open the flag in PostHog.
  2. Under Match by, pick Group → team.
  3. Add filter: team-id equals <team-hashid> (from GET /api/v1/user/teamsid field).
  4. Save. Have the user reload FlowFuse — the flag flips on within a few seconds.
Image

Local testing

To test locally, add to flowforge.local.yml and restart the forge backend:

telemetry:
  enabled: true
  frontend:
    posthog:
      apiurl: https://eu.posthog.com
      apikey: <phc_…project-token>
      capture_pageview: false

To get apikey: Posthog -> Settings -> General -> Project token

Disable ad blockers on localhost (uBlock, Brave Shields, Privacy Badger all block
PostHog). If you see ERR_BLOCKED_BY_CLIENT in the console, that's why. Easiest fix:
test in a clean Incognito window with extensions off.

Verify in the console while logged into the target team:

window.posthog.getGroups()                                  // → { team: "<id>" }
window.posthog.isFeatureEnabled('EXPERT_COMMS_BETA_ENABLED') // → true

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions