File size: 1,034 Bytes
f8430d1
 
 
 
 
 
 
 
5699984
f8430d1
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { ReachyMini } from '@pollen-robotics/reachy-mini-sdk';
(window as unknown as { ReachyMini: typeof ReachyMini }).ReachyMini = ReachyMini;
window.dispatchEvent(new Event('reachymini:ready'));
const params = new URLSearchParams(location.search);
if (params.get('embedded') === '1' || params.get('embed') === '1') {
  void import('./embed').catch(showError);
} else {
  void import('@pollen-robotics/reachy-mini-sdk/host/auto').then(({ mountHost }) => {
    mountHost({ appName: 'Expressive Teleop', appIconUrl: `${import.meta.env.BASE_URL}icon.svg`, appEmoji: '🎮', enableMicrophone: false,
      devToken: import.meta.env.VITE_HF_TOKEN && import.meta.env.VITE_HF_USERNAME
        ? { token: import.meta.env.VITE_HF_TOKEN, userName: import.meta.env.VITE_HF_USERNAME } : undefined,
      clientId: import.meta.env.VITE_HF_OAUTH_CLIENT_ID,
    });
  }).catch(showError);
}
function showError(error: unknown) {
  console.error(error);
  document.querySelector('#root')!.textContent = `Unable to start Teleop: ${String(error)}`;
}