mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-12-06 09:22:32 -05:00
Merge branch 'main' into shreyas-formatting
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { type ClassValue, clsx } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
import { type Manifest } from '@farcaster/miniapp-node';
|
||||
import {
|
||||
APP_BUTTON_TEXT,
|
||||
APP_DESCRIPTION,
|
||||
@@ -8,35 +9,12 @@ import {
|
||||
APP_OG_IMAGE_URL,
|
||||
APP_PRIMARY_CATEGORY,
|
||||
APP_SPLASH_BACKGROUND_COLOR,
|
||||
APP_SPLASH_URL,
|
||||
APP_TAGS,
|
||||
APP_URL,
|
||||
APP_WEBHOOK_URL,
|
||||
APP_ACCOUNT_ASSOCIATION,
|
||||
} from './constants';
|
||||
import { APP_SPLASH_URL } from './constants';
|
||||
|
||||
interface MiniAppMetadata {
|
||||
version: string;
|
||||
name: string;
|
||||
iconUrl: string;
|
||||
homeUrl: string;
|
||||
imageUrl?: string;
|
||||
buttonTitle?: string;
|
||||
splashImageUrl?: string;
|
||||
splashBackgroundColor?: string;
|
||||
webhookUrl?: string;
|
||||
description?: string;
|
||||
primaryCategory?: string;
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
interface MiniAppManifest {
|
||||
accountAssociation?: {
|
||||
header: string;
|
||||
payload: string;
|
||||
signature: string;
|
||||
};
|
||||
frame: MiniAppMetadata;
|
||||
}
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
@@ -63,31 +41,10 @@ export function getMiniAppEmbedMetadata(ogImageUrl?: string) {
|
||||
};
|
||||
}
|
||||
|
||||
export async function getFarcasterMetadata(): Promise<MiniAppManifest> {
|
||||
// First check for MINI_APP_METADATA in .env and use that if it exists
|
||||
if (process.env.MINI_APP_METADATA) {
|
||||
try {
|
||||
const metadata = JSON.parse(process.env.MINI_APP_METADATA);
|
||||
return metadata;
|
||||
} catch (error) {
|
||||
console.warn(
|
||||
'Failed to parse MINI_APP_METADATA from environment:',
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (!APP_URL) {
|
||||
throw new Error('NEXT_PUBLIC_URL not configured');
|
||||
}
|
||||
|
||||
export async function getFarcasterDomainManifest(): Promise<Manifest> {
|
||||
return {
|
||||
accountAssociation: {
|
||||
header: '',
|
||||
payload: '',
|
||||
signature: '',
|
||||
},
|
||||
frame: {
|
||||
accountAssociation: APP_ACCOUNT_ASSOCIATION,
|
||||
miniapp: {
|
||||
version: '1',
|
||||
name: APP_NAME ?? 'Neynar Starter Kit',
|
||||
iconUrl: APP_ICON_URL,
|
||||
|
||||
Reference in New Issue
Block a user