Skip to main content

Getting Started

Iframe URL

${WEB3KIT_ORIGIN}/oauth/<authToken>/web3-kit
  • WEB3KIT_ORIGIN — the deployed origin of the auth-central application (production / staging).
  • <authToken> — a single-use OAuth session token obtained from the auth-central backend. This is the same token used in the standard web flow (see Auth flow for how to obtain it).

Minimal embed

<iframe
src="https://auth.example.com/oauth/<authToken>/web3-kit"
title="web3-kit"
style="border:0; width:100%; height:100%"
></iframe>

As soon as the iframe mounts, it sends a WEB3_KIT_INIT message to window.parent. The host must subscribe to message events to receive it. See Protocol for the full message rules and Integration Example for a complete React snippet.

Required setup checklist

Before the iframe can drive authentication for your user, you need:

  1. A valid authToken from auth-central for the current OAuth session.
  2. A wallet connector on the host side (wagmi, web3modal, ethers, etc.) capable of:
    • returning the user's account address;
    • signing an arbitrary string (personal_sign or equivalent).
  3. A message event listener on window that:
    • filters inbound messages by event.origin === WEB3KIT_ORIGIN;
    • captures connectionId from WEB3_KIT_INIT;
    • routes subsequent messages by payload.connectionId.