Add fal.ai to your Next.js app
You will learn how to:
- Connect a Next.js app deployed on Vercel to fal.ai
Prerequisites
- A fal.ai account
- A Vercel account
- A Next.js app. Check the Next.js guide if you don’t have one yet.
- App deployed on Vercel. Run
npx vercel
in your app directory to deploy it in case you haven’t done it yet.
Vercel official integration
The recommended way to add fal.ai to your app deployed on Vercel is to use the official integration. You can find it in the Vercel marketplace.
Click on Add integration and follow the steps. After you’re done, re-deploy your app and you’re good to go!
Manual setup
You can also manually add fal credentials to your Vercel environment manually.
- Go to your fal.ai dashboard, create an API-scoped key and copy it. Make sure you create an alias do identify which app is using it.
- Go to your app settings in Vercel and add a new environment variable called
FAL_KEY
with the value of the key you just copied. You can choose other names, but keep in mind that the default convention of fal-provided libraries isFAL_KEY
. - Re-deploy your app and you’re good to go!