H1-credentials-helper-js
Installation
This library can be installed using package manager such as npm, or yarn, or compiled (transpiled) from sources.
npm
npm i @hyperone/credentials
yarn
yarn add @hyperone/credentials
Compiling from sources
-
Clone repository:
git clone https://github.com/hyperonecom/h1-credentials-helper-js
-
Continue to directory
cd h1-credentials-helper-js
-
Install dependencies
Yarn is the preffered way of getting dependencies.
yarn
-
Build project
yarn build
Library output should be saved to
dist
directory.
Providers
Passport provider
Passport provider is based on passport file which can be generated using h1-cli.
Usage
import { getPassportCredentialsHelper } from '@hyperone/credentials';
const authProvider = getPassportCredentialsHelper();
const jwt = authProvider.getToken('https://api.hyperone.com/v2');
Environment Variables
HYPERONE_PASSPORT_FILE
set passport file location