@indec/heimdall

## Instalation

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@indec/heimdall
Minified + gzip package size for @indec/heimdall in KB

Readme

Heimdall

Instalation

npm install @indec/heimdall

Configuration

Add the following environment variables:

AUTH_ENDPOINT=http://localhost:5000
AUTH_CLIENT_ID=<your app client_id>
AUTH_CLIENT_SECRET=<your app secret>
GRANT_TYPE=client_credentials

Example

Login on client side

import {LoginService} from '@indec/heimdall/client';

// ENDPOINT constant is your heimdall server. i.e: http://localhost:5000
const loginService = new LoginService(ENDPOINT);
const token = await loginService.login(username, password)

Clean user session

import {TokenService} from '@indec/heimdall/client';

TokenService.clear();

Listing users

List your app's users on server side:

const {UserService} = require('@indec/heimdall').services;
UserService.fetchAll.then(
    users => console.log(users)
).catch(
    err => console.error(err)
)

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.