@evo/user-info
TypeScript icon, indicating that this package has built-in type declarations

3.0.1 • Public • Published

user-info

Service for fetching user data that is currently logged in in the main app.

User information from the remote - UserData

UserData is the data returned from /remote/auth/info;

'id': <id>,
'full_name': <name>,
'email': <email>
'phone': <phone>,
'is_paid_company': <company>,
'company_id': <company>

usage

import { init, getUserInfo } from '@evo/user-info';

// you should call init on application start
init('http://my.example.com:5000');

const userInfo = await getUserInfo();

API

init(myHost: string, user: UserData): void

Initializes the service (myHost is required).

getUserInfo(): Promise<UserData>

Fetches remote info

Example:

import { getUserInfo } from "@evo/user-info"

const userInfo = await getUserInfo();

Readme

Keywords

none

Package Sidebar

Install

npm i @evo/user-info

Weekly Downloads

1,046

Version

3.0.1

License

ISC

Unpacked Size

11.6 kB

Total Files

12

Last publish

Collaborators

  • stoyanovk
  • lequan
  • zemlanin
  • alexander
  • seedofjoy
  • 041616
  • docccdev
  • orhideous
  • tailhook
  • hunson.abadeer
  • mark_tven
  • amostovenko
  • sadkovoy
  • himiranov
  • evo-kazymyrov