Install with npm
npm install just-login-client
var client =
This function handles remembering the session id in the browser's local storage.
dnodeEndpointis a string for the endpoint that dnode uses for communication. This argument is optional, and defaults to
"/dnode". The string must start with a forward slash
cbis a function that has the following arguments:
newApiis documented here.
sessionIdis the new (or previous, when applicable) session id.
An event emitter which can emit the events shown below.
Also, client sets window.emitter as an event emitter, and it emits these events:
sessionis emitted when a session is initiated. An object is emitted with the following properties:
sessionIdThe id for the current session. E.g.
continuedWhether or not the session was continued from a previous session. E.g.
authenticatedis emitted when the user gets authenticated. It only gets emitted on a new session. Emits the email of the user who logged in. E.g.
Create a server:
var Jlc =var Jlsa =var http =var level =var shoe =var dnode =var db =var jlc =var jlsa =var server = httpvar sock =sock
Create a client:
var client =var myEmitter =myEmittermyEmittermyEmitter