Skip to main content
Dynamic provides two powerful ways to enhance your World Mini App:
  1. External Wallet Connection & Embedded Wallets
    • Connect users’ existing external wallets (like MetaMask, Rainbow, etc.)
    • Create new embedded wallets for users who don’t have one, using their email, phone number, OAuth, etc.
    • Manage multiple wallet connections seamlessly
  2. Sign-In with Ethereum (SIWE) for World ID Wallets
    • Implement secure authentication using World ID wallets
    • Enable users to interact with their World ID wallet
In this guide, we’ll implement both approaches and demonstrate how to create an integration that allows users to:
  • Create embedded wallets or connect external wallets
  • Sign in with their World ID wallet
  • Transfer funds between their Dynamic wallet and World ID wallet
  • Support multiple tokens (ETH, WLD, USDC)
You can find the complete source code for this guide in our GitHub repository.

Setup

Dynamic Environment Setup

  1. Navigate to the Dynamic Dashboard
  2. Copy your Environment ID from the SDK and API Keys section - you’ll need this to initialize Dynamic in your World Mini App

Create your app

If you don’t have a project yet, scaffold Next.js with create-next-app, then follow the React Quickstart Custom setup for Ethereum (EVM) with Wagmi and viem so DynamicContextProvider, Wagmi, and EthereumWalletConnectors match the providers in this guide (see the GitHub repository for a full layout).
Dashboard: Under Chains & Networks, enable Ethereum and any networks you use. Under Sign-in Methods and Wallets, enable the login methods, Embedded wallets, and external wallets as needed for World ID and Dynamic. Under SecurityAllowed Origins, add the origin where the app runs (for example http://localhost:3000).

Getting Started

1. Install Required Dependencies

First, install the necessary packages:

2. Set Up Project Structure

Create the following project structure:

3. Configure Environment Variables

Create a .env.local file with your credentials:

Implementation

1. SIWE Authentication Setup

First, let’s set up the authentication providers that will connect Dynamic’s SIWE functionality with Worldcoin’s wallet:
lib/providers.tsx
The providers setup includes:
  • Dynamic’s context provider for wallet management
  • Wagmi provider for Ethereum interactions
  • MiniKit provider for World ID wallet integration
  • Eruda for debugging in the World App environment

2. Create Utility Functions

Create the Dynamic API helper and other utility functions:
lib/utils.ts

3. Create SIWE Authentication Component

Create a new file components/WorldDynamicSIWE.tsx that integrates Worldcoin’s MiniKit with Dynamic’s SIWE flow:
app/components/WorldDynamicSIWE.tsx
In this file, we’re first generating a nonce for the user, then, we ask the user to sign in using their world ID wallet. Finally, we call the Dynamic API to verify the user’s signature and sign the user in. You can find the styles that I’ve used here.

4. Create Main App Page

Create the main page of your World Mini App:
app/page.tsx
Here, we’re checking if the user has the World ID Mini App installed, and if not, we’re showing a warning banner. We’re also showing the Dynamic Widget and the World Dynamic SIWE component.

5. Add Wallet Transfer Capabilities

Create the cross-wallet transfer component:
app/components/WalletTransfers.tsx
You also need to create a consts folder and add the ForwardABI to it. You can find the ABI here. Here, a couple of things are happening:
  • Firstly we have a pretty straight forward logic for handling the UI of which token to transfer from where to where.
  • To pay from a user’s dynamic wallet we’re using the sendTransaction method from the viem public client.
  • To pay USDC, and WLD from a user’s world ID wallet we’re using the pay method from the MiniKit. Check out the MiniKit documentation for more details.
  • We’re also using the ForwardABI to pay ETH from a user’s world ID wallet. Check out the Send Transaction MiniKit documentation for more details.
You can find the styles that I’ve used here.

Social Redirects Setup

World Mini Apps can integrate with Dynamic’s social authentication system to provide seamless OAuth redirects back to your mini app. This section covers how to configure social redirects to work with the World Mini App deeplink system.

Overview

When users authenticate with social providers (Google, Apple, Twitter, etc.) in your World Mini App, Dynamic handles the OAuth flow and redirects users back to your mini app using the World App’s deeplink system. The authentication flow works as follows:
  1. User initiates social login in your World Mini App
  2. The phone browser opens to show the social provider
  3. After successful authentication, the World App opens automatically
  4. The Dynamic SDK completes the authentication inside the World Mini App

Prerequisites

Before setting up social redirects, you need to:
  1. Enable social providers - Configure the social providers you want to use by following the Social Providers documentation
  2. Have a World Mini App ID - Get your app ID from the Worldcoin Developer Portal
For security, you must whitelist your World Mini App deeplink URLs in the Dynamic Dashboard:
  1. Go to Dynamic Dashboard Security
  2. Navigate to SecurityWhitelist Mobile Deeplink
  3. Enable “Whitelist Mobile Deeplink” and click “Save changes”
  4. Click the cog icon to open the Mobile Deeplink URL configuration
  5. Add your World Mini App deeplink URL: worldapp://mini-app?app_id=${YOUR_APP_ID}&*
  6. Save the configuration
Make sure to replace ${YOUR_APP_ID} with your actual World Mini App ID from the Worldcoin Developer Portal.

Configuring redirectUrl in DynamicContextProvider

Configure the redirectUrl property in your DynamicContextProvider with your mini app deeplink URL:
The redirectUrl should follow this format:
  • worldapp://mini-app - The World App deeplink scheme
  • app_id=${YOUR_APP_ID} - Your World Mini App ID from the developer portal
  • path=/auth/callback - The path within your mini app to handle the auth callback
For more information about the redirectUrl property, see the DynamicContextProvider documentation.

Example Implementation

For a complete working example of social redirects in a World Mini App, check out our World Mini App example repository on GitHub. This repository demonstrates the complete integration including social authentication setup and deeplink configuration.

Running Your World Mini App

To run your World Mini App with Worldcoin SIWE integration:
In the development environment, you can use Ngrok or cloudflared to expose your local server to the internet, allowing you to test the World Mini App in the World App. Head over to the Worldcoin Developer dashboard, create a new app and add your tunnel URL as the app URL. This will allow you to test your Dynamic-powered World Mini App in the World App. Make sure to add the Forward contract address to the app under configuration > Advanced > Contract Entrypoints. You can find the contract address here. Finally, you can open it in the World App by scanning the QR code or entering the URL directly.
Make sure to add your domain to next.config.js in allowedDevOrigins:
next.config.js

Resources

Last modified on April 4, 2026