Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.relayer.fi/llms.txt

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

Widget Kit is a set of React components and adapters that let you embed blockchain interactions — swaps, transfers, cross-chain bridges — directly in React and Next.js apps. It is built on a self-custodial architecture: Relayer never holds your private keys. Transaction signing happens either through Relayer’s hosted passkey flow or through your own wallet stack, depending on which integration mode you choose.

Two Integration Modes

Widget Kit supports two integration modes. The mode is determined by your wallet stack, not the widget type — every widget works with both modes.
For integrators using Relayer’s managed wallet stack.In Passkey Signing, each integrator gets a dedicated wallet workspace with passkey-based signing. The widget handles the full signing flow internally:
  1. Widget sends the transaction to the Relayer API for preparation
  2. User sees a biometric prompt (Face ID, fingerprint, security key)
  3. The secure enclave signs the transaction using the user’s passkey
  4. Relayer API validates and broadcasts the signed transaction
Each integrator has their own isolated wallet workspace. Team members have individual passkeys. Policies define approval rules.For Embedder integrators, each end user gets their own wallet and passkey — the widget guides them through passkey registration and signing.

Self-Custodial Architecture

Relayer never holds your private keys. All transaction signing happens either through Relayer’s hosted passkey flow (Passkey Signing) or through your own wallet stack (Metadata Mode).

Passkey Signing Flow

Metadata Mode Flow

Supported Protocols

Widget Kit ships with first-party widgets for the canonical protocols Relayer supports. Custom widget metadata is not user-uploadable — every widget surface comes from this curated set.
WidgetWhat It Does
SwapToken-to-token swaps via smart routing
TransferNative and ERC20 token transfers
Crosschain TransferTransfer the same asset across networks
Crosschain BridgeBridge assets between supported chains
Each widget works with both Passkey Signing and Metadata Mode. The mode is determined by the integrator’s configuration, not the widget type.

Package Ecosystem

The Widget Kit is composed of three core packages:
PackagenpmDescriptionAudience
widget-kit-react@relayerfi/widget-kit-reactMain integration library. React components (Widget), wallet adapters, platform observers for Twitter/X, YouTube, and Twitch.App developers embedding widgets
widget-kit-core@relayerfi/widget-kit-coreFramework-agnostic runtime. Widget directory, metadata fetching, security classification. Consumed internally.Internal — no direct install needed
action-kit@relayerfi/action-kitShared type and validator contract used by widget-kit. Defines metadata schemas for the canonical protocols.Internal — no direct install needed
You only install @relayerfi/widget-kit-react directly. The other two packages are peer dependencies bundled internally.

The Widget Component

Widget is the main embedding surface. It accepts a URL pointing to canonical action metadata (or a pre-validated metadata object) and renders an interactive widget card. The component handles metadata fetching, schema validation, wallet connection, and transaction signing automatically — you provide a URL and a wallet adapter, and the Widget does the rest. In Passkey Signing, the Widget handles the passkey prompt automatically. In Metadata Mode, the Widget returns transaction metadata for the integrator to sign externally.

Platform Observers

The package ships observers for automatic widget detection and rendering on Twitter/X, YouTube, and Twitch. These observers scan the DOM for canonical action URLs and render Widget components inline. A browser extension built on the same primitives is also available. For custom embedding in your own app, use the Widget component directly.

Next Steps

Installation

Install and configure the widget packages.

Integration Guide

Embed and theme your first widget.

SDK Reference

The metadata schema for canonical protocols.