You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@genesislcap/foundation-user

Package Overview
Dependencies
5
Maintainers
0
Versions
305
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@genesislcap/foundation-user

Genesis User


Version published
Maintainers
0
Created

Readme

Source

Genesis User

lerna TypeScript

foundation-user provides the User singleton, which always exists in either an anonymous or authenticated mode.

Get User reference

User is a singleton. You can access it via the DI container.

import { User } from '@genesislcap/foundation-user';
...
@User private user: User

...or via a utility if your app is not using decorators or the DI container.

import { getUser } from '@genesislcap/foundation-user';
...
private user = getUser();

User properties are decorated with @observable, meaning in FAST terms it's reactive, and you can bind to properties directly. For example, this.user.isAuthenticated. However, you can also monitor the user's authentication status using an event listener.

import type { UserAuthenticationChangeEvent } from '@genesislcap/foundation-user';
...
const unsubscribeUser = this.user.addAuthenticationChangeListener((event: UserAuthenticationChangeEvent) => {
  console.log('User authenticated?', event.detail); // < boolean === this.user.isAuthenticated
});

See the User API Docs for more information.

Installation

To enable this module in your application, follow the steps below.

  1. Add @genesislcap/foundation-user as a dependency in your package.json file. Whenever you change the dependencies of your project, ensure you run the $ npm run bootstrap command again. You can find more information in the package.json basics page.
{
  ...
  "dependencies": {
    ...
    "@genesislcap/foundation-user": "latest"
    ...
  },
  ...
}

API Docs

License

Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact Genesis Global for more details.

Licensed components

Genesis low-code platform

FAQs

Package last updated on 19 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc