Skip to content

Commit a3c3c2c

Browse files
chore: tidyup V2 (#290)
1 parent 6e38943 commit a3c3c2c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1862
-1936
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,34 @@ This starter is designed to be flexible so you can adapt it to your specific age
7777
#### Example: App configuration (`app-config.ts`)
7878

7979
```ts
80-
export const APP_CONFIG_DEFAULTS = {
80+
export const APP_CONFIG_DEFAULTS: AppConfig = {
8181
companyName: 'LiveKit',
8282
pageTitle: 'LiveKit Voice Agent',
8383
pageDescription: 'A voice agent built with LiveKit',
84+
8485
supportsChatInput: true,
8586
supportsVideoInput: true,
8687
supportsScreenShare: true,
88+
isPreConnectBufferEnabled: true,
89+
8790
logo: '/lk-logo.svg',
8891
accent: '#002cf2',
8992
logoDark: '/lk-logo-dark.svg',
9093
accentDark: '#1fd5f9',
9194
startButtonText: 'Start call',
95+
96+
// for LiveKit Cloud Sandbox
97+
sandboxId: undefined,
98+
agentName: undefined,
9299
};
93100
```
94101

95102
You can update these values in [`app-config.ts`](./app-config.ts) to customize branding, features, and UI text for your deployment.
96103

104+
> [!NOTE]
105+
> The `sandboxId` and `agentName` are for the LiveKit Cloud Sandbox environment.
106+
> They are not used for local development.
107+
97108
#### Environment Variables
98109

99110
You'll also need to configure your LiveKit credentials in `.env.local` (copy `.env.example` if you don't have one):

app-config.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
import type { AppConfig } from './lib/types';
1+
export interface AppConfig {
2+
pageTitle: string;
3+
pageDescription: string;
4+
companyName: string;
5+
6+
supportsChatInput: boolean;
7+
supportsVideoInput: boolean;
8+
supportsScreenShare: boolean;
9+
isPreConnectBufferEnabled: boolean;
10+
11+
logo: string;
12+
startButtonText: string;
13+
accent?: string;
14+
logoDark?: string;
15+
accentDark?: string;
16+
17+
// for LiveKit Cloud Sandbox
18+
sandboxId?: string;
19+
agentName?: string;
20+
}
221

322
export const APP_CONFIG_DEFAULTS: AppConfig = {
423
companyName: 'LiveKit',
@@ -16,5 +35,7 @@ export const APP_CONFIG_DEFAULTS: AppConfig = {
1635
accentDark: '#1fd5f9',
1736
startButtonText: 'Start call',
1837

38+
// for LiveKit Cloud Sandbox
39+
sandboxId: undefined,
1940
agentName: undefined,
2041
};

app/(app)/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { headers } from 'next/headers';
22
import { getAppConfig } from '@/lib/utils';
33

4-
interface AppLayoutProps {
4+
interface LayoutProps {
55
children: React.ReactNode;
66
}
77

8-
export default async function AppLayout({ children }: AppLayoutProps) {
8+
export default async function Layout({ children }: LayoutProps) {
99
const hdrs = await headers();
1010
const { companyName, logo, logoDark } = await getAppConfig(hdrs);
1111

@@ -39,6 +39,7 @@ export default async function AppLayout({ children }: AppLayoutProps) {
3939
</a>
4040
</span>
4141
</header>
42+
4243
{children}
4344
</>
4445
);

app/(app)/opengraph-image.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export default async function Image() {
165165
gap: 10,
166166
}}
167167
>
168-
{/* eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text */}
168+
{/* eslint-disable-next-line jsx-a11y/alt-text */}
169169
<img src={wordmarkSrcBase64} width={wordmarkSize.width} height={wordmarkSize.height} />
170170
</div>
171171
{/* logo */}
@@ -179,7 +179,7 @@ export default async function Image() {
179179
gap: 10,
180180
}}
181181
>
182-
{/* eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text */}
182+
{/* eslint-disable-next-line jsx-a11y/alt-text */}
183183
<img src={logoSrcBase64} width={logoSize.width} height={logoSize.height} />
184184
</div>
185185
{/* title */}

app/(app)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { headers } from 'next/headers';
2-
import { App } from '@/components/app';
2+
import { App } from '@/components/app/app';
33
import { getAppConfig } from '@/lib/utils';
44

55
export default async function Page() {

app/api/connection-details/route.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ import { NextResponse } from 'next/server';
22
import { AccessToken, type AccessTokenOptions, type VideoGrant } from 'livekit-server-sdk';
33
import { RoomConfiguration } from '@livekit/protocol';
44

5+
type ConnectionDetails = {
6+
serverUrl: string;
7+
roomName: string;
8+
participantName: string;
9+
participantToken: string;
10+
};
11+
512
// NOTE: you are expected to define the following environment variables in `.env.local`:
613
const API_KEY = process.env.LIVEKIT_API_KEY;
714
const API_SECRET = process.env.LIVEKIT_API_SECRET;
@@ -10,13 +17,6 @@ const LIVEKIT_URL = process.env.LIVEKIT_URL;
1017
// don't cache the results
1118
export const revalidate = 0;
1219

13-
export type ConnectionDetails = {
14-
serverUrl: string;
15-
roomName: string;
16-
participantName: string;
17-
participantToken: string;
18-
};
19-
2020
export async function POST(req: Request) {
2121
try {
2222
if (LIVEKIT_URL === undefined) {

app/components/Container.tsx

Lines changed: 0 additions & 12 deletions
This file was deleted.

app/components/Tabs.tsx

Lines changed: 0 additions & 33 deletions
This file was deleted.

app/components/base/page.tsx

Lines changed: 0 additions & 132 deletions
This file was deleted.

app/components/layout.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)