npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

authrocket-node

v0.2.0

Published

Library for interfacing with AuthRocket service on server-side (Node.js).

Downloads

11

Readme

AuthRocket

NPM version NPM downloads Build Status Dependency Status Code Climate Code Coverage License Code Style

NodeJS library for interfacing with Auth Rocket.

Why Not Use AuthRocket's authrocket.js?

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.

Docs Page

About this package

First, this is fork of another package authrocket, original package can be used without problems only on client-side (in browser), due to XMLHttpRequest dependency. Code changed, to work on server-side. Also some improvements added.

####Changes over original package:

  1. list method of all entities added (not supported before).
  2. webpack removed, right now library not compiled to 1 big file with all dependencies, which is better on server-side.
  3. superagent package removed, instead of this request-promise added, which is powerful on server-side.
  4. generatePasswordToken and resetPasswordWithToken methods added to Users
  5. reset method added to Realms
  6. JwtKeys APIs added.
  7. Bug with Sessions url fixed
  8. Server-side authentication (without LoginRocket) by password and by token added

Getting Started

  1. Install through npm: npm install --save authrocket
  2. 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>
-->
  1. Create a new AuthRocket instance:
//Create new authrocket instance with authrocket.js URL
var authrocket = new AuthRocket({jsUrl: 'https://zzzzzzzzz.e1.loginrocket.com/v1/'});

Supporting entities

List of supporting entities:

  • Realms
  • Users
  • Credentials
  • SignupTokens
  • Orgs
  • Memberships
  • AuthProviders
  • ConnectedApps
  • Hooks
  • Sessions
  • Events
  • Notifications
  • JwtKeys

All this entities has methods:

  • list - return a list of entities
  • get - return a entity
  • add - create a new entity
  • update - update a entity
  • remove - remove a entity

Configuration

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.

LoginRocket capabilities (Login/Logout/Signup)

authrocket.js URL

Options Variable: jsUrl

Environment Variable: AUTHROCKET_JS_URL

Management Functionality (usually server side)

Account ID

Options Variable: accountId

Environment Variable: AUTHROCKET_ACCOUNT_ID

API key

Options Variable: apiKey

Environment Variable: AUTHROCKET_API_KEY

Realm Id

Options Variable: realmId

Environment Variable: AUTHROCKET_REALM_ID

API URL

Options Variable: apiUrl

Environment Variable: AUTHROCKET_API_URL

Other vars

JWT Secret

Options Variable: jwtSecret

Environment Variable: AUTHROCKET_JWT_SECRET