0.5.0 • Published 1 year ago

@everlution/citadel-web-sdk v0.5.0

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
1 year 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.5.0

1 year ago

0.4.0

1 year ago

0.3.0

1 year ago

0.2.0

1 year ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago