mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-16 08:08:56 -05:00
fix: use free api
This commit is contained in:
parent
796de2eef0
commit
21e0c06e42
23
bin/init.js
23
bin/init.js
@ -77,11 +77,13 @@ async function lookupFidByCustodyAddress(custodyAddress, apiKey) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (!data.user?.fid) {
|
console.log('got address data:');
|
||||||
|
console.log(data);
|
||||||
|
if (!data[custodyAddress]?.length && !data[custodyAddress][0].custody_address) {
|
||||||
throw new Error('No FID found for this custody address');
|
throw new Error('No FID found for this custody address');
|
||||||
}
|
}
|
||||||
|
|
||||||
return data.user.fid;
|
return data[custodyAddress][0].fid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export the main CLI function for programmatic use
|
// Export the main CLI function for programmatic use
|
||||||
@ -130,7 +132,13 @@ export async function init() {
|
|||||||
default: true
|
default: true
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
neynarApiKey = useDemoKey.useDemo ? 'FARCASTER_V2_FRAMES_DEMO' : null;
|
|
||||||
|
if (useDemoKey.useDemo) {
|
||||||
|
console.warn('\n⚠️ Note: the demo key is for development purposes only and is aggressively rate limited.');
|
||||||
|
console.log('For production, please sign up for a Neynar account at https://neynar.com/ and configure the API key in your .env or .env.local file with NEYNAR_API_KEY.');
|
||||||
|
console.log('Neynar now has a free tier! See https://neynar.com/#pricing for details.');
|
||||||
|
neynarApiKey = 'FARCASTER_V2_FRAMES_DEMO';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!neynarApiKey) {
|
if (!neynarApiKey) {
|
||||||
@ -195,13 +203,8 @@ export async function init() {
|
|||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
name: 'description',
|
name: 'description',
|
||||||
message: 'Give a one-line description of your frame:',
|
message: 'Give a one-line description of your frame (optional):',
|
||||||
validate: (input) => {
|
default: 'A Farcaster mini-app created with @neynar/create-farcaster-mini-app'
|
||||||
if (input.trim() === '') {
|
|
||||||
return 'Description cannot be empty';
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'input',
|
type: 'input',
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@neynar/create-farcaster-mini-app",
|
"name": "@neynar/create-farcaster-mini-app",
|
||||||
"version": "1.2.7",
|
"version": "1.2.8",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": false,
|
"private": false,
|
||||||
"access": "public",
|
"access": "public",
|
||||||
@ -34,8 +34,7 @@
|
|||||||
"deploy:vercel": "node scripts/deploy.js"
|
"deploy:vercel": "node scripts/deploy.js"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"@neynar/create-farcaster-mini-app": "./bin/index.js",
|
"@neynar/create-farcaster-mini-app": "./bin/index.js"
|
||||||
"create-farcaster-mini-app": "./bin/index.js"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.4.7",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user