NodeJS library for interfacing with Auth Rocket.
Authrocket.js requires including jQuery and is therefore not a useful solution for running on NodeJS or within a front end project that doesn't use jQuery. Also, the API for the default AuthRocket library only provides methods for LoginRocket actions as it is for client side usage only.
Warning: Not officially supported by Auth Rocket.
- Install through npm:
npm install --save authrocket
- Import AuthRocket:
NodeJS
var AuthRocket = require('authrocket');
ES6
import AuthRocket from 'authrocket';
Browser
<script src="node_modules/authrocket/dist/authrocket.js"></script>
<!--
Also available through CDN using:
<script src="http://cdn.prue.io/authrocket/latest/authrocket.js"></script>
-->
- Create a new AuthRocket instance:
//Create new authrocket instance with authrocket.js URL
var authrocket = new AuthRocket({jsUrl: 'https://zzzzzzzzz.e1.loginrocket.com/v1/'});
Config variables can be set when you are creating your AuthRocket instance or through environment variables. Using environment variables is suggested for variables that should be kept private, such as your JWT secret.
Options Variable: jsUrl
Environment Variable: AUTHROCKET_JS_URL
Options Variable: accountId
Environment Variable: AUTHROCKET_ACCOUNT_ID
Options Variable: apiKey
Environment Variable: AUTHROCKET_API_KEY
Options Variable: realmId
Environment Variable: AUTHROCKET_REALM_ID
Options Variable: apiUrl
Environment Variable: AUTHROCKET_API_URL
Options Variable: jwtSecret
Environment Variable: AUTHROCKET_JWT_SECRET