Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding property allowFramegear conditionally #18

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/api/frame/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ import { NEXT_PUBLIC_URL } from '../../config';

async function getResponse(req: NextRequest): Promise<NextResponse> {
const body: FrameRequest = await req.json();
const { isValid, message } = await getFrameMessage(body, { neynarApiKey: 'NEYNAR_ONCHAIN_KIT' });
const allowFramegear = process.env.NODE_ENV !== 'production';
// Remember to replace 'NEYNAR_ONCHAIN_KIT' with your own Neynar API key
const { isValid, message } = await getFrameMessage(body, {
neynarApiKey: 'NEYNAR_ONCHAIN_KIT',
allowFramegear,
});

if (!isValid) {
return new NextResponse('Message not valid', { status: 500 });
Expand Down
6 changes: 5 additions & 1 deletion app/api/tx/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import type { FrameTransactionResponse } from '@coinbase/onchainkit/frame';

async function getResponse(req: NextRequest): Promise<NextResponse | Response> {
const body: FrameRequest = await req.json();
const allowFramegear = process.env.NODE_ENV !== 'production';
// Remember to replace 'NEYNAR_ONCHAIN_KIT' with your own Neynar API key
const { isValid } = await getFrameMessage(body, { neynarApiKey: 'NEYNAR_ONCHAIN_KIT' });
const { isValid } = await getFrameMessage(body, {
neynarApiKey: 'NEYNAR_ONCHAIN_KIT',
allowFramegear,
});

if (!isValid) {
return new NextResponse('Message not valid', { status: 500 });
Expand Down