0 reply
0 recast
0 reaction

Mini-app devs, I don't know if anyone will find this useful but if you want a neat way to do your mini-app manifest, please take my work (I ♥ CC-BY-SA!)
This is the source of my Next projcect's root/src/app/.well-known/farcaster.json/route.ts below:
import { NextResponse } from 'next/server'
import { farcaster } from '../../../lib/site'
export const runtime = 'edge'
export async function GET() {
return NextResponse.json(farcaster, {
headers: { 'Content-Type': 'application/json' }
})
}
This is the snippet for { farcaster } from site.ts, whereas siteConfig is populated from process environment variables (NEXT_PUBLIC_YAP...)
farcaster: {
accountAssociation: siteConfig.farcaster,
frame: {
version: '1',
name: siteConfig . name,
subtitle: siteConfig.subtitle,
tagline: `${siteConfig . name}: ${siteConfig.subtitle}`,
ogTitle: `${siteConfig . name}: ${siteConfig.subtitle}`,
tags: siteConfig.tags,
description: siteConfig.description,
canonicalDomain: siteConfig.domain,
primaryCategory: siteConfig.category,
homeUrl: baseUrl,
webhookUrl: `${baseUrl}/webhook`,
castShareUrl: `${baseUrl}/share`,
requiredChains: ['eip155:8453'],
iconUrl: icons[0].src,
ogImageUrl: assetUrl('1280x630.png'),
heroImageUrl: assetUrl(`${siteConfig.heroSize}.webp`),
screenshotUrls: screenshots,
splashImageUrl: assetUrl('200.png'),
splashBackgroundColor: siteConfig.themeColor,
},
}, 0 reply
0 recast
1 reaction