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

autentikigo

v0.0.7

Published

Generic authorization flow.

Downloads

9

Readme

Autentikigo

An authentication package.

Instalation

To install the autentikigo, use one of the following command:

  • npm: npm install autentikigo

Use

var autentikigo = require('autentikigo')

Register method

var register = await autentikigo.register(queryParams, connectionParams);

queryParams

Required parameters.

Tipo: object

  • uniqueId (string)
  • birthday (date)
  • email (string)
  • password (string)
  • cpfApiEndpoint (string)
  • cnpjApiEndpoint (string)

uniqueId

CPF/CNPJ of the user that will be registered.

birthday

User birthday.

email

User e-mail.

password

User password.

cpfApiEndpoint

Endpoint of CPF API (https://www.cpfcnpj.com.br/).

Exemplo
https://api.cpfcnpj.com.br/5ae973d7a997af13f0aaf2bf60e65803/2/

cnpjApiEndpoint

Endpoint of CNPJ API (https://www.cpfcnpj.com.br/).

Exemplo
https://api.cpfcnpj.com.br/5ae973d7a997af13f0aaf2bf60e65803/6/

connectionParams

Connection parameters (Required).

Tipo: object

  • connectionString (string)

connectionString

MongoDB connection string.

Exemplo
mongodb://127.0.0.1:27017/autentikigo

Login method

var login = await autentikigo.login(queryParams, connectionParams);

queryParams

Required parameters.

Tipo: object

  • user (string)
  • password (string)
  • projectId (string)
  • jwtSecret (string)
  • jwtRefreshSecret (string)

user

CPF, CNPJ, usernama or email of the user that will be authenticated.

password

User password.

projectId

Id of the application/project that wants to authenticate user.

jwtSecret

Secret to create the authentication token (JWT).

jwtRefreshSecret

Secret to create the authentication refresh token (JWT).

connectionParams

Connection parameters (Required).

Tipo: object

  • connectionString (string)

connectionString

MongoDB connection string.

Exemplo
mongodb://127.0.0.1:27017/autentikigo

Authorize method

var authorize = await autentikigo.authorizeProject(queryParams, connectionParams);

queryParams

Required parameters.

Tipo: object

  • userId (string)
  • acl (string)
  • verified (boolean)
  • projectId (string)

userId

Id of user that will be authorize application/project to use his data.

acl

User acl in the specifique application/project.

verified

Parameter that defines if user was verified.

projectId

Id of the application/project that wants to authenticate user.

connectionParams

Connection parameters (Required).

Tipo: object

  • connectionString (string)

connectionString

MongoDB connection string.

Exemplo
mongodb://127.0.0.1:27017/autentikigo

Generate recovery password token method

var generateRecoveryPasswordToken = await autentikigo.generateRecoveryPasswordToken(queryParams, connectionParams);

queryParams

Required parameters.

Tipo: object

  • email (string)
  • jwtSecret (string)

email

Email of the user who will recover the password.

jwtSecret

Secret to create the authentication token (JWT).

connectionParams

Connection parameters (Required).

Tipo: object

  • connectionString (string)

connectionString

MongoDB connection string.

Exemplo
mongodb://127.0.0.1:27017/autentikigo

Change password method

var changePassword = await autentikigo.changePassword(queryParams, connectionParams);

queryParams

Required parameters.

Tipo: object

  • password (string)
  • recoveryPasswordToken (string)
  • jwtSecret (string)

password

New password.

recoveryPasswordToken

Token to recovery password.

jwtSecret

Secret to create the authentication token (JWT).

connectionParams

Connection parameters (Required).

Tipo: object

  • connectionString (string)

connectionString

MongoDB connection string.

Exemplo
mongodb://127.0.0.1:27017/autentikigo

Middleware method

var middleware = await autentikigo.middleware(queryParams, connectionParams);

queryParams

Required parameters.

Tipo: object

  • token (string)
  • jwtSecret (string)
  • userId (string)
  • projectId (string)
  • roles (array)
  • endpoint (string)
  • method (string)

token

Authentication token (JWT) obtained in the login method.

jwtSecret

Secret to verify the authentication token (JWT).

userId

Id of user that will be authorize application/project to use his data.

projectId

Id of the application/project that wants to authenticate user.

roles

Array of roles (ACL).

Exemplo
[
    {
      "group": "user",
      "permissions": [
        {
          "resource": "users/*",
          "methods": [
            "POST",
            "GET",
            "PUT"
          ]
        }
      ]
    },
]

endpoint

Endpoint that user want to access.

method

Method to use in endpoint.

Exemplo
'POST'

connectionParams

Connection parameters (Required).

Tipo: object

  • connectionString (string)

connectionString

MongoDB connection string.

Exemplo
mongodb://127.0.0.1:27017/autentikigo

Get user info method

var userInfo = await autentikigo.getUserInfo(queryParams, connectionParams);

queryParams

Required parameters.

Tipo: object

  • token (string)
  • jwtSecret (string)
  • projectId (string)

token

Authentication token (JWT) obtained in the login method.

jwtSecret

Secret to verify the authentication token (JWT).

projectId

Id of the application/project that wants to authenticate user.

connectionParams

Connection parameters (Required).

Tipo: object

  • connectionString (string)

connectionString

MongoDB connection string.

Exemplo
mongodb://127.0.0.1:27017/autentikigo