0.0.7 • Published 1 year ago

apigee-auth-jwt v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Apigee Auth JWT

NPM Version NPM Downloads GitHub issues GitHub forks

Description

The apigee-auth-jwt library provides a simple and efficient way to generate authentication tokens and add authorization headers for requests to Apigee. It also includes a cache system to improve performance by reducing the number of token requests made to the server.

Installation

You can install the library via npm:

npm i apigee-auth-jwt

Usage

Generate token

To generate a token, use the getToken function:

const { getToken }  = require('apigee-auth-jwt');
const token = await getToken('https://myhost.com','client_key','client_secret');

Generate Axios Client with Authorization Header

To generate an Axios client with the authorization header, use the axiosAuth function:

const { axiosAuth }  = require('apigee-auth-jwt');
const axios = await axiosAuth('https://myhost.com','client_key','client_secret');

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Contributing

Contributions are always welcome! Please feel free to submit a pull request or open an issue if you encounter any problems or have suggestions for improvement.

0.0.5

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago