# aesirx-sso

> ## Installation

Latest version **1.6.4** (published 2025-11-14) · GPL-3.0-only license · 0 weekly downloads

## Install

```sh
npm install aesirx-sso
pnpm add aesirx-sso
yarn add aesirx-sso
bun add aesirx-sso
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.6.4 |
| Published | 2025-11-14 |
| First published | 2022-12-22 |
| Weekly downloads | 0 |
| License | GPL-3.0-only |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 34 |
| Unpacked size | 1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | AesirX |
| Maintainers | jatitoam, aesirx |

## Links

- npm: https://www.npmjs.com/package/aesirx-sso
- Repository: https://github.com/aesirxio/sso
- Homepage: https://github.com/aesirxio/sso#readme
- Issues: https://github.com/aesirxio/sso/issues
- npm.io page: https://npm.io/package/aesirx-sso

## Dependencies (34)

- [yup](https://npm.io/package/yup.md) ^1.3.2
- [viem](https://npm.io/package/viem.md) ^1.0.0
- [axios](https://npm.io/package/axios.md) ^1.7.7
- [react](https://npm.io/package/react.md) ^18.2.0
- [wagmi](https://npm.io/package/wagmi.md) ^1.3.2
- [bowser](https://npm.io/package/bowser.md) ^2.11.0
- [dotenv](https://npm.io/package/dotenv.md) ^16.4.5
- [ethers](https://npm.io/package/ethers.md) ^6.7.1
- [formik](https://npm.io/package/formik.md) ^2.4.4
- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [bootstrap](https://npm.io/package/bootstrap.md) ^5.3.3
- [cross-env](https://npm.io/package/cross-env.md) ^7.0.3
- [socket.io](https://npm.io/package/socket.io.md) ^4.7.5
- [aesirx-lib](https://npm.io/package/aesirx-lib.md) ^2.1.2
- [reactstrap](https://npm.io/package/reactstrap.md) ^9.2.0
- [@wagmi/core](https://npm.io/package/@wagmi/core.md) ^1.3.8
- [query-string](https://npm.io/package/query-string.md) ^8.1.0
- [react-spinners](https://npm.io/package/react-spinners.md) ^0.13.8
- [react-toastify](https://npm.io/package/react-toastify.md) ^9.1.3
- [react-bootstrap](https://npm.io/package/react-bootstrap.md) ^2.8.0
- [@web3modal/react](https://npm.io/package/@web3modal/react.md) ^2.7.0
- [socket.io-client](https://npm.io/package/socket.io-client.md) ^4.7.2
- [friendly-challenge](https://npm.io/package/friendly-challenge.md) ^0.9.13
- [@concordium/web-sdk](https://npm.io/package/@concordium/web-sdk.md) 7.1.0
- [@web3modal/ethereum](https://npm.io/package/@web3modal/ethereum.md) ^2.7.0
- [react-device-detect](https://npm.io/package/react-device-detect.md) ^2.2.3
- [react-secure-storage](https://npm.io/package/react-secure-storage.md) ^1.3.2
- [@concordium/react-components](https://npm.io/package/@concordium/react-components.md) 0.6.1
- [@fingerprintjs/fingerprintjs](https://npm.io/package/@fingerprintjs/fingerprintjs.md) 3.4.2
- [@fortawesome/react-fontawesome](https://npm.io/package/@fortawesome/react-fontawesome.md) ^0.2.0
- [react-lazy-load-image-component](https://npm.io/package/react-lazy-load-image-component.md) ^1.6.0
- [@fortawesome/fontawesome-svg-core](https://npm.io/package/@fortawesome/fontawesome-svg-core.md) ^6.4.2
- [@fortawesome/free-solid-svg-icons](https://npm.io/package/@fortawesome/free-solid-svg-icons.md) ^6.4.2
- [@concordium/browser-wallet-api-helpers](https://npm.io/package/@concordium/browser-wallet-api-helpers.md) 3.0.1

## Recent versions

- 1.6.4 (latest) — 2025-11-14
- 1.6.3 — 2025-11-13
- 1.6.2 — 2025-11-13
- 1.6.1 — 2025-11-03
- 1.6.0 — 2025-09-10
- 1.5.1 — 2024-12-24
- 1.5.0 — 2024-10-09
- 1.4.18 — 2024-10-02
- 1.4.17 — 2024-08-23
- 1.4.16 — 2024-08-16
- 1.4.15 — 2024-08-12
- 1.4.14 — 2024-08-09
- 1.4.13 — 2024-07-24
- 1.4.12 — 2024-07-12
- 1.4.11 — 2024-06-05
- … 30 more at https://npm.io/package/aesirx-sso/versions

## README

# Integration SSO

## Installation

`npm i aesirx-sso`

#### Usage in SSR site

1. Download sso.js from [https://github.com/aesirxio/sso/releases/latest](https://github.com/aesirxio/sso/releases/latest)
1. copy `sso.js` to your project
1. Add script to `<head>`:

```
<script>
  window.aesirxEndpoint="https://example.com"
  window.aesirxClientSecret="[Replace this with the provided SSO CLIENT ID]"
  window.aesirxClientID="[Replace this with the provided SSO CLIENT SECRET]"
  window.aesirxAllowedLogins=['concordium', 'metamask', 'regular']
</script>
<script async defer src="YOUR_PROJECT_PATH/sso.js"></script>
```

1. `SSO CLIENT ID` replace this with the provided `SSO CLIENT ID` from https://dapp.shield.aesirx.io/licenses
2. `SSO CLIENT SECRET` replace this with the provided `SSO CLIENT SECRET` from https://dapp.shield.aesirx.io/licenses
3. `aesirxAllowedLogins` are for which logins do you want to use and you have wallets set up

- `concordium` - Concordium wallet login
- `metamask` - Metamask wallet login
- `regular` - Regular login to your site

##### Create button with window.handleSSO()

```
<script>
  const onGetData = async (response) => {
    //response is a Object that return from SSO, you can use it to handle Authentication in your Site
  };
  const onClickSSO = async () => {
    await window.handleSSO(onGetData);
  };
</script>
<button onclick="onClickSSO()"> SSO Login </button>

```

#### Usage in ReactJS

##### Add the environment variable file (`.env`)

```
REACT_APP_SSO_CLIENT_ID=[Replace this with the provided SSO CLIENT ID from https://dapp.shield.aesirx.io/licenses]
REACT_APP_SSO_CLIENT_SECRET=[Replace this the provided SSO CLIENT SECRECT from https://dapp.shield.aesirx.io/licenses]
```


##### Using `<SSOButton />` to create Login Button

you can pass `className`, `text`, `options` props and `onGetData` function to control it

`options` are for which logins do you want to use and you have wallets set up:

- `concordium` - Concordium wallet login
- `metamask` - Metamask wallet login
- `regular` - Regular login to your site

```
import { SSOButton } from 'aesirx-sso';

  const onGetData = async (response) => {
    //response is a Object that return from SSO, you can use it to handle Authentication in your App
    /*
    Example:
      const authService = new AesirxAuthenticationApiService();
      await authService.setTokenUser(response, false);
      Storage.setItem('auth', true);
    */
  };

 <SSOButton
    className="btn w-100 fw-medium btn-success position-relative d-flex align-item-center justify-content-center mt-3"
    text={"SSO Login"}
    onGetData={onGetData}
    options={['concordium', 'metamask', 'regular']}
/>
```

#### Usage in NextJS

##### Add the environment variable file (`.env`)

```
NEXT_PUBLIC_SSO_CLIENT_ID=[Replace this with the provided SSO CLIENT ID from https://dapp.shield.aesirx.io/licenses]
NEXT_PUBLIC_SSO_CLIENT_SECRET=[Replace this the provided SSO CLIENT SECRECT from https://dapp.shield.aesirx.io/licenses]
```

##### Using `<SSOButton />` to create Login Button

you can pass `className`, `text` props and `onGetData` function to control it

`options` are for which logins do you want to use and you have wallets set up:

- `concordium` - Concordium wallet login
- `metamask` - Metamask wallet login
- `regular` - Regular login to your site

```
import { SSOButton } from 'aesirx-sso';

  const onGetData = async (response) => {
    //response is a Object that return from SSO, you can use it to handle Authentication in your App
    /*
    Example:
       await updateUserData(response.access_token);
      redirectProfile(response.access_token);
    */
  };

 <SSOButton
    className="btn w-100 fw-medium btn-success position-relative d-flex align-item-center justify-content-center mt-3"
    text={"SSO Login"}
    onGetData={onGetData}
    options={['concordium', 'metamask', 'regular']}
/>
```

---
_Source: https://npm.io/package/aesirx-sso · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
