0.4.0 • Published 1 month ago

@everlution/citadel-web-sdk v0.4.0

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
1 month ago

Citadel Web SDK

Usage

import { CitadelClient } from '@everlution/citadel-web-sdk';

export const sso = new CitadelClient();

// Check is user is signed-in on the current domain/app:
if (!sso.hasLocalSession()) {
  sso.signIn({ redirect: new URL(new URL(window.location.href).origin) });
} else {
  console.log('already have session');

  // you can sign out user by using
  // sso.signOut()
}

Optionally you can use overlay for better UX like this:

import { CitadelClient, withOverlay } from '@everlution/citadel-web-sdk';

export const sso = new CitadelClient();

if (!sso.hasLocalSession()) {
  withOverlay(sso.signIn({ redirect: new URL(new URL(window.location.href).origin) }));
} else {
  console.log('already have session');

  // you can sign out user by using
  // withOverlay(sso.signOut());
}
0.4.0

1 month ago

0.3.0

2 months ago

0.2.0

2 months ago

0.1.2

11 months ago

0.1.1

12 months ago

0.1.0

12 months ago