@dudadev/ms-client-auth

1.4.4 • Public • Published

Microservices authentication client

Client to authenticate Duda's microservices' clients

Usage

import { create } from '@dudadev/ms-client-auth';

const auth = create();

function authListener(authDetails) {
	console.log(`Auth token: ${authDetails.value}`);
}

// Listen to auth changes
const cancelListener = auth.onAuth(authListener);
// Stop listening
cancelListener();

// Trigger authentication on demand
auth.authenticateServices()

// Set an interval to perform periodic authentication
auth.setAutoAuthInterval(5000); // This will cause the authenticator to authenticate every 5 seconds
// You can also create an auth instance with the interval
auth = create({ autoAuthInterval: 5000 });

Readme

Keywords

none

Package Sidebar

Install

npm i @dudadev/ms-client-auth

Weekly Downloads

108

Version

1.4.4

License

MIT

Unpacked Size

5.71 kB

Total Files

3

Last publish

Collaborators

  • dixiecarbonic
  • yoavporat
  • liady
  • russjeffery
  • idanen
  • hilakerer
  • sharon_rub
  • talkor
  • dannyr-duda
  • shira.weiss
  • roiekoper-duda
  • everett-duda