#API-key-only access in Next.js SSG builds

3 messages ยท Page 1 of 1 (latest)

rare fiber
#

Hey guys ๐Ÿ™‹โ€โ™‚๏ธ What's the best practice for restricting collection access to API key only?

Use case: Next.js app with SSG, need to:

  • Block public access to collections
  • Allow access only via API key during Vercel builds
  • Using getPayload() in server components for SSG

Using: PayloadCMS 3.25.0, Next.js 15, TS

summer kilnBOT
rare fiber