Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,34 @@ This starter is designed to be flexible so you can adapt it to your specific age
#### Example: App configuration (`app-config.ts`)

```ts
export const APP_CONFIG_DEFAULTS = {
export const APP_CONFIG_DEFAULTS: AppConfig = {
companyName: 'LiveKit',
pageTitle: 'LiveKit Voice Agent',
pageDescription: 'A voice agent built with LiveKit',

supportsChatInput: true,
supportsVideoInput: true,
supportsScreenShare: true,
isPreConnectBufferEnabled: true,

logo: '/lk-logo.svg',
accent: '#002cf2',
logoDark: '/lk-logo-dark.svg',
accentDark: '#1fd5f9',
startButtonText: 'Start call',

// for LiveKit Cloud Sandbox
sandboxId: undefined,
agentName: undefined,
};
```

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

> [!NOTE]
> The `sandboxId` and `agentName` are for the LiveKit Cloud Sandbox environment.
> They are not used for local development.

#### Environment Variables

You'll also need to configure your LiveKit credentials in `.env.local` (copy `.env.example` if you don't have one):
Expand Down
23 changes: 22 additions & 1 deletion app-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
import type { AppConfig } from './lib/types';
export interface AppConfig {
pageTitle: string;
pageDescription: string;
companyName: string;

supportsChatInput: boolean;
supportsVideoInput: boolean;
supportsScreenShare: boolean;
isPreConnectBufferEnabled: boolean;

logo: string;
startButtonText: string;
accent?: string;
logoDark?: string;
accentDark?: string;

// for LiveKit Cloud Sandbox
sandboxId?: string;
agentName?: string;
}

export const APP_CONFIG_DEFAULTS: AppConfig = {
companyName: 'LiveKit',
Expand All @@ -16,5 +35,7 @@ export const APP_CONFIG_DEFAULTS: AppConfig = {
accentDark: '#1fd5f9',
startButtonText: 'Start call',

// for LiveKit Cloud Sandbox
sandboxId: undefined,
agentName: undefined,
Comment on lines +38 to 40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I look forward to this sandbox config logic getting much simpler in the future!

};
5 changes: 3 additions & 2 deletions app/(app)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { headers } from 'next/headers';
import { getAppConfig } from '@/lib/utils';

interface AppLayoutProps {
interface LayoutProps {
children: React.ReactNode;
}

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

Expand Down Expand Up @@ -39,6 +39,7 @@ export default async function AppLayout({ children }: AppLayoutProps) {
</a>
</span>
</header>

{children}
</>
);
Expand Down
4 changes: 2 additions & 2 deletions app/(app)/opengraph-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default async function Image() {
gap: 10,
}}
>
{/* eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text */}
{/* eslint-disable-next-line jsx-a11y/alt-text */}
<img src={wordmarkSrcBase64} width={wordmarkSize.width} height={wordmarkSize.height} />
</div>
{/* logo */}
Expand All @@ -179,7 +179,7 @@ export default async function Image() {
gap: 10,
}}
>
{/* eslint-disable-next-line @next/next/no-img-element, jsx-a11y/alt-text */}
{/* eslint-disable-next-line jsx-a11y/alt-text */}
<img src={logoSrcBase64} width={logoSize.width} height={logoSize.height} />
</div>
{/* title */}
Expand Down
2 changes: 1 addition & 1 deletion app/(app)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { headers } from 'next/headers';
import { App } from '@/components/app';
import { App } from '@/components/app/app';
import { getAppConfig } from '@/lib/utils';

export default async function Page() {
Expand Down
14 changes: 7 additions & 7 deletions app/api/connection-details/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import { NextResponse } from 'next/server';
import { AccessToken, type AccessTokenOptions, type VideoGrant } from 'livekit-server-sdk';
import { RoomConfiguration } from '@livekit/protocol';

type ConnectionDetails = {
serverUrl: string;
roomName: string;
participantName: string;
participantToken: string;
};

// NOTE: you are expected to define the following environment variables in `.env.local`:
const API_KEY = process.env.LIVEKIT_API_KEY;
const API_SECRET = process.env.LIVEKIT_API_SECRET;
Expand All @@ -10,13 +17,6 @@ const LIVEKIT_URL = process.env.LIVEKIT_URL;
// don't cache the results
export const revalidate = 0;

export type ConnectionDetails = {
serverUrl: string;
roomName: string;
participantName: string;
participantToken: string;
};

export async function POST(req: Request) {
try {
if (LIVEKIT_URL === undefined) {
Expand Down
12 changes: 0 additions & 12 deletions app/components/Container.tsx

This file was deleted.

33 changes: 0 additions & 33 deletions app/components/Tabs.tsx

This file was deleted.

132 changes: 0 additions & 132 deletions app/components/base/page.tsx

This file was deleted.

24 changes: 0 additions & 24 deletions app/components/layout.tsx

This file was deleted.

Loading