# @dcl/single-sign-on-client

> Code that abstracts interaction with the single sign on iframe.

Latest version **3.0.1** (published 2026-06-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @dcl/single-sign-on-client
pnpm add @dcl/single-sign-on-client
yarn add @dcl/single-sign-on-client
bun add @dcl/single-sign-on-client
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2026-06-02 |
| First published | 2023-08-02 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22.0.0 |
| Dependencies | 1 |
| Unpacked size | 19.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Decentraland |
| Maintainers | decentralandbot, imazzara |
| Keywords | single-sign-on, sso, identity, decentraland |

## Links

- npm: https://www.npmjs.com/package/@dcl/single-sign-on-client
- Repository: https://github.com/decentraland/core-libs
- npm.io page: https://npm.io/package/@dcl/single-sign-on-client

## Dependencies (1)

- [@dcl/crypto](https://npm.io/package/@dcl/crypto.md) 3.7.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 3.0.1 (latest) — 2026-06-02
- 2.0.1-6816473715.commit-7f68a29 (next) — 2023-11-09
- 2.0.0 — 2023-11-06
- 2.0.0-6775866698.commit-154e7ea — 2023-11-06
- 0.1.0 — 2023-08-31
- 0.0.15-6041282590.commit-bd20ea9 — 2023-08-31
- 0.0.14 — 2023-08-30
- 0.0.14-6027560978.commit-25bb064 — 2023-08-30
- 0.0.13 — 2023-08-14
- 0.0.13-5856752951.commit-3772ac8 — 2023-08-14
- 0.0.12 — 2023-08-08
- 0.0.12-5802940658.commit-4220dde — 2023-08-08
- 0.0.12-5787024695.commit-01e4c74 — 2023-08-07
- 0.0.11 — 2023-08-07
- 0.0.11-5786367821.commit-fa8809f — 2023-08-07
- … 20 more at https://npm.io/package/@dcl/single-sign-on-client/versions

## README

# @dcl/single-sign-on-client

Stores, retrieves and clears a [Decentraland Identity](https://github.com/decentraland/decentraland-crypto) in the browser's `localStorage`.

Migrated into the `core-libs` monorepo from the legacy [`single-sign-on-client`](https://github.com/decentraland/single-sign-on-client) repository.

> **Note:** as of `3.0.0` this library no longer loads the Single Sign On iframe/webapp (and no longer exposes the `SingleSignOn` singleton or connection-data helpers from `2.0.0`). It reads and writes the identity directly from the consuming application's own `localStorage`, so the identity is scoped to the current origin and is **not** shared across Decentraland domains.

## Install

```bash
pnpm add @dcl/single-sign-on-client
```

## Usage

```ts
import * as SingleSignOn from '@dcl/single-sign-on-client'
import { Authenticator, AuthIdentity } from '@dcl/crypto'

const address: string = '0x...'

const identity: AuthIdentity = await Authenticator.initializeAuthChain(address, ...)

// Persist the identity (ignored if it is already expired).
SingleSignOn.storeIdentity(address, identity)

// Read it back. Returns null when missing, malformed or expired (and clears it in the latter cases).
const storedIdentity: AuthIdentity | null = SingleSignOn.getIdentity(address)

// Remove it.
SingleSignOn.clearIdentity(address)
```

`address` must be a valid Ethereum address; otherwise these functions throw. All three operate synchronously on `localStorage`.

### Back-compat aliases

The `localStorage`-prefixed names from the `0.1.x` line are still exported as aliases, so existing consumers can upgrade without code changes:

```ts
import {
  localStorageGetIdentity, // === getIdentity
  localStorageStoreIdentity, // === storeIdentity
  localStorageClearIdentity // === clearIdentity
} from '@dcl/single-sign-on-client'
```

Prefer the unprefixed names in new code.

---
_Source: https://npm.io/package/@dcl/single-sign-on-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
