Implementation

vf-to-ubf Module

This module is responsible for converting any Voiceflow (.vf) file to its respective representation in the Universal Bot Format. It is written as an independent and self-contained npm package.

Go to the npm package page here.

Schema Validation

We must guarantee that we interpret the Voiceflow format correctly. That is, if anything in the format changes - even a seemingly innocent extra metadata key - we must not proceed with that input until the conversion software is updated to work with the new format. This way we can guarantee that if the package does not throw an exception, its input has been interpreted correctly.

We achieve this by defining a JSON Schema for the Voiceflow format. This way, we can guarantee that if the input matches the schema, then it must be supported, by definition.

Usage Example

import {voiceflowToBotFormat} from 'vf-to-ubf';
var fs = require('fs');

diagram = fs.readFileSync("./VoiceflowFile.vf")

universal_format = voiceflowToBotFormat(diagram)

Use This In Your Project!

This is a public, open source, and completely independent and self-contained piece of software! Use it for what it is in any open source project.

In fact, since it’s been published, the package has been receiving roughly 200 weekly downloads, or 600 by the time of writing.