You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a starter template for [LiveKit Agents](https://docs.livekit.io/agents) that provides an example of how you might approach building web embed using the [LiveKit JavaScript SDK](https://github.com/livekit/client-sdk-js). It supports [voice](https://docs.livekit.io/agents/start/voice-ai) and [transcriptions](https://docs.livekit.io/agents/build/text/).
6
4
7
5
This template is built with Next.js and is free for you to use or modify as you see fit.
- Light/dark theme switching with system preference detection
21
+
- Customizable branding, colors, and UI text via configuration
22
+
23
+
This template is built with Next.js and is free for you to use or modify as you see fit.
24
+
25
+
### Project structure
26
+
27
+
```
28
+
agent-starter-react/
29
+
├── app/
30
+
│ ├── (app)/
31
+
│ ├── (iframe)/
32
+
│ ├── api/
33
+
│ ├── test/
34
+
│ ├── favicon.ico
35
+
├── components/
36
+
│ ├── embed-iframe/
37
+
│ ├── embed-popup/
38
+
│ ├── livekit/
39
+
│ ├── ui/
40
+
│ ├── popup-page.tsx
41
+
│ ├── root-layout.tsx
42
+
│ └── theme-toggle.tsx
43
+
│ └── welcome.tsx
44
+
│ └── ...
45
+
├── hooks/
46
+
├── lib/
47
+
├── public/
48
+
├── styles/
49
+
└── package.json
50
+
```
10
51
11
52
## Getting started
12
53
13
54
> [!TIP]
14
55
> If you'd like to try this application without modification, you can deploy an instance in just a few clicks with [LiveKit Cloud Sandbox](https://cloud.livekit.io/projects/p_/sandbox/templates/agent-starter-embed).
15
56
57
+
[](https://cloud.livekit.io/projects/p_/sandbox/templates/agent-starter-embed)
58
+
16
59
Run the following command to automatically clone this template.
17
60
18
61
```bash
@@ -34,15 +77,60 @@ You'll also need an agent to speak with. Try our starter agent for [Python](http
34
77
> [!NOTE]
35
78
> If you need to modify the LiveKit project credentials used, you can edit `.env.local` (copy from `.env.example` if you don't have one) to suit your needs.
36
79
80
+
## Configuration
81
+
82
+
This starter is designed to be flexible so you can adapt it to your specific agent use case. You can easily configure it to work with different types of inputs and outputs:
83
+
84
+
#### Example: App configuration (`app-config.ts`)
85
+
86
+
```ts
87
+
exportconst APP_CONFIG_DEFAULTS = {
88
+
sandboxId: undefined,
89
+
agentName: undefined,
90
+
91
+
supportsChatInput: true,
92
+
supportsVideoInput: true,
93
+
supportsScreenShare: true,
94
+
isPreConnectBufferEnabled: true,
95
+
96
+
accent: '#002cf2',
97
+
accentDark: '#1fd5f9',
98
+
};
99
+
```
100
+
101
+
You can update these values in [`app-config.ts`](./app-config.ts) to customize branding, features, and UI text for your deployment.
102
+
103
+
#### Environment Variables
104
+
105
+
You'll also need to configure your LiveKit credentials in `.env.local` (copy `.env.example` if you don't have one):
These are required for the voice agent functionality to work with your LiveKit project.
116
+
37
117
## Local Development
38
118
39
119
http://localhost:3000 will respond to code changes in real time through [NextJS Fast Refresh](https://nextjs.org/docs/architecture/fast-refresh) to support a rapid iteration feedback loop.
40
120
41
121
## Production deployment of embed-popup.js script
42
122
43
-
Any code changes you see locally will not be reflected in `embed-popup.js` until you run `pnpm build-embed-popup-script`.
123
+
Once your environment is set up and you've made any configuration changes, you can copy the embed code generated on the welcome page of your LiveKit Sandbox and paste it into your website.
124
+
125
+
> [!IMPORTANT]
126
+
> When implementing the iframe embed or popup embed into your own website, use the embed code generated on the welcome page of your LiveKit Sandbox.
127
+
128
+
## Debugging the build of embed-popup.js script
129
+
130
+
You can test and debug your latest build of `embed-popup.js` locally at http://localhost:3000/test/popup.
44
131
45
-
You can test your latest build of `embed-popup.js` at http://localhost:3000/popup.
132
+
> [!IMPORTANT]
133
+
> Code changes you make locally will not be reflected in the bundled `embed-popup.js` script until you run `pnpm build-embed-popup-script`.
0 commit comments