Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.moca.network/llms.txt

Use this file to discover all available pages before exploring further.

AIR Kit creates an iframe that loads the login flow and sets up communication streams between the iframe and the DApp’s JavaScript context.
import { AirService, BUILD_ENV } from "@mocanetwork/airkit";

const airService = new AirService({
  partnerId: YOUR_PARTNER_ID // Replace with your actual Partner ID
});
await airService.init({
  buildEnv: BUILD_ENV.SANDBOX,
  enableLogging: true,
  preloadWallet: true, // Optional: Enable if wallet features will be used
  preloadCredential: true, // Optional: Enable if credential features will be used
  sessionConfig: {
    locale: "en", // Optional: Language code (e.g. "en", "es", ...)
    currency: "USD" // Optional: Display currency (e.g. "EUR", "USD", ...)
  }
});

// Without any parameters, this will trigger the default Air login dialog which provides different login methods for the user to choose from.
await airService.login();
Once the SDK is installed and AirService is successfully initialized, it can be used to authenticate users.