mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-11-21 18:28:00 -05:00
make seed phrase optional
This commit is contained in:
18
src/lib/neynar.ts
Normal file
18
src/lib/neynar.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { NeynarAPIClient } from '@neynar/nodejs-sdk';
|
||||
|
||||
let neynarClient: NeynarAPIClient | null = null;
|
||||
|
||||
export function getNeynarClient() {
|
||||
if (!neynarClient) {
|
||||
const apiKey = process.env.NEYNAR_API_KEY;
|
||||
if (!apiKey) {
|
||||
throw new Error('NEYNAR_API_KEY not configured');
|
||||
}
|
||||
neynarClient = new NeynarAPIClient(apiKey);
|
||||
}
|
||||
return neynarClient;
|
||||
}
|
||||
|
||||
// Example usage:
|
||||
// const client = getNeynarClient();
|
||||
// const user = await client.lookupUserByFid(fid);
|
||||
Reference in New Issue
Block a user