This repository is a companion project to the Twilio AI Annotator Integration Guide.
It scaffolds two basic types of integration:
- Embedded Annotator: This demonstrates how you might embed the annotator into your webapp via iframe.
- Standalone Annotator: This is another basic integration that redirects the user into a new window for to complete their annotation task.
This project uses the dotenv
library to load environment variables. It expects a .env
to be populated with relevant credentials at the root of the repository directory. A sample to be filled out has been provided at .env.sample
.
- Login to your Twilio Account and access your account credentials.
- Get your EIP Service Sid from the Twilio Console or your relevant contact at Twilio.
- Copy the
.env.sample
to.env
- Open and edit the file with the values above.
# Clone the repository
git clone https://github.com/jtgi/annotator-integration-demo
# Go inside the directory
cd annotator-integration-demo
# Install dependencies
yarn install (or npm install)
# Start development server
yarn start (or npm start)
To view the embedded implementation:
http://localhost:8080/annotator/embedded
To view the standalone implementation:
http://localhost:8080/annotator/standalone
This demo illustrates the 3 key actions required to initialize the Annotator:
- Acquire a Transcript Sid
- Acquire a one time token
- Use the one time token to initialize the Annotator
The high level sequence of operations for redirecting a to the standalone editor:
- Authenticate the agent per you authentication system.
- Convert the call sid passed to a transcript sid
- Ensure the transcription has been
completed
- Mark the Transcript as being annotated.
- Generate a one time token
- Redirect the client to the Annotator url with token appended
The high level sequence of operations for embedding the Annotator are as follows:
- Authenticate the agent per your authentication system.
- Convert the call sid passed to a transcript sid
- Ensure the transcription has been
completed
- Mark the Transcript as being annotated.
- Generate a one time token
- Render the web application with an Annotator embedded iframe