mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-18 17:09:47 -05:00
feat: add primary category and tags
This commit is contained in:
@@ -161,6 +161,8 @@ async function generateFarcasterMetadata(domain, fid, accountAddress, seedPhrase
|
||||
});
|
||||
const encodedSignature = Buffer.from(signature, 'utf-8').toString('base64url');
|
||||
|
||||
const tags = process.env.NEXT_PUBLIC_FRAME_TAGS?.split(',');
|
||||
|
||||
return {
|
||||
accountAssociation: {
|
||||
header: encodedHeader,
|
||||
@@ -177,6 +179,9 @@ async function generateFarcasterMetadata(domain, fid, accountAddress, seedPhrase
|
||||
splashImageUrl: `https://${domain}/splash.png`,
|
||||
splashBackgroundColor: "#f7f7f7",
|
||||
webhookUrl,
|
||||
description: process.env.NEXT_PUBLIC_FRAME_DESCRIPTION,
|
||||
primaryCategory: process.env.NEXT_PUBLIC_FRAME_PRIMARY_CATEGORY,
|
||||
tags,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -346,6 +351,8 @@ async function main() {
|
||||
// Frame metadata
|
||||
`NEXT_PUBLIC_FRAME_NAME="${frameName}"`,
|
||||
`NEXT_PUBLIC_FRAME_DESCRIPTION="${process.env.NEXT_PUBLIC_FRAME_DESCRIPTION || ''}"`,
|
||||
`NEXT_PUBLIC_FRAME_PRIMARY_CATEGORY="${process.env.NEXT_PUBLIC_FRAME_PRIMARY_CATEGORY || ''}"`,
|
||||
`NEXT_PUBLIC_FRAME_TAGS="${process.env.NEXT_PUBLIC_FRAME_TAGS || ''}"`,
|
||||
`NEXT_PUBLIC_FRAME_BUTTON_TEXT="${buttonText}"`,
|
||||
|
||||
// Neynar configuration (if it exists in current env)
|
||||
|
||||
@@ -72,6 +72,8 @@ async function generateFarcasterMetadata(domain, fid, accountAddress, seedPhrase
|
||||
});
|
||||
const encodedSignature = Buffer.from(signature, 'utf-8').toString('base64url');
|
||||
|
||||
const tags = process.env.NEXT_PUBLIC_FRAME_TAGS?.split(',');
|
||||
|
||||
return {
|
||||
accountAssociation: {
|
||||
header: encodedHeader,
|
||||
@@ -80,14 +82,17 @@ async function generateFarcasterMetadata(domain, fid, accountAddress, seedPhrase
|
||||
},
|
||||
frame: {
|
||||
version: "1",
|
||||
name: process.env.NEXT_PUBLIC_FRAME_NAME?.trim(),
|
||||
name: process.env.NEXT_PUBLIC_FRAME_NAME,
|
||||
iconUrl: `https://${trimmedDomain}/icon.png`,
|
||||
homeUrl: `https://${trimmedDomain}`,
|
||||
imageUrl: `https://${trimmedDomain}/api/opengraph-image`,
|
||||
buttonTitle: process.env.NEXT_PUBLIC_FRAME_BUTTON_TEXT?.trim(),
|
||||
buttonTitle: process.env.NEXT_PUBLIC_FRAME_BUTTON_TEXT,
|
||||
splashImageUrl: `https://${trimmedDomain}/splash.png`,
|
||||
splashBackgroundColor: "#f7f7f7",
|
||||
webhookUrl: webhookUrl?.trim(),
|
||||
description: process.env.NEXT_PUBLIC_FRAME_DESCRIPTION,
|
||||
primaryCategory: process.env.NEXT_PUBLIC_FRAME_PRIMARY_CATEGORY,
|
||||
tags,
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -113,6 +118,8 @@ async function loadEnvLocal() {
|
||||
'SEED_PHRASE',
|
||||
'NEXT_PUBLIC_FRAME_NAME',
|
||||
'NEXT_PUBLIC_FRAME_DESCRIPTION',
|
||||
'NEXT_PUBLIC_FRAME_PRIMARY_CATEGORY',
|
||||
'NEXT_PUBLIC_FRAME_TAGS',
|
||||
'NEXT_PUBLIC_FRAME_BUTTON_TEXT',
|
||||
'NEYNAR_API_KEY',
|
||||
'NEYNAR_CLIENT_ID'
|
||||
|
||||
@@ -101,7 +101,7 @@ async function startDev() {
|
||||
1. Open the localtunnel URL in your browser: ${tunnel.url}
|
||||
2. Enter your IP address in the password field${ip ? `: ${ip}` : ''} (note that this IP may be incorrect if you are using a VPN)
|
||||
3. Click "Click to Submit" -- your mini app should now load in the browser
|
||||
4. Navigate to the Warpcast Mini App Developer Tools: https://warpcast.com/~/developers/mini-apps
|
||||
4. Navigate to the Warpcast Mini App Developer Tools: https://warpcast.com/~/developers
|
||||
5. Enter your mini app URL: ${tunnel.url}
|
||||
6. Click "Preview" to launch your mini app within Warpcast (note that it may take ~10 seconds to load)
|
||||
|
||||
@@ -120,7 +120,7 @@ async function startDev() {
|
||||
frameUrl = 'http://localhost:3000';
|
||||
console.log(`
|
||||
💻 To test your mini app:
|
||||
1. Open the Warpcast Mini App Developer Tools: https://warpcast.com/~/developers/mini-apps
|
||||
1. Open the Warpcast Mini App Developer Tools: https://warpcast.com/~/developers
|
||||
2. Scroll down to the "Preview Mini App" tool
|
||||
3. Enter this URL: ${frameUrl}
|
||||
4. Click "Preview" to test your mini app (note that it may take ~5 seconds to load the first time)
|
||||
|
||||
Reference in New Issue
Block a user