abhinav_kr
08/23/2025, 10:11 PMChiranjeet Mishra
08/23/2025, 10:12 PMChiranjeet Mishra
08/26/2025, 2:56 PMaxios or fetch).
- Use the created API key to connect your Next.js app with the Vapi API.
4. **Implement Workflow Requests**: In your application, make HTTP requests to the Vapi API endpoints to trigger workflows. Here's a basic example using `fetch`:
javascript
const fetchWorkflow = async (input) => {
const response = await fetch('https://api.vapi.ai/workflow', {
method: 'POST',
headers: {
'Authorization': `Bearer YOUR_API_KEY`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
input,
workflowId: 'your-workflow-id',
}),
});
const data = await response.json();
return data;
};
5. **Handle Responses**: Process the responses from Vapi to display information or take actions based on the workflow's output in your app.
6. **Testing**: Ensure to test with various scenarios to confirm that the integration behaves as expected.
By following the steps above, you can bridge your workflow and Next.js application effectively. For detailed setup and variable handling, refer to Vapi's [documentation](https://docs.vapi.ai/workflows/quickstart). Let us know if you need further help.