It seems appropriate that backend owns the responsability of knowing any information/configurations of the LiveKit server. Then, it shares those with the frontend. Please see my previous commit to understand why environment variables are not appropriate for deployment in several remove environments. As of today, the LiveKit server URL is the only configuration exposed dynamically to the frontend. Thus, it doesn't justify adding a new route to the API, responsible for exposing configurations (e.g. /configuration). As the frontend needs to call the backend when it wants to initiate a new webconference room, let's pass the server URL when retrieving the room's token. It is relevant, to get both the room location and the keys to open the room in the same call. I prefered to be pragmatic, if the need appears any soon, I would refactor these parts.
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist