mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-12-12 04:12:34 -05:00
feat: auto-generate manifest
This commit is contained in:
@@ -1,17 +1,24 @@
|
||||
import { readFileSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
export async function GET() {
|
||||
const appUrl = process.env.NEXT_PUBLIC_URL;
|
||||
|
||||
let accountAssociation; // TODO: add type
|
||||
try {
|
||||
const manifestPath = join(process.cwd(), 'public/manifest.json');
|
||||
const manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));
|
||||
accountAssociation = manifest;
|
||||
} catch (error) {
|
||||
console.warn('Warning: manifest.json not found or invalid. Frame will not be associated with an account.');
|
||||
accountAssociation = null;
|
||||
}
|
||||
|
||||
const config = {
|
||||
accountAssociation: {
|
||||
header:
|
||||
"eyJmaWQiOjM2MjEsInR5cGUiOiJjdXN0b2R5Iiwia2V5IjoiMHgyY2Q4NWEwOTMyNjFmNTkyNzA4MDRBNkVBNjk3Q2VBNENlQkVjYWZFIn0",
|
||||
payload: "eyJkb21haW4iOiJmcmFtZXMtdjIudmVyY2VsLmFwcCJ9",
|
||||
signature:
|
||||
"MHhiNDIwMzQ1MGZkNzgzYTExZjRiOTllZTFlYjA3NmMwOTdjM2JkOTY1NGM2ODZjYjkyZTAyMzk2Y2Q0YjU2MWY1MjY5NjI5ZGQ5NTliYjU0YzEwOGI4OGVmNjdjMTVlZTdjZDc2YTRiMGU5NzkzNzA3YzkxYzFkOWFjNTg0YmQzNjFi",
|
||||
},
|
||||
...(accountAssociation && { accountAssociation }),
|
||||
frame: {
|
||||
version: "1",
|
||||
name: "Frames v2 Demo",
|
||||
name: process.env.NEXT_PUBLIC_FRAME_NAME || "Frames v2 Demo",
|
||||
iconUrl: `${appUrl}/icon.png`,
|
||||
homeUrl: appUrl,
|
||||
imageUrl: `${appUrl}/frames/hello/opengraph-image`,
|
||||
|
||||
Reference in New Issue
Block a user