Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native Example Part 1 (ios) #100

Merged
merged 27 commits into from
Nov 22, 2024
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
5 changes: 2 additions & 3 deletions evi-flutter-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ This project features a sample implementation of Hume's [Empathic Voice Interfac

1. `flutter pub get` to install dependencies.

2. Replace `humeApiKey` and (optional) `humeConfigId` constants in `lib/main.dart`. See our documentation on [getting your api keys](https://hume.docs.buildwithfern.com/docs/introduction/getting-your-api-key).
2. Copy the `.env.example` included in the repository to `.env` and fill in `HUME_API_KEY` and `HUME_CONFIG_ID` appropriately, see our documentation on [getting your api keys](https://hume.docs.buildwithfern.com/docs/introduction/getting-your-api-key).

**Note:** in a production flutter app, you should not hardcode the Hume API key into the client code, the client should fetch an access token from an endpoint on your server. You should supply
the `MY_SERVER_AUTH_URL` environment variable and uncomment the call to `fetchAccessToken` in `lib/main.dart`.
**Note:** the `HUME_API_KEY` environment variable is for development only. In a production flutter app you should avoid building your api key into the app -- the client should fetch an access token from an endpoint on your server. You should supply the `MY_SERVER_AUTH_URL` environment variable and uncomment the call to `fetchAccessToken` in `lib/main.dart`.

3. Use `flutter run` to start the app!

Expand Down
10 changes: 10 additions & 0 deletions evi-react-native-example/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Note: in a production app, you should avoid hardcoding your API key in client code
# and instead retrieve an access token from a backend server.
# See https://dev.hume.ai/docs/introduction/api-key for more information.
EXPO_PUBLIC_HUME_API_KEY="<YOUR_API_KEY>"

# (Optional, use this to customize EVI, see https://dev.hume.ai/docs/empathic-voice-interface-evi/configuration)
EXPO_PUBLIC_HUME_CONFIG_ID="<YOUR_CONFIG_ID>"

# Uncomment the following line to use an endpoint on your own server for authentication
# EXPO_PUBLIC_MY_SERVER_AUTH_URL="http://localhost:8080/auth"
39 changes: 39 additions & 0 deletions evi-react-native-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files

# dependencies
node_modules/

# Expo
.expo/
dist/
web-build/

# Native
*.orig.*
*.jks
*.p8
*.p12
*.key
*.mobileprovision
.env

# Metro
.metro-health-check*

# debug
npm-debug.*
yarn-debug.*
yarn-error.*

# macOS
.DS_Store
*.pem

# local env files
.env*.local

# typescript
*.tsbuildinfo

/ios
/android
1 change: 1 addition & 0 deletions evi-react-native-example/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
Loading