This repository is a companion project to the Twilio AI Search Integration Guide.
It scaffolds two basic types of integration:
- Embedded Search: This demonstrates how you might embed the search into your webapp via iframe.
- Standalone Search: This is another basic integration that redirects the user into a new window for search in a specific service.
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/epardosanllorente/search-integration-demo
# Go inside the directory
cd search-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/search/embedded
List all services to load embedded implementation of search:
http://localhost:8080/services/embedded
To view the standalone implementation:
http://localhost:8080/search/standalone
List all services to load standalone implementation of search:
http://localhost:8080/services/standalone
This demo illustrates the 3 key actions required to initialize the Search:
- Acquire a Transcript Sid
- Acquire a one time token
- Use the one time token to initialize the Search
The high level sequence of operations for redirecting a to the standalone editor:
- Authenticate the agent per your authentication system.
- Get Service sid from the list
- Generate a one time token
- Redirect the client to the Search url with token appended
The high level sequence of operations for embedding the Search are as follows:
- Authenticate the agent per your authentication system.
- Get Service sid from the list
- Generate a one time token
- Render the web application with an Search embedded iframe