discord-remote-auth
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

Discord Remote Auth

Install

npm install discord-remote-auth

Usage

const { RemoteAuthClient } = require('discord-remote-auth')
const https = require('https')
const fs = require('fs')

const client = new RemoteAuthClient()

client.on('pendingRemoteInit', fingerprint => {
  const qrCodeStream = fs.createWriteStream('code.png')
  const data = `https://discordapp.com/ra/${fingerprint}`
  https.get(`https://kissapi-qrcode.vercel.app/api/qrcode?chs=250x250&chl=${data}`, res => {
    res.pipe(qrCodeStream)
  })
  qrCodeStream.once('close', () => {
    console.log('Scan ./code.png')
  })
})
client.on('pendingFinish', user => {
  fs.unlinkSync('code.png')
  console.log('Incoming User:', user)
})
client.on('finish', token => {
  console.log('Token:', token)
})
client.on('close', () => {
  if (fs.existsSync('code.png')) fs.unlinkSync('code.png')
})

client.connect()

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i discord-remote-auth

    Weekly Downloads

    17

    Version

    2.0.2

    License

    ISC

    Unpacked Size

    7.51 kB

    Total Files

    6

    Last publish

    Collaborators

    • vap0r1ze