Skip to main content
The Layerswap Widget is compatible with modern React frameworks. Each framework requires specific configurations to handle Node.js polyfills and package transpilation.

Framework Configurations

Next.js (App Router & Page Router)

Next.js requires package transpilation and webpack configuration.
next.config.ts

View Example

Next.js App Router Example

Vite

Vite requires Node.js polyfills for browser compatibility. Install polyfill plugin:
Configuration:
vite.config.ts

View Example

Vite Example

React Router 7

React Router 7 requires global polyfills, SSR configuration, and dependency optimization. Install dependencies:
Global polyfills in root:
app/root.tsx
Vite configuration:
vite.config.ts

View Example

React Router 7 Example

Wallet Library Integrations

The widget is compatible with popular wallet connection libraries:

All Examples

All examples include working implementations with proper TypeScript configurations.