Reference

SDKs

On the browser side, the embed SDK is the official OKIAS client and is available today. Server-side client libraries are in active development and not published yet — until they ship, integrate by calling the REST API directly, which takes only a few lines.

The API is plain REST over HTTPS with JSON in and out, so you do not need a server SDK to be productive. A ~15-line wrapper gives you auth, idempotency and error handling.

Browser: the embed SDK (available today)

The official browser SDK is the embed SDK — a dependency-free ~4 KB script served from https://okias.io/embed/okias.js. It renders the hosted verification flow in an iframe on your own domain, bridges lifecycle events back to your code, and handles camera delegation and auto-sizing. No npm package, no build step:

embed.html
<script src="https://okias.io/embed/okias.js"></script>
<div id="kyc"></div>

<script>
  OkiasKYC.render({
    container: '#kyc',
    id: 'cms80k9ix001moea2jxy64fgu',            // verification id from your server
    onComplete: (r) => console.log(r.status),
  });
  // or as a modal: OkiasKYC.open({ id: 'cms80k9ix001moea2jxy64fgu', onComplete, onClose })
</script>

The full contract — render() vs the open() modal, every callback, window message events, permissions and the security model — is documented in Hosted flow & Embed SDK.

Server-side: planned libraries

Preview — not yet installable
The packages below are coming soon and are not published to npm, PyPI, Packagist or RubyGems yet. Do not add them to your dependencies — npm install @okias/node will not resolve today. Use the REST approach on this page meanwhile.

Typed clients that handle auth, idempotency and webhook signature verification are on the way:

Node / TypeScriptSoon
@okias/node
PythonSoon
okias
PHPSoon
okias/okias-php
RubySoon
okias
Want early access?
Email support@okias.io to be notified the moment the SDKs are published, or to join the preview.

REST-direct approach (available today)

This is the recommended integration until the SDKs ship — and it will keep working afterward. Set OKIAS_API_KEY in your environment and drop in one of these helpers.

// A tiny typed wrapper you can drop into any Node service today.
const OKIAS_BASE = "https://api.okias.io/v1";

export async function okias(path, { method = "GET", body, idempotencyKey } = {}) {
  const res = await fetch(OKIAS_BASE + path, {
    method,
    headers: {
      Authorization: `Bearer ${process.env.OKIAS_API_KEY}`,
      "Content-Type": "application/json",
      ...(idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {}),
    },
    body: body ? JSON.stringify(body) : undefined,
  });
  const json = await res.json();
  if (!res.ok) throw new Error(json?.error?.code ?? "REQUEST_FAILED");
  return json;
}

// Usage
const verification = await okias("/verifications", {
  method: "POST",
  idempotencyKey: crypto.randomUUID(),
  body: { level: ["FULL_KYC"], country: "pk", end_user_ref: "user_8842" },
});
  • Auth is a single Authorization: Bearer header — see Authentication.
  • Pass an Idempotency-Key on creates for safe retries.
  • Handle the { error: { code, message } } envelope — see Errors.
  • Verify webhook signatures yourself with the snippets in Webhooks.

Next steps