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

tokenn-js-sdk

v1.0.4

Published

Tokenn JS SDK for securing your apps with api keys system

Downloads

7

Readme

Tokenn app security JS SDK

Token is under construction, coming soon

This is the JS SDK for Tokenn. We help you secure your applications by letting you generate access tokens for them.

Installation

Node and Browserify

Simply install the library with $ npm i --save tokenn-js-sdk

NOTE: Take into account that security problems may rise if you use this library in the browser, so we do not encourage, nor we make responsible for any data loss derived from the utilization of the library in the browser.

The concept

Your app or API need security. Here's how it looks when you create an API:

How it works

As you can see, intruders, as well as your clients and off course yourself can access your App/API.

One of the most common ways to give them security is to enable an API key system. With that system, you would avoid intruders in your application, by verifying if they have an API Key to use it.

In more technical words, with that API key system, you would validate that only permitted API keys can access your service.

The following is how it looks after securing your app with an API key system:

After installing

As you can see, now intruders, who do not have an Api Key for using your application cannot access it. Also, notice that we added Application Clients and Application Admin. With Tokenn, you can differentiate the applications that are going to access your app, and let other people create an API for your APP, Cool! So in this case, you would have your own API key for using your app, and you can generate as many API keys you want and give them to other people/apps/apis that are going to use your app.

Fortunately, there's Tokenn. With Tokenn you can easily get that API key system for your server, and validate each request made to your app, so it always stays secure.

Utilization

Check before using Tokenn js sdk:

  • You have a Tokenn app created
  • You have a Tokenn apiKey

Are you missing anything? (support coming soon)

// include the library
let Tokenn = require('tokenn-js-sdk').Tokenn;
Tokenn.initialize(YOUR_APP_ID, YOUR_TOKENN_API_KEY);

Validating your client's api key:

//first initialize the library

let yourApiUserAppId  = "13123";
let yourApiKeyForYourApp = "1231231";

Tokenn.validateApiKey(yourApiUserAppId, yourApiKeyForYourApp)
.then(function(validity){
  // validity = {valid:true|false}
  if(validity.valid){
    // then the request made to your app was valid
  } else {
    // the app request on your app was not valid
  }
}, function(error){
  // an error has occurred
})

Credits

Thanks to FlatIcon for all the cool icons used in this documentation (http://flaticon.com)