0.2.9 • Published 3 months ago

@indec/heimdall v0.2.9

Weekly downloads
8
License
MIT
Repository
-
Last release
3 months ago

Heimdall

Installation

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

Examples

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;

try {
    const users = await UserService.fetchAll();
    console.log(users);
} catch (err) {
    console.error(err);
}
0.2.9

3 months ago

0.2.8

5 years ago

0.2.8-next.1

5 years ago

0.2.8-next.0

6 years ago

0.2.7

6 years ago

0.2.7-next.0

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.0.1-beta.9

6 years ago

0.0.1-beta.8

6 years ago

0.2.3

6 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.1-beta.7

7 years ago

0.0.1-beta.6

7 years ago

0.0.1-beta.5

7 years ago

0.0.1-beta.4

7 years ago

0.0.1-beta.3

7 years ago

0.0.1-beta.2

7 years ago

0.0.1-beta.1

7 years ago

0.0.1-beta.0

7 years ago