Skip to main content

Split.io feature flags

Community-contributed integration

This integration is community-maintained. Reference: ory/integrates/feature-flags/split-io.

Split.io (now Harness) is a feature delivery platform that combines feature flags with metric-driven impact measurement. This integration passes Ory identity attributes to the Split.io SDK so feature rollouts can target by identity.

How it works

This isn't a webhook integration. Evaluation happens in your application code through the Split SDK. The pattern matches the LaunchDarkly integration.

const session = await ory.sessions.toSession()
const identity = session.data.identity

const attributes = {
email: identity.traits.email,
org_id: identity.metadata_public?.org_id,
tier: identity.metadata_public?.subscription_tier,
}

const treatment = splitClient.getTreatment(identity.id, "my-feature", attributes)

What to pass to Split

Ory sourceSplit attribute
identity.idkey — stable bucketing
identity.traits.emailemail
metadata_public.org_idorg_id
metadata_public.subscription_tiertier
metadata_public.groupsgroups

Notable

  • Pass stable identifiers as key. Use identity.id, not email.
  • Use the Split server SDK on the server side, and the Split JavaScript SDK with the Track API on the client side.

Resources