Get AuthToken ✔️
Warning: ⚠️ For security reasons, the developer token should be always used on the server side. You should never use it in your JS code from the client side.
AuthToken: 👉 {{ authToken }}
const { data: resData } = await axios.post( "https://api.lovense.com/api/basicApi/getToken", { token: “{{token}}”, uid: “{{uid}}”, } ) if (resData.code === 0) { this.authToken = resData.data && resData.data.authToken } else { throw new Error(resData.message) }
Initialize ✔️
const basicJdkInstance = new LovenseBasicJdk({ platform: "{{ platform }}", authToken: "{{ this.authToken }}", uid: "{{ this.uid }}", debug: true }) basicJdkInstance.on("ready", (instance) => { this.readyStatus = true })
Get QR code ✔️
const codeRes = await this.basicJdkInstance.getQrcode() this.qrcode = codeRes.qrcodeUrl
Connected ✔️ DisConnected
domain: {{ `https://${deviceInfo.domain}:${deviceInfo.httpsPort}` }}
App: {{ `${deviceInfo.appType} - ${deviceInfo.appVersion}` }}
platform: {{ deviceInfo.platform }}
{{item.name}}