Skip to content

ephemeraHQ/xmtp-mini-app-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 

Mini-app standalone example

This combines a backend agent and a frontend mini app to resolve mentions in a group chat.

Image 1 Image 2

Usage

  1. Send a message in a group chat to the agent tagging other users.
hey @game, lets challenge @vitalik.eth @humanagent.eth and @0x...
  1. The agent will respond with a mini app link to the frontend.
http://mini-app-example.ngrok.io?tags=vitalik.eth,humanagent.eth,0x...
  1. The frontend will resolve the mentions and display the user profiles.
✅ vitalik.eth → 0x...
✅ humanagent.eth → 0x...
✅ 0x... → 0x...

Get started

Requirements

  • Node.js v20 or higher
  • Yarn v4 or higher
  • Docker (optional, for local network)

Run the agent

# git clone repo
git clone https://github.com/ephemeraHQ/xmtp-mini-app-example mini-app-example
# go to the folder
cd mini-app-example  
cd backend
# install packages
yarn
# run the agent
yarn start

Environment variables for the agent

To run your XMTP agent, you must create a .env file with the following variables:

XMTP_WALLET_KEY= # the private key of the wallet
XMTP_DB_ENCRYPTION_KEY= # encryption key for the local database
XMTP_ENV=dev # local, dev, production

Run the frontend

# git clone repo
git clone https://github.com/ephemeraHQ/xmtp-mini-app-example mini-app-example
# go to the folder
cd mini-app-example  
cd frontend
# install packages
yarn
# run the frontend
yarn dev

Environment variables for the frontend

To run your frontend, you must create a .env.local file with the following variables:

# Farcaster.json manifest generate yours at https://warpcast.com/~/developers/mini-apps/manifest
NEXT_PUBLIC_URL="http://localhost:3000"
NEXT_PUBLIC_FARCASTER_HEADER=""
NEXT_PUBLIC_FARCASTER_PAYLOAD=""
NEXT_PUBLIC_FARCASTER_SIGNATURE=""

NEXT_PUBLIC_APP_ENV="" 


NGROK_DOMAIN=""
NGROK_AUTHTOKEN=""

# Neynar API Key for username resolution
NEXT_PUBLIC_NEYNAR_API_KEY=

This example uses the Neynar API to resolve Farcaster usernames to Ethereum addresses.

About

xmtp-mini-app

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •