Skip to content

Commit

Permalink
chore(docs): update docs around getFeatureFlagPayload based on some…
Browse files Browse the repository at this point in the history
… customer feedback (#10334)

* first bit

* modify docs
  • Loading branch information
dmarticus authored Jan 14, 2025
1 parent 244b18f commit 25b5a13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if (isFeatureFlagEnabled) {
// Your code if the flag is enabled

// Optional: fetch the payload
const matchedFlagPayload = await client.getFeatureFlagPayload('flag-key', 'distinct_id_of_your_user')
const matchedFlagPayload = await client.getFeatureFlagPayload('flag-key', 'distinct_id_of_your_user', isFeatureFlagEnabled)
}
```

Expand All @@ -23,7 +23,7 @@ if (enabledVariant === 'variant-key') { // replace 'variant-key' with the key o
// Do something differently for this user

// Optional: fetch the payload
const matchedFlagPayload = await client.getFeatureFlagPayload('flag-key', 'distinct_id_of_your_user')
const matchedFlagPayload = await client.getFeatureFlagPayload('flag-key', 'distinct_id_of_your_user', enabledVariant)
}
```

Expand Down
2 changes: 1 addition & 1 deletion contents/docs/libraries/node/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import NodeInstall from '../../integrate/_snippets/install-node.mdx'
| `host` | Your PostHog host | `https://us.i.posthog.com/`|
| `flushAt` | After how many capture calls we should flush the queue (in one batch) | `20` |
| `flushInterval` | After how many ms we should flush the queue | `10000` |
| `personalApiKey` | An optional [personal API key](/docs/api/overview#personal-api-keys-recommended) for evaluating feature flags locally | `null` |
| `personalApiKey` | An optional [personal API key](/docs/api/overview#personal-api-keys-recommended) for evaluating feature flags locally. Note: Providing this will trigger periodic calls to the feature flags service, even if you're not using feature flags. | `null` |
| `featureFlagsPollingInterval` | Interval in milliseconds specifying how often feature flags should be fetched from the PostHog API | `300000` |
| `requestTimeout` | Timeout in milliseconds for any calls | `10000` |
| `maxCacheSize` | Maximum size of cache that deduplicates $feature_flag_called calls per user. | `50000` |
Expand Down

0 comments on commit 25b5a13

Please sign in to comment.