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 🙏

© 2026 – Pkg Stats / Ryan Hefner

authorify-client

v1.1.0

Published

Client for Authorify authorization and authentication system for REST server

Readme

Authorify Client

This is the client for our Authorify authentication and authorization middleware for a REST server.

Installation

Install authorify-client as usual:

$ npm install --save authorify-client

Usage

You can use authorify-client both in node and in browser environment.

Node

This client has the same approach of superagent and you can use it as shown below:

// dependencies
var fs = require('fs'),
    authorify = require('authorify-client')({
      host: 'localhost',
      debug: true,
      key: fs.readFileSync('clientCert.key'), 'utf8'),
      cert: fs.readFileSync('clientCert.cer'), 'utf8'),
      ca: fs.readFileSync('serverCA.cer'), 'utf8')
    }),
    uuid = require('node-uuid'),
    id = uuid.v4(),
    app = uuid.v4();

// set a configuration
authorify.set({
  host: 'localhost',    // host of your server
  port: 3000,           // port of your server
  id: id,               // a valid uuid
  app: app              // another valid uuid
});

// login
authorify.login('username', 'password', function(err, res) {
  authorify.post('/test')
    // send a message into the body
    .send({ name: 'alex', surname: 'smith' })
    .end(function(err, res) {
      if (!err) {
        // your logic here
      }
    });
});

Browser

To create a single file to use in browser environment use a simple script that uses browserify:

$ ./build.sh

and add the obtained authorify.js file to your html file:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>authorify-client example</title>
    </head>
    <body>
        <script src="authorify.js"></script>
        <script src="example.js"></script>
    </body>
</html>

The script example.js contanins your example code:

// you have a global authorify variable 
authorify.set({
  host: 'localhost',                            // host of your server
  port: 3000,                                   // port of your server
  id: 'ae92d22b-a9ab-458a-9850-0025dbf11fad',   // a valid uuid
  app: 'c983659a-9572-4471-a3a2-7d45b591d315'   // another valid uuid
});

// login
authorify.login('username', 'password', function(err, res) {
  authorify.post('/test')
    // send a message into the body
    .send({ name: 'alex', surname: 'smith' }))
    .end(function(err, res) {
      if (!err) {
        // your logic here
      }
    });
});

See Authorify test/browser folder to see more examples.

Run Tests

As usual we use mocha as test framework and you can run all tests simply typing:

$ npm test

For other tests (for node and browser) please read Authorify documentation and the local documentation into doc folder.

Documentation

To create your own documentation you must install JSDuck and type in your terminal:

$ cd /path-of-package
$ ./gen_doc.sh

See full documentation into doc folder.

Convention

The version number is laid out as: major.minor.patch and tries to follow semver as closely as possible but this is how we use our version numbering:

major

A major and possible breaking change has been made in the authorify core. These changes could be not backwards compatible with older versions.

minor

New features are added or a big change has happened with one of the third party libraries.

patch

A bug has been fixed, without any major internal and breaking changes.

Contributing

To contribute to the project follow the GitHub guidelines.

License

This program is released under a GNU Affero General Public License version 3 or above, which in summary means:

  • You can use this program for no cost.
  • You can use this program for both personal and commercial reasons.
  • You do not have to share your own program's code which uses this program.
  • You have to share modifications (e.g bug-fixes) you've made to this program.

For more convoluted language, see the LICENSE file.