# @j2inn/scram

> TypeScript client SCRAM authentication library

Latest version **2.0.0** (published 2025-06-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install @j2inn/scram
pnpm add @j2inn/scram
yarn add @j2inn/scram
bun add @j2inn/scram
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2025-06-10 |
| First published | 2022-02-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 39.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Gareth Johnson |
| Maintainers | alexbadonj2, greta.d, jaxgzz, hecsalazarf, garethj99, shal1y, quinatzins, hishame, j2aarons, riccardol, sarahp, noerojas, ionute, matteoz, chrismarshall, christiang, elitescientist, kian.badie |
| Keywords | j2, client, scram, authentication, typescript |

## Links

- npm: https://www.npmjs.com/package/@j2inn/scram
- npm.io page: https://npm.io/package/@j2inn/scram

## Dependencies (1)

- [sjcl](https://npm.io/package/sjcl.md) ^1.0.8

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2025-06-10
- 1.0.0-beta.1 (beta) — 2022-02-11
- 1.0.6 — 2022-07-06
- 1.0.5 — 2022-07-04
- 1.0.4 — 2022-03-03
- 1.0.3 — 2022-02-15
- 1.0.2 — 2022-02-14
- 1.0.1 — 2022-02-14
- 1.0.0 — 2022-02-14

## README

# TypeScript client SCRAM authentication library

This library is used by clients wanting to authenticate with servers that use SCRAM (Salted Challenge Response Authentication Mechanism).

For more information on SCRAM, please see the [specification](https://datatracker.ietf.org/doc/html/rfc5802#page-8).

## Installation

    npm install @j2inn/scram

## Use

    import authenticate from '@j2inn/scram'

    ...

    async function onAuthenticate(username: string, password: string): void {
      await authenticate({
        username,
        password,
        uri: new URL('/auth', window.location.href)
      })
    }

An alternative `fetch` parameter can be specified if this library is used in a NodeJS environment...

    import fetch from 'node-fetch'
    import authenticate from '@j2inn/scram'

    ...

    async function onAuthenticate(username: string, password: string, uri: string): void {
      await authenticate({
        username,
        password,
        fetch,
        uri
      })
    }

## Links

-   [SCRAM specification](https://datatracker.ietf.org/doc/html/rfc5802#page-8)
-   [SCRAM over SASL](http://www.alienfactory.co.uk/articles/skyspark-scram-over-sasl)

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