Trillet AI Integrations

Trillet AI offers seamless integration with popular automation tools like Make.com, n8n, and our Web SDK, allowing you to automate outbound AI voice calls and embed AI agents directly into your applications. Use these platforms and tools to trigger TrilletAI’s call capabilities directly from your workflows or integrate voice agents into your websites.

Make.com Integration

Hero Light Integrate Trillet AI with Make.com custom node to automate outbound voice call workflows. This is ideal for building call-based campaigns, customer notifications, or voice follow-ups powered by Trillet AI.

Installation

To add TrilletAI’s app to your Make.com organization: You can find TrilletAI directly on Make.com by searching “TrilletAI” in the App list under the us1 or us2 regions. If TrilletAI does not appear in your region or account, use the invitation link below to add it manually: 🔗 Click here to install if it doesn’t appear.

n8n Integration

Hero Light TrilletAI provides a custom node for n8n to let you trigger outbound voice calls directly within your workflows. This allows you to automate call-based sequences based on custom events, user actions, or external system triggers.

Installation Steps

  1. Ensure n8n is installed on your machine. If not, follow n8n installation guide.
  2. Open your terminal and install the TrilletAI node package:
npm install n8n-trillet-nodes

SDK Integration

Hero Light The Trillet AI Web SDK allows you to integrate AI-powered voice agents directly into your website or web application. This enables users to interact with your Trillet AI agents via voice or text calls, ideal for embedding real-time AI conversations in client-facing apps, demos, or custom workflows. The SDK uses LiveKit for real-time audio handling and supports features like transcription, audio analysis, and event emitting.

Installation

You can install the SDK via npm for modern web frameworks (e.g., React, Next.js) or load it directly from a CDN for simple HTML integrations.

Via npm

  1. Install the package:
npm install @trillet-ai/web-sdk
  1. Import and use in your code:
import { TrilletAgent } from '@trillet-ai/web-sdk';

Via CDN (No Build Tools Required)

Include the SDK script in your HTML:
<script type="module">
  const module = await import("https://cdn.jsdelivr.net/npm/@trillet-ai/web-sdk/+esm");
  const TrilletAgent = module.TrilletAgent;
  // Use TrilletAgent here
</script>
Note: The SDK requires a browser environment with secure context (HTTPS or localhost). It does not support server-side rendering.

Configuration

Initialize a TrilletAgent instance:
const agent = new TrilletAgent({
  workspaceId: 'your-workspace-id',
  agentId: 'your-agent-id',
  variables: { key: 'value' },
  mode: 'voice',
});

Usage

  1. Start a Call:
    • Use startPublicCall() for public (workspace-based) integrations.
    • Use startCall() for API key authenticated calls.
try {
  await agent.startPublicCall();
  console.log('Call started');
} catch (error) {
  console.error('Failed to start call:', error);
}
  1. End a Call:
agent.endCall();
  1. Toggle Microphone:
agent.toggleMicrophone(true); // Enable microphone
  1. Event Handling: The SDK extends EventEmitter. Listen for events like connected, disconnected, error, assistantStartedSpeaking, etc.
agent.on('connected', (details) => {
  console.log('Connected:', details.callId, details.agent.name);
});

agent.on('disconnected', () => {
  console.log('Call ended');
});

agent.on('error', (error) => {
  console.error('Error:', error);
});
  1. Transcripts: Access real-time and final transcripts:
const transcripts = agent.getTranscripts(); // Array of Transcript objects
const current = agent.getCurrentTranscript(); // Partial transcripts

SDK Integration Preview

Trillet AI SDK Integration
Important: Make sure to enable public access in your call flow settings before testing the SDK integration. You can find this option in the call flow settings panel.

Examples

React Component Integration

For React/Next.js apps, create a basic component to handle calls:
import { useState, useRef } from 'react';
import { TrilletAgent } from '@trillet-ai/web-sdk';

const VoiceAgent = ({ agentId, workspaceId }) => {
  const agentRef = useRef(null);
  const [isCallActive, setIsCallActive] = useState(false);

  if (!agentRef.current) {
    agentRef.current = new TrilletAgent({
      workspaceId,
      agentId,
    });
  }

  const startCall = async () => {
    try {
      await agentRef.current.startPublicCall();
      setIsCallActive(true);
    } catch (error) {
      console.error('Failed to start call:', error);
    }
  };

  const endCall = () => {
    agentRef.current.endCall();
    setIsCallActive(false);
  };

  return (
    <button onClick={isCallActive ? endCall : startCall}>
      {isCallActive ? 'Hang Up' : 'Start Call'}
    </button>
  );
};

export default VoiceAgent;

Simple HTML Button Integration

Embed a button that starts/stops a voice call with your agent:
<!-- Trillet Voice Button -->
<style>
  #trillet-voice-button {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(to right, #25aae1, #40e495, #30dd8a, #2bb673);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    z-index: 999;
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.4);
    transition: all 0.3s ease;
  }

  #trillet-voice-button:hover {
    transform: scale(1.05);
  }
</style>

<button id="trillet-voice-button">
  🎙️ Speak with AI Agent
</button> 

<script type="module">
  const { TrilletAgent } = await import("https://cdn.jsdelivr.net/npm/@trillet-ai/web-sdk/+esm");

  const workspaceId = "your-workspace-id"; // Replace with your workspace ID
  const agentId = "your-agent-id"; // Replace with your agent ID
  const button = document.getElementById("trillet-voice-button");

  const agent = new TrilletAgent({ workspaceId, agentId });
  let isCalling = false;

  button.addEventListener("click", async () => {
    if (!isCalling) {
      try {
        button.innerText = "⏳ Connecting...";
        button.disabled = true;
        await agent.startPublicCall();
        isCalling = true;
        button.innerText = "Hang Up 🔴";
      } catch (err) {
        console.error("Failed to start call:", err);
        alert("Could not start the AI call. Please try again.");
        button.innerText = "🎙️ Speak with AI Agent";
      } finally {
        button.disabled = false;
      }
    } else {
      agent.endCall();
      isCalling = false;
      button.innerText = "🎙️ Speak with AI Agent";
    }
  });

  agent.on("disconnected", () => {
    isCalling = false;
    button.innerText = "🎙️ Speak with AI Agent";
    button.disabled = false;
  });
</script>
Note: Replace placeholders like your-workspace-id and your-agent-id with your actual Trillet AI credentials. For production, secure sensitive data (e.g., avoid exposing API keys client-side). The SDK handles browser compatibility checks internally. If you encounter issues, ensure microphone permissions are granted and test in a secure context.