Skip to content

Commit ca61975

Browse files
committed
Update docs and add taskfile
1 parent cfcb45b commit ca61975

File tree

6 files changed

+59
-39
lines changed

6 files changed

+59
-39
lines changed

README.md

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,35 @@
1-
# Welcome to your Expo app 👋
1+
<img src="./.github/assets/app-icon.png" alt="Voice Assistant App Icon" width="100" height="100">
22

3-
This is an [Expo](https://expo.dev) project created with [`create-expo-app`](https://www.npmjs.com/package/create-expo-app).
3+
# React-Native Voice Assistant
44

5-
## Get started
5+
This is a starter template for [LiveKit Agents](https://docs.livekit.io/agents/overview/) that provides a simple voice interface using the [LiveKit React-Native SDK](https://github.com/livekit/client-sdk-react-native) and [Expo Plugin](https://github.com/livekit/client-sdk-react-native-expo-plugin).
66

7-
1. Install dependencies
7+
This template is free for you to use or modify as you see fit.
88

9-
```bash
10-
npm install
11-
```
9+
## Getting started
1210

13-
2. Start the app
11+
The easiest way to get this app running is with the [Sandbox for LiveKit Cloud](https://cloud.livekit.io/projects/p_/sandbox) and the [LiveKit CLI](https://docs.livekit.io/home/cli/cli-setup/).
1412

15-
```bash
16-
npx expo start
17-
```
13+
First, create a new [Sandbox Token Server](https://cloud.livekit.io/projects/p_mytc7vpzfkt/sandbox/templates/token-server) for your LiveKit Cloud project.
1814

19-
In the output, you'll find options to open the app in a
20-
21-
- [development build](https://docs.expo.dev/develop/development-builds/introduction/)
22-
- [Android emulator](https://docs.expo.dev/workflow/android-studio-emulator/)
23-
- [iOS simulator](https://docs.expo.dev/workflow/ios-simulator/)
24-
- [Expo Go](https://expo.dev/go), a limited sandbox for trying out app development with Expo
25-
26-
You can start developing by editing the files inside the **app** directory. This project uses [file-based routing](https://docs.expo.dev/router/introduction).
27-
28-
## Get a fresh project
29-
30-
When you're ready, run:
15+
Then, run the following command to automatically clone this template and connect it to LiveKit Cloud:
3116

3217
```bash
33-
npm run reset-project
18+
lk app create --template voice-assistant-react-native --sandbox <token_server_sandbox_id>
3419
```
3520

36-
This command will move the starter code to the **app-example** directory and create a blank **app** directory where you can start developing.
21+
Afterwards, run `npx expo install` to install dependencies,
22+
and then `npx expo start` from the command line to run the app. You can also use `npx expo run:android` or `npx expo run:ios` to run the app on the respective devices.
3723

38-
## Learn more
24+
You'll also need an agent to speak with. Try our sample voice assistant agent for [Python](https://github.com/livekit-examples/voice-pipeline-agent-python), [Node.js](https://github.com/livekit-examples/voice-pipeline-agent-node), or [create your own from scratch](https://docs.livekit.io/agents/quickstart/).
3925

40-
To learn more about developing your project with Expo, look at the following resources:
26+
> [!NOTE]
27+
> To setup without the LiveKit CLI, clone the repository and edit the `useConnectionDetails.ts` file to add either a `sandboxID` (if using a [Sandbox Token Server](https://cloud.livekit.io/projects/p_/sandbox/templates/token-server)), or a [manually generated](#token-generation) URL and token.
4128
42-
- [Expo documentation](https://docs.expo.dev/): Learn fundamentals, or go into advanced topics with our [guides](https://docs.expo.dev/guides).
43-
- [Learn Expo tutorial](https://docs.expo.dev/tutorial/introduction/): Follow a step-by-step tutorial where you'll create a project that runs on Android, iOS, and the web.
29+
## Token generation
4430

45-
## Join the community
31+
In a production environment, you will be responsible for developing a solution to [generate tokens for your users](https://docs.livekit.io/home/server/generating-tokens/) which is integrated with your authentication solution. You should disable your sandbox token server and modify `TokenExt.kt` to use your own token server.
4632

47-
Join our community of developers creating universal apps.
33+
## Contributing
4834

49-
- [Expo on GitHub](https://github.com/expo/expo): View our open source platform and contribute.
50-
- [Discord community](https://chat.expo.dev): Chat with Expo users and ask questions.
35+
This template is open source and we welcome contributions! Please open a PR or issue through GitHub, and don't forget to join us in the [LiveKit Community Slack](https://livekit.io/join-slack)!

app.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,26 @@
99
"userInterfaceStyle": "automatic",
1010
"newArchEnabled": true,
1111
"ios": {
12-
"supportsTablet": true
12+
"supportsTablet": true,
13+
"bitcode": false,
14+
"bundleIdentifier": "io.livekit.voiceassistantreactnative",
1315
},
1416
"android": {
1517
"adaptiveIcon": {
1618
"foregroundImage": "./assets/images/adaptive-icon.png",
1719
"backgroundColor": "#ffffff"
1820
},
19-
"package": "io.livekit.voiceassistantreactnative"
21+
"package": "io.livekit.voiceassistantreactnative",
22+
"permissions": [
23+
"android.permission.ACCESS_NETWORK_STATE",
24+
"android.permission.CAMERA",
25+
"android.permission.INTERNET",
26+
"android.permission.MODIFY_AUDIO_SETTINGS",
27+
"android.permission.RECORD_AUDIO",
28+
"android.permission.SYSTEM_ALERT_WINDOW",
29+
"android.permission.WAKE_LOCK",
30+
"android.permission.BLUETOOTH"
31+
]
2032
},
2133
"web": {
2234
"bundler": "metro",
@@ -25,7 +37,7 @@
2537
},
2638
"plugins": [
2739
"expo-router",
28-
"@livekit/react-native-expo-plugin",
40+
"@livekit/react-native-expo-plugin",
2941
"@config-plugins/react-native-webrtc",
3042
[
3143
"expo-splash-screen",

package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"ios": "expo run:ios",
1010
"web": "expo start --web",
1111
"test": "jest --watchAll",
12-
"lint": "expo lint"
12+
"ci:test": "jest",
13+
"lint": "expo lint",
14+
"typescript": "tsc --noemit -p tsconfig.json"
1315
},
1416
"jest": {
1517
"preset": "jest-expo"
@@ -45,7 +47,8 @@
4547
"react-native-safe-area-context": "4.12.0",
4648
"react-native-screens": "~4.4.0",
4749
"react-native-web": "~0.19.13",
48-
"react-native-webview": "13.12.5"
50+
"react-native-webview": "13.12.5",
51+
"typescript": "5.0.4"
4952
},
5053
"devDependencies": {
5154
"@babel/core": "^7.25.2",

taskfile.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: "3"
2+
output: interleaved
3+
dotenv: [".env.local"]
4+
5+
tasks:
6+
post_create:
7+
desc: "Runs after this template is instantiated as a Sandbox or Bootstrap"
8+
vars:
9+
TOKEN_FILE: "hooks/useConnectionDetails.ts"
10+
cmds:
11+
- echo -e "Setting up sandbox..."
12+
- platforms: [darwin]
13+
cmd: sed -i "" "s/sandboxID = \"\"/sandboxID = \"{{.LIVEKIT_SANDBOX_ID}}\"/g" "{{.ROOT_DIR}}/{{.TOKEN_FILE}}"
14+
- platforms: [linux, windows]
15+
cmd: sed -i "s/sandboxID = \"\"/sandboxID = \"{{.LIVEKIT_SANDBOX_ID}}\"/g" "{{.ROOT_DIR}}/{{.TOKEN_FILE}}"
16+
- echo -e "\nYour React-Native voice assistant is ready to go!\n"
17+
- echo -e "To give it a try, run \"npx expo start\" to run the app."
18+
- echo -e "\nFor more help view your project's README.md file or join our Slack community at https://livekit.io/join-slack."

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"extends": "expo/tsconfig.base",
33
"compilerOptions": {
44
"strict": true,
5+
"moduleResolution": "bundler",
56
"paths": {
67
"@/*": [
78
"./*"

0 commit comments

Comments
 (0)