Twitter mini-app for distributing POAPs using Sherry Social SDK. This app allows users to claim POAPs directly from Twitter by completing certain requirements like following an account and retweeting.
- Clone the repository:
git clone https://github.com/gotoalberto/poap-sherry.git
cd poap-sherry- Install dependencies:
npm install --legacy-peer-deps- Copy the configuration file:
cp .env.example .env- Configure environment variables in
.env:
# POAP API Configuration
POAP_CLIENT_ID=your_poap_client_id
POAP_CLIENT_SECRET=your_poap_client_secret
POAP_API_KEY=your_poap_api_key
POAP_EVENT_ID=191758
POAP_SECRET_CODE=902096
# Twitter API Configuration
TWITTER_BEARER_TOKEN=your_twitter_bearer_token
# Follow Gate Configuration
NEXT_PUBLIC_REQUIRED_FOLLOW_USERNAME=gotoalberto- Run the development server:
npm run devThe application will be available at http://localhost:3000
-
Install the Sherry Links extension:
- Go to Chrome Web Store
- Install the "Sherry Links" extension
-
Deploy your app:
- Deploy your app on Vercel, Netlify, or any hosting service
- Get the public URL (e.g.,
https://your-poap-app.vercel.app)
-
Generate the Sherry link programmatically:
Option A: Use the API endpoint
curl https://your-poap-app.vercel.app/api/sherry-link
Response:
{ "success": true, "sherryLink": "https://sherry.social/link?app=...", "directLink": "https://your-poap-app.vercel.app", "metadata": {...}, "instructions": { "withExtension": "Users with Sherry Links extension will see the mini-app embedded in the tweet", "withoutExtension": "Users without the extension will be redirected to the app" } }Option B: Generate custom links
curl -X POST https://your-poap-app.vercel.app/api/sherry-link \ -H "Content-Type: application/json" \ -d '{ "eventId": 191758, "eventName": "My Custom POAP", "imageUrl": "https://example.com/poap-image.png" }'
-
Share on Twitter:
- Create a new tweet
- Include the generated Sherry link
- Users with the Sherry extension will see your mini-app embedded directly in the tweet
-
Configure your app metadata:
- The app already includes the necessary metadata at
/api/metadata - Make sure your app is publicly accessible
- The app already includes the necessary metadata at
-
Share the link:
🎉 Claim your exclusive POAP! Follow these steps: 1. Install Sherry Links 2. Follow @gotoalberto 3. Retweet this post 4. Claim your POAP here: https://your-app.vercel.app #POAP #Web3
When Twitter officially enables mini-apps:
-
Configure Twitter Card metadata:
<meta name="twitter:card" content="app"> <meta name="twitter:app:url" content="https://your-app.vercel.app">
-
Register your app in Twitter Developer Portal
- User sees the tweet with the mini-app link
- With Sherry installed, the mini-app loads directly in the tweet
- Complete requirements:
- Follow the required account
- Retweet the post
- Connect wallet or enter address
- Claim the POAP
Modify in .env:
POAP_EVENT_ID=your_event_id
POAP_SECRET_CODE=your_secret_codeModify in .env:
NEXT_PUBLIC_REQUIRED_FOLLOW_USERNAME=your_usernameStyles are in the components using CSS-in-JS. Modify:
/src/components/POAPMinter.tsx/src/components/FollowGate.tsx/src/components/POAPSuccess.tsx
npm install -g vercel
vercelConfigure the same .env variables in your hosting service.
GET /api/sherry-link
Generates a Sherry link for the configured POAP event.
Response:
{
"success": true,
"sherryLink": "https://sherry.social/link?app=...",
"directLink": "https://your-app.vercel.app",
"metadata": {
"type": "action",
"url": "https://your-app.vercel.app",
"icon": "https://...",
"title": "Mint POAP",
"description": "Claim your commemorative POAP badge on Twitter",
"actions": [...]
}
}POST /api/sherry-link
Generates a Sherry link with custom parameters.
Request Body:
{
"eventId": 191758,
"eventName": "My Custom POAP",
"imageUrl": "https://example.com/poap-image.png"
}GET /api/poap-event
Returns information about the configured POAP event.
POST /api/poap-claim
Checks if a user has already claimed the POAP.
Request Body:
{
"userId": "twitter_user_id"
}- Users need to have the Sherry Links extension installed to see the embedded mini-app
- Without the extension, they'll see a normal link that takes them to the app
- The app works both embedded and standalone
- POAPs are minted on the Gnosis (xDai) blockchain
- The Sherry link API endpoint automatically generates the correct metadata for your POAP event
- You can generate custom links for different POAP events using the POST endpoint
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is under the MIT license.