All Pipeline Nodes support Vercel Edge Functions out of the box 🎉
You can define them manually and invoke them as usual or use the built-in helpers.
Aigur Vercel Helpers
Aigur Client has built-in helpers for invoking Pipeline on Vercel Edge Functions.
Define Your Pipeline Repository
Create an object that holds references to your Pipelines where the key is their id.
Generic Vercel Edge Function
Next, create a generic Vercel Edge Function that will invoke the Pipeline based on the request path. You can now invoke any Pipeline and it will automatically run on Vercel Edge Functions (see below how).
The Generic Edge Function must be defined at /api/pipelines/[id].ts
Invoke the Pipeline
We use the vercel.invoke
helper function to invoke the Pipeline. Behind the scenes it will access our generic Edge Function, invoke the Pipeline and return the result.
For streaming using the vercel.invokeStream
helper function:
Define Your Edge Function Manually
If you don't want to use the helper function, you can define your Pipeline Edge Functions manually: