-
Notifications
You must be signed in to change notification settings - Fork 4
Client‑Server API
Instead of interfacing with airborn-server directly, most of which is undocumented, we recommend you to include and interface with airborn-server/login.js
and airborn/core.js
.
Note: please email us with questions about licensing and trademarks. We haven't made up our minds yet.
This files and its API is unstable, although it won't change often as per HCS. Update it often. It defines the following function:
login(creds, firstfile, requestmorecreds(type, data, callback(creds)), success(storecreds), error({status, statusText, id}))
-
creds
is an object. Warning: this object will be mutated by the function.The first time logging in,
creds
has two required properties,creds.username
andcreds.password
.The next time logging in, you should pass
storecreds
(see below). -
firstfile
is the first file, whichlogin()
will download andeval()
. You can pass any file, but these are logical choices:-
"/Core/core.js"
provides an API for reading and writing files (see below). -
"/Core/init.js"
also loadscore.js
but alsostartup.js
, which loads the window manager and generally starts up Airborn.
-
-
requestmorecreds
is a function for multi-factor authentication. Currently, this function is never called, but it might be in the future. You should pass{}
tocallback
, which will result in an error (see below). -
success(storecreds)
is a function called on success. It is passed the following arguments:-
storecreds
is an object which you can pass tologin()
next time to speed up logging in.- Note: if you serialize this as JSON, you're good.
-
-
error({status, statusText, id}))
is a function called on errors. It is passed an object with the following properties:-
status
andstatusText
are unstable. -
id
is one of the following strings:-
"wronguser"
-
"wrongpass"
-
"missingcreds"
, if you didn't pass enough credentials tologin()
. -
"missingmorecreds"
, if you didn't pass enough credentials to the callback ofrequestmorecreds
. -
"error"
for any other error
-
-
The API defined in this file is part of the Internal API. Please only use the functions described on that page.