import { Typeform } from "@trigger.dev/typeform";//create Typeform client using a person access tokenconst typeform = new Typeform({ id: "typeform-1", token: process.env.TYPEFORM_PAT!,});
The Typeform Integration allows you to trigger a job run when a new form response is submitted using the onFormResponse trigger:
import { client } from "@/trigger";import { Typeform } from "@trigger.dev/typeform";import { Job } from "@trigger.dev/sdk";export const typeform = new Typeform({ id: "typeform-1", token: process.env.TYPEFORM_API_KEY!,});client.defineJob({ id: "do-something-on-new-responses", name: "Send a message to slack on new responses", version: "0.1.1", trigger: typeform.onFormResponse({ uid: "<form id>", tag: "your-tag-here", }), run: async (payload, io, ctx) => {},});
To find your Form ID, visit your Typeform dashboard and find the form you’d like to use. Click on the “Share” navigation link and you’ll find your Form ID in the share URL:
The tag parameter is a unique name you want to use for the webhook, and maps 1-to-1 with a single webhook source. Changing the tag will cause another webhook to be registered with Typeform. You can make use of the same tag value in multiple job triggers.