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

@anzar-auth/client

v1.5.11

Published

Anzar is a lightweight authentication and authorization framework that runs as a separate microservice

Downloads

597

Readme

Anzar SDK Documentation

Install The Typescript SDK

In a ts project run the following command to install the anzar package.

npm

$ npm install @anzar-auth/client

pnpm

$ pnpm install @anzar-auth/client

yarn

$ yarn add @anzar-auth/client

Create Anzar Auth Instance

if you are using vite as a bundler, add this to your vite.config.js

import yaml from "@rollup/plugin-yaml";

export default {
  plugins: [yaml()],
};
$ npm install -D @rollup/plugin-yaml

in your main entry file (main.ts for example), import Anzar and create your auth instance

// Initialize once at application startup
// The SDK will communicate with your Anzar container at the configured api_url
import { Anzar } from "@anzar-auth/client";
import anzarConfig from "anzar.yml";

const anzar = new Anzar(anzarConfig);

⚠️ Note Choose your token storage adapter

import { LocalStorage } from "@anzar-auth/client/adapters";

const anzar = new Anzar(anzarConfig, {
    storage: new LocalStorage(),
});

Basic Usage

Anzar provides authentication support for email and password.

📝 Note: Other methods of authentication will be implemented later

Sign Up

To sign up a user you need to call the method register with the user's information.

import { AnzarError, type AuthResult, ErrorCode } from "@anzar-auth/client/types";

try {
    const data: AuthResult = await anzar.Auth.register({ username, email, password });
    console.log(data);
} catch (e) {
    if (e instanceof AnzarError) {
      if (e.code === ErrorCode.InvalidCredentials) {
        console.log(e.message);
      }
      else if (e.code === ErrorCode.AccountNotVerified) {
        console.log(e.message);
      }
    }
}

📝 Note: By default, the users are automatically signed in after they successfully sign up. Disabling this behavior will be implemented later

Sign In

To sign in a user you need to call the method login.

import { AnzarError, type AuthResult, ErrorCode } from "@anzar-auth/client/types";

try {
    const data: AuthResult = await anzar.Auth.login({ email, password });
    console.log(data);
} catch (e) {
    if (e instanceof AnzarError) {
      if (e.code === ErrorCode.InvalidCredentials) {
        console.log(e.message);
      }
      else if (e.code === ErrorCode.AccountNotVerified) {
        console.log(e.message);
      }
    }
}