1.0.3-alpha • Published 6 years ago
@ubdi/typeform-webhook-parser v1.0.3-alpha
Typeform Webhook Parser
Simple helper that parses the response from Typeform into a one that's easier to work with.
Installation
yarn add @ubdi/typeform-webhook-parser
Usage
import { parseResponse } = require('@ubdi/typeform-webhook-parser')
...
server.use('/webhook', (req: Request) => {
const result = parseResponse(req.body)
})
result
will be an object with the following interface:
interface ParsedResponse {
formId: string;
hidden?: {
[key: string]: string;
};
answers: { question: string; answer: ParsedAnswer }[];
}