Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Getting started

Follow the setup instructions, then choose your host interface:

HostPackagePreparation
Rustsrc/eigin_sdk/crates/eigin_sdkAdd a Cargo path dependency
Swiftsrc/eigin_sdk/apple/EiginSDKjust generate sdk apple, then add the local Swift package
Browser@eigin/sdkjust generate sdk web, then import from the npm workspace

Initialize

Call initialization during application startup and handle errors in your host. In Swift:

import EiginSDK

func startSDK() async throws {
    try await EiginSDK.initialize()
}

In Rust, call eigin_sdk::initialize().await?. In the browser, import and await initialize() from @eigin/sdk.

Connect diagnostics

Register a receiver before SDK operations to send events to your application’s logs. For example, in a browser:

import { initialize, setDiagnosticReceiver, DiagnosticLevel } from "@eigin/sdk";

await setDiagnosticReceiver(
  { receive(event) { console.debug(event.component, event.message); } },
  { minimumLevel: DiagnosticLevel.Debug, includePrivate: false },
);
await initialize();

In Swift, use EiginSDK.Diagnostics.setReceiver; in Rust, use set_diagnostic_receiver.

Private field values are withheld unless you opt in. Keep callbacks short, never throw, and avoid SDK calls; native callbacks may arrive concurrently.