https://github.com/hyperonecom/h1-credentials-helper-js
https://github.com/hyperonecom/h1-credentials-helper-js
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hyperonecom/h1-credentials-helper-js
- Owner: hyperonecom
- License: mit
- Created: 2020-12-07T12:30:59.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-07-25T15:25:02.000Z (almost 3 years ago)
- Last Synced: 2025-03-06T10:45:40.827Z (3 months ago)
- Language: TypeScript
- Size: 267 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# H1-credentials-helper-js
## Installation
This library can be installed using package manager such as
[npm](https://www.npmjs.com/get-npm), or [yarn](https://yarnpkg.com/),
or compiled (transpiled) from sources.### npm
```shell
npm i @hyperone/credentials
```### yarn
```shell
yarn add @hyperone/credentials
```### Compiling from sources
1. Clone repository:
```shell
git clone https://github.com/hyperonecom/h1-credentials-helper-js
```2. Continue to directory
```shell
cd h1-credentials-helper-js
```3. Install dependencies
[Yarn](https://yarnpkg.com/) is the preffered way of getting dependencies.
```shell
yarn
```4. Build project
```shell
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](https://github.com/hyperonecom/h1-cli).
#### Usage
```typescript
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