- Go to https://oauth.yandex.ru/client/new and create new oauth client
- Check API Яндекс.Паспорта (login) ↘︎ login:email
- Save ID and secret:
ID: 46b4112266ea647729cc03b8e8ea60ff
Пароль: 0650438ca8e0f1c4410a44e5b903b0a6
Callback URL: https://social.yandex.net/broker/redirect
- Go to https://dialogs.yandex.ru/developer, click create dialog and check smart home dialog
- Before you can test your skill you must fill all required fields
- ...even dialog icon lol :)
- Endpoint URL:
https://<your-subdomain>.ngrok.io/alice
. Endpoint must be https://. This will be localtunnel url that we'll create later. - fill authorization credentials:
Client Identifier: <ID>
Client Password: <Пароль>
API authorization endpoint: https://oauth.yandex.ru/authorize
Token endpoint: https://oauth.yandex.ru/token
npm run tunnel
Pick up domain from console. So Endpoint URL in step 2 must be https://<your-subdomain>.ngrok.io/alice
npm i
npm run dev
Site must be available on public host https://<your-subdomain>.ngrok.io/alice
but to work locally we can use http://localhost:3000
Open http://localhost:3000
and we're ready to go!
When you open site, browser creates websocket connection with node server. State is stored in react app. React listens to websocket commands and performs update. Alice will be sending requests to our server via tunnel and server will transform these requests to websocket commands. IMPORTANT! Virtual device is created on websocket connection. So without open website alice will recieve empty device response.
Open testing tab in your skill webpage and authorize your app
Click sync devices and you should see your device in list