@zapier/ai-actions
library with Next.js.
The examples here are using the Next.js app router.
For storage, these examples are using Vercel KV but any other form of server-side storage can be used.
It’s assumed that your Next.js app also has authentication set up, using a library such as NextAuth.js.
.env
file:
NEXT_PUBLIC_
prefix ensures that they can be referenced client-side.
NEXT_PUBLIC_ZAPIER_AI_ACTIONS_OAUTH_REDIRECT_URI
that will handle the OAuth flow.
AiActions
clientAiActions
client that can be used to make API calls.
It can also be passed to the AiActionsProvider
if you’re using the @zapier/ai-actions-react
library.
refresh_token
for the OAuth token doesn’t leave the
server