DocsSDKSDK Overview

SDK Overview

Koryla ships adapters for every major framework. Pick your stack and follow the guide — each one is a 5-minute setup.

Two approaches

Edge / MiddlewareComponent SDK
What it testsEntire pages (/ vs /variant-b)Specific components within a page
HowIntercepts the request before your app renders — URL rewrite, no redirectgetVariant() in server code, conditionally render the matching component
Code changesNone in your pagesAdd getVariant() call + conditional render
FlickerZeroZero
Client JSNoneNone

Both approaches are fully server-side. The browser never sees the experiment logic.

Choose your framework

How variant assignment works

  1. Config fetchgetVariant() calls GET /api/worker/config with your API key. Response is cached in memory for 60 seconds (one network call per minute per process).
  2. Cookie check — reads ky_{experimentId} from the request cookies. If present and valid → return the same variant (sticky session).
  3. Weighted assignment — if no cookie, randomly assigns a variant using the traffic_weight values from your dashboard.
  4. Render — your page code renders the correct variant. Cookie setting is the caller's responsibility.

Finding your experiment ID

Go to Dashboard → Experiments → click your experiment. The ID is in the URL: /dashboard/my-workspace/experiments/abc-123

Variant IDs are shown in the Variants tab of each experiment.