Skip to content

Commit

Permalink
updated neynar keys to env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-defi committed Aug 22, 2024
1 parent c5990d3 commit a5e38f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions apps/web/pages/api/basenames/frame/04_txSuccess.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { NextApiRequest, NextApiResponse } from 'next/dist/shared/lib/utils';
import { FrameRequest, getFrameMessage } from '@coinbase/onchainkit/frame';

import { txSuccessFrame } from 'apps/web/pages/api/basenames/frame/frameResponses';
import type { TxFrameStateType } from 'apps/web/pages/api/basenames/frame/tx';

const NEYNAR_API_KEY = process.env.NEXT_PUBLIC_NEYNAR_API_KEY

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== 'POST') {
return res.status(405).json({ error: `TxSuccess Screen — Method (${req.method}) Not Allowed` });
Expand All @@ -16,7 +17,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)

try {
const result = await getFrameMessage(body, {
neynarApiKey: 'BF56615F-9028-4774-9E8C-2745308382C1', // TODO DON"T HARDCODE THIS
neynarApiKey: NEYNAR_API_KEY,
});
isValid = result.isValid;
message = result.message;
Expand Down
3 changes: 2 additions & 1 deletion apps/web/pages/api/basenames/frame/tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type TxFrameStateType = {

const RESOLVER_ADDRESS = USERNAME_L2_RESOLVER_ADDRESSES[base.id];
const REGISTRAR_CONTROLLER_ADDRESS = USERNAME_REGISTRAR_CONTROLLER_ADDRESSES[base.id];
const NEYNAR_API_KEY = process.env.NEXT_PUBLIC_NEYNAR_API_KEY;

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== 'POST') {
Expand All @@ -40,7 +41,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)

try {
const result = await getFrameMessage(body, {
neynarApiKey: 'BF56615F-9028-4774-9E8C-2745308382C1', // TODO DON"T HARDCODE THIS
neynarApiKey: NEYNAR_API_KEY,
});
isValid = result.isValid;
message = result.message;
Expand Down

0 comments on commit a5e38f0

Please sign in to comment.