Skip to content

Commit

Permalink
fix: disable feature flagg polling in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
codeincontext committed Oct 31, 2024
1 parent 90a0617 commit c44e1f1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const apiKey = process.env.NEXT_PUBLIC_POSTHOG_API_KEY || "*";
const personalApiKey = process.env.POSTHOG_PERSONAL_KEY_FLAGS;
invariant(personalApiKey, "POSTHOG_PERSONAL_KEY_FLAGS is required");

const enableLocalEvaluation = process.env.NODE_ENV !== "test";

/**
* This is the posthog nodejs client configured to send events to the
* posthog AI BETA instance.
Expand All @@ -24,5 +26,5 @@ export const posthogAiBetaServerClient = new PostHog(apiKey, {
// Instead we cache them in KV through a custom fetch implementation.
fetch: cachedFetch,
featureFlagsPollingInterval,
personalApiKey,
personalApiKey: enableLocalEvaluation ? personalApiKey : undefined,
});

0 comments on commit c44e1f1

Please sign in to comment.