Access your FRITZ!Box configuration from Node.js, used in vaaski/frtz.
Usage
const auth network = !async { const SID = await auth const passive = await network const woke = await network}
Functions
- frtz.auth.getNewSession(options) ⇒
Promise.<Session>
get a new challenge token
- frtz.auth.getLoginToken(options) ⇒
string
get a login token (challenge + password)
- frtz.auth.getSession(options) ⇒
Promise.<Session>
get session with username and loginToken, expires in 20 minutes unless used
- frtz.auth.checkAuth(options) ⇒
Promise.<boolean>
this makes a request to the region & language page, which seems to be the fastest in terms of response time (~650ms)
- frtz.auth.login(options) ⇒
Promise.<session>
Takes password and optionally username and host and returns a logged in session object
- frtz.network.getDevices(options) ⇒
Promise.<Object>
Get a list of devices
- frtz.network.wake(options) ⇒
Promise.<boolean>
Wake a device from sleep (Wake On Lan)
Typedefs
- Session :
Object
A session object
Promise.<Session>
frtz.auth.getNewSession(options) ⇒ get a new challenge token
Kind: global function
Param | Type |
---|---|
options | Object |
options.host | string |
string
frtz.auth.getLoginToken(options) ⇒ get a login token (challenge + password)
Kind: global function
Returns: string
- solved challenge
Param | Type |
---|---|
options | Object |
options.password | string |
option.challenge | string |
Promise.<Session>
frtz.auth.getSession(options) ⇒ get session with username and loginToken, expires in 20 minutes unless used
Kind: global function
Param | Type |
---|---|
options | Object |
options.loginToken | string |
options.host | string |
options.username | string |
Promise.<boolean>
frtz.auth.checkAuth(options) ⇒ this makes a request to the region & language page, which seems to be the fastest in terms of response time (~650ms)
Kind: global function
Param | Type | Default |
---|---|---|
options | Object |
|
options.SID | string |
|
[options.host] | string |
"https://fritz.box" |
Promise.<session>
frtz.auth.login(options) ⇒ Takes password and optionally username and host and returns a logged in session object
Kind: global function
Returns: Promise.<session>
- session object
Param | Type | Default |
---|---|---|
options | object |
|
options.password | string |
|
[options.username] | string |
|
[options.host] | string |
"https://fritz.box" |
Promise.<Object>
frtz.network.getDevices(options) ⇒ Get a list of devices
Kind: global function
Returns: Promise.<Object>
- data object containing both online and offline devices
Param | Type | Default | Description |
---|---|---|---|
options | Object |
||
options.SID | string |
session ID | |
[options.host] | string |
"https://fritz.box" |
Promise.<boolean>
frtz.network.wake(options) ⇒ Wake a device from sleep (Wake On Lan)
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
options | Object |
||
options.SID | string |
session ID | |
options.UID | string |
unit ID (device ID) | |
[options.host] | string |
"https://fritz.box" |
Object
Session : A session object
Kind: global typedef
Properties
Name | Type |
---|---|
SID | string |
Challenge | string |
BlockTime | string |
[expires] | number |
[Rights] | Object |
[Rights.Name] | Array.<string> |
[Rights.Access] | Array.<string> |