Run Wechaty in Chrome Browser Directly Through Chatie Service.
Created by: huan
Today when I'm thinking about the Hostie service of Chatie, the following idea comes into my head:
import { PuppetHostie } from 'wechaty-puppet-hostie'
import { Wechaty } from 'wechaty'
const puppet = new puppetHostie('hostie-token-secret')
const wechaty = Wechaty.instance({
puppet,
})
wechaty.start()
Which the HostiePuppet
class will accept a token
in its constructor, and use this token
to connect with the api.chatie.io/v0/hostie/${token}
service.
Where can we get the token
of the Hostie
? We can make it on app.chatie.io
in the future. (WIP)
The above code should be able to be compiled by WebPack and run right inside the browser. (and certainly, we can run it right inside plnkr.co / jsbin.com etc too)
Please let me know what you think if you are interested, thanks.