/Docs
IntroductionHow FeatureGate worksQuickstart
OrganisationsProjectsEnvironments
OverviewTypes and valuesConfigure across environmentsTargeting rulesPercentage rolloutsDesign evaluation contextLifecycle and intentTags and discovery
Choose an evaluation approachEvaluation credentialsNode.js SDKEvaluate over HTTPEvaluate in browsersSnapshots and configuration freshnessErrors and fallbacksTest flags locallyProduction integration checklist
Run a controlled rolloutKill switchesProject insightsActivity and audit historyReview and clean up flagsEnvironment readinessTroubleshooting and limits
Members, roles, and permissionsInvite and manage a teamOrganisation settings and operational defaultsProject lifecycle and transferPlans, billing, and team organisationsOrganisation closure and reactivationAccount settings and security
Management API overviewPreviewProvision flags through automationPreviewRotate runtime keys through automationPreviewAudit project changes through automationPreview
DocsAPI Reference

Evaluate/Choose an evaluation approach

Get access
/Docs
Get access
  1. Docs
  2. Evaluate
  3. Choose an evaluation approach

Choose an evaluation approach

Compare local Node.js, direct server HTTP, and publishable browser HTTP evaluation.

MarkdownFeedback
PreviousTags and flag discoveryNextEvaluation credentials

On this page

Local Node.js evaluationDirect server HTTP evaluationBrowser HTTP evaluationUse more than one approachDecision checklist

Choose an evaluation approach by trust boundary first, then latency, resilience, and freshness. Credentials bind to one project environment, so callers never select an environment per request.

ApproachCredentialDecision locationFreshnessBest fit
Node.js SDKruntime:snapshotApplication processETag polling, 30 seconds by defaultTrusted Node.js services
Server HTTPruntime:evaluateFeatureGate APICurrent hosted configurationNon-Node servers and central decisions
Browser HTTPclient:evaluateFeatureGate APICurrent exposed configurationPresentation flags in web clients

Local Node.js evaluation

Use the released @featuregate/node package for trusted Node.js applications. It loads the full environment snapshot, evaluates without a request-time network round trip, and refreshes in the background.

Advantages:

  • Low and predictable evaluation latency.
  • Continued evaluation from the last successful snapshot during refresh failure.
  • Local targeting context that never leaves the process.
  • Typed value and details getters.

Tradeoffs:

  • Configuration is bounded by polling freshness.
  • Startup needs an explicit initialization policy.
  • Every process owns its refresh lifecycle and error monitoring.
  • Snapshot keys expose all active server configuration in the environment.

Create one client per runtime key and reuse it. Do not create a client for each request.

Direct server HTTP evaluation

Use POST /v1/evaluate when the runtime cannot use the Node.js SDK or current hosted configuration is more important than in-process latency.

Batch decisions needed by one operation. Set a timeout shorter than the operation budget and use the request's typed defaults when the API cannot complete.

HTTP evaluation introduces a network dependency into the request path. It also gives FeatureGate privacy-safe hosted request and per-flag totals that local SDK evaluation cannot provide.

Browser HTTP evaluation

Use browser evaluation only with a Publishable client key with client:evaluate, exact allowed origins, and flags explicitly exposed in that environment.

Browser callers never receive snapshots or targeting rules. They send context to the hosted API and receive only resolved values for flags permitted by exposure checks.

Browser context is controlled by the user. It can shape presentation but cannot prove identity, authorization, billing entitlement, or permission to perform a sensitive operation.

Use more than one approach

One project can use different approaches at different trust boundaries. A server may evaluate locally while a web client uses the hosted endpoint for a small exposed subset.

Keep their keys separate even when they bind to the same environment. Review defaults independently: the safe browser experience may differ from the safe server behaviour.

Avoid evaluating the same consequential decision independently in browser and server code. Let the trusted server own enforcement and use the browser result for presentation only.

Decision checklist

Choose Node.js local evaluation when:

  • The application is trusted and uses supported Node.js.
  • Request-time network latency is undesirable.
  • Bounded configuration staleness is acceptable.
  • The process can initialize, monitor, refresh, and close a singleton client.

Choose server HTTP when:

  • The runtime is not supported by a released SDK.
  • Hosted freshness is required.
  • A bounded network dependency fits the operation.
  • Related flags can be batched.

Choose browser HTTP when:

  • The value is safe for any browser user to inspect.
  • The flag is explicitly client-exposed.
  • Exact allowed origins are maintainable.
  • Trusted server authorization remains separate.
Keep credential boundaries separate

Server runtime keys are secrets. Publishable client keys are safe to embed only because origin and exposure checks restrict their use. Neither credential can manage FeatureGate.

Continue with Evaluation credentials, Node.js SDK, or Evaluate over HTTP.