Skip to content

Commit

Permalink
fix: remove old neynar api call (#1520)
Browse files Browse the repository at this point in the history
* fix: remove old neynar api call

* fix: add back neynar request with correct domain

* chore: use url from vercel env
  • Loading branch information
dominik-stumpf authored Oct 9, 2024
1 parent 025f70c commit 1e1ed88
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
NEXT_PUBLIC_API=https://api.guild.xyz/v1
NEXT_PUBLIC_URL=https://$NEXT_PUBLIC_VERCEL_URL
NEXT_PUBLIC_DISCORD_CLIENT_ID=868172385000509460
NEXT_PUBLIC_IPFS_GATEWAY=https://guild-xyz.mypinata.cloud/ipfs/
NEXT_PUBLIC_PINATA_API=https://api.pinata.cloud
Expand All @@ -10,4 +11,4 @@ NEXT_PUBLIC_POSTHOG_KEY=phc_Pu6Xv72B95fHVTAKT5Xs2FPgNxrsNP4LecBqPiVAAxi
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=d851f25304d67fc8e2dd3b354223e4fa
NEXT_PUBLIC_EDGE_CONFIG_ID=ecfg_buc5l6124c4koymyvseasbd1k3hs
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=6LcQm4onAAAAAOcoqkw9A5txg5SbuddONchMZKrF
NEXT_PUBLIC_BUGSNAG_KEY=4bd5799ac2cb4a34887513b80b845554
NEXT_PUBLIC_BUGSNAG_KEY=4bd5799ac2cb4a34887513b80b845554
8 changes: 6 additions & 2 deletions src/app/(marketing)/profile/[username]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ const fetchPublicProfileData = async ({
)
const fcProfile = farcasterProfiles.at(0)
const neynarRequest =
fcProfile && new URL(`${NEYNAR_BASE_URL}/user/bulk?fids=${fcProfile.fid}`)
fcProfile &&
new URL(
`${NEYNAR_BASE_URL}/user/bulk?fids=${fcProfile.fid}`,
env.NEXT_PUBLIC_URL
)
const fcFollowers =
neynarRequest &&
(await ssrFetcher(neynarRequest, {
Expand Down Expand Up @@ -202,7 +206,7 @@ const fetchPublicProfileData = async ({
[profileRequest.pathname, profile],
[contributionsRequest.pathname, contributions],
[farcasterProfilesRequest.pathname, farcasterProfiles],
[neynarRequest?.href, fcFollowers],
[neynarRequest?.pathname, fcFollowers],
[referredUsersRequest.pathname, referredUsers],
[experiencesRequest.pathname, experiences],
[
Expand Down
5 changes: 5 additions & 0 deletions src/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const env = createEnv({
// Guild APIs
NEXT_PUBLIC_API: z.string(),
NEXT_PUBLIC_BALANCY_API: z.string(),
NEXT_PUBLIC_URL: z.string(),

// Captcha
NEXT_PUBLIC_RECAPTCHA_SITE_KEY: z.string(),
Expand All @@ -51,6 +52,10 @@ export const env = createEnv({
},
runtimeEnv: {
NEXT_PUBLIC_API: process.env.NEXT_PUBLIC_API,
NEXT_PUBLIC_URL:
process.env.NODE_ENV === "production"
? process.env.NEXT_PUBLIC_URL
: "http://127.0.0.1:3000",
NEXT_PUBLIC_BALANCY_API: process.env.NEXT_PUBLIC_BALANCY_API,

NEXT_PUBLIC_RECAPTCHA_SITE_KEY: process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY,
Expand Down

0 comments on commit 1e1ed88

Please sign in to comment.