Proxy tg login site for restricted domain
pnpm i
# Compile and Hot-Reload for Development
pnpm dev
# Type-Check, Compile and Minify for Production
pnpm build
# Run Unit Tests with [Vitest](https://vitest.dev/)
pnpm test:unit
# Lint with [ESLint](https://eslint.org/)
pnpm lint
- Configure bot domain to
https://tg-brother.vercel.app/
- Use
window.open
open the linkhttps://tg-brother.vercel.app/?bot_name=<your bot name>
- Use
window.onmessage
orwindow.addEventListener('message', handler)
to receive result
window.addEventListener('message', (evt) => {
const { data, origin } = evt
if (origin === 'https://tg-brother.vercel.app' && data.type === 'tg-brother:telegram_login') {
// do something
console.log(data)
}
})
- Use
?close=1
to auto close window when auth done