# @web3auth/node-sdk

> Node SDK for Web3Auth

Latest version **6.0.0** (published 2026-06-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install @web3auth/node-sdk
pnpm add @web3auth/node-sdk
yarn add @web3auth/node-sdk
bun add @web3auth/node-sdk
```

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.0.0 |
| Published | 2026-06-17 |
| First published | 2022-11-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.x |
| Dependencies | 11 |
| Unpacked size | 49.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Web3Auth |
| Maintainers | chaitanyapotti, archit_web3, himanshunpm009 |
| Keywords | web3auth, node, sdk, authentication, web3, blockchain, wallet, crypto |

## Links

- npm: https://www.npmjs.com/package/@web3auth/node-sdk
- npm.io page: https://npm.io/package/@web3auth/node-sdk

## Dependencies (11)

- [viem](https://npm.io/package/viem.md) ^2.52.2
- [@solana/keys](https://npm.io/package/@solana/keys.md) ^6.10.0
- [@web3auth/auth](https://npm.io/package/@web3auth/auth.md) ^11.8.1
- [@solana/signers](https://npm.io/package/@solana/signers.md) ^6.10.0
- [@web3auth/no-modal](https://npm.io/package/@web3auth/no-modal.md) ^11.2.0
- [@toruslabs/torus.js](https://npm.io/package/@toruslabs/torus.js.md) ^17.2.3
- [@toruslabs/constants](https://npm.io/package/@toruslabs/constants.md) ^16.1.1
- [@segment/analytics-node](https://npm.io/package/@segment/analytics-node.md) ^3.1.0
- [@toruslabs/http-helpers](https://npm.io/package/@toruslabs/http-helpers.md) ^9.0.0
- [@toruslabs/metadata-helpers](https://npm.io/package/@toruslabs/metadata-helpers.md) ^8.2.0
- [@toruslabs/fetch-node-details](https://npm.io/package/@toruslabs/fetch-node-details.md) ^16.1.1

## 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

- 6.0.0 (latest) — 2026-06-17
- 3.3.1-alpha.2 (next) — 2024-04-08
- 5.0.0 — 2025-09-10
- 4.1.0 — 2024-10-17
- 4.0.0 — 2024-09-19
- 3.3.0 — 2024-04-11
- 3.3.1-alpha.1 — 2024-04-08
- 3.3.1-alpha.0 — 2024-04-05
- 3.2.0 — 2023-11-30
- 3.1.0 — 2023-10-13
- 3.0.0 — 2023-09-12
- 2.0.1 — 2023-06-16
- 2.0.0 — 2023-06-16
- 1.1.0 — 2023-03-20
- 1.0.1 — 2023-01-10
- … 5 more at https://npm.io/package/@web3auth/node-sdk/versions

## README

# Web3Auth's Node.js SDK

[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lerna.js.org/)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
![npm](https://img.shields.io/npm/dw/@web3auth/node-sdk)

Web3Auth is where passwordless auth meets non-custodial key infrastructure for Web3 apps and wallets. By aggregating OAuth (Google, Twitter, Discord) logins, different wallets and innovative Multi Party Computation (MPC) - Web3Auth provides a seamless login experience to every user on your application.

## 📖 Documentation

Checkout the official [Web3Auth Documentation](https://web3auth.io/docs) and [SDK Reference](https://web3auth.io/docs/sdk/web-backend/) to get started!

## 💡 Features

- Plug and Play, OAuth based Web3 Authentication Service
- Fully decentralized, non-custodial key infrastructure
- End to end Whitelabelable solution
- Threshold Cryptography based Key Reconstruction
- Multi Factor Authentication Setup & Recovery (Includes password, backup phrase, device factor editing/deletion etc)
- Support for WebAuthn & Passwordless Login
- Support for connecting to multiple wallets
- DApp Active Session Management

...and a lot more

## ⚡ Quick Start

### Installation

```shell
npm install --save @web3auth/node-sdk
```

### Get your Client ID from Web3Auth Dashboard

Hop on to the [Web3Auth Dashboard](https://dashboard.web3auth.io/) and create a new project. Use the Client ID of the project to start your integration.

![Web3Auth Dashboard](https://web3auth.io/docs/assets/images/project_plug_n_play-89c39ec42ad993107bb2485b1ce64b89.png)

### Initialize Web3Auth

```js
import { Web3Auth } from "@web3auth/node-sdk";
import { CHAIN_NAMESPACES } from "@web3auth/no-modal";

const web3auth = new Web3Auth({
  clientId: "", // Get your Client ID from Web3Auth Dashboard
  web3AuthNetwork: "sapphire_mainnet",
  chains: [
    {
      chainNamespace: CHAIN_NAMESPACES.EIP155,
      displayName: "ETH Mainnet",
      blockExplorerUrl: "https://etherscan.io",
      ticker: "ETH",
      tickerName: "Ethereum",
      chainId: "0x1",
      rpcTarget: "https://rpc.ankr.com/eth",
    },
  ],
});

await web3auth.init();
```

### Login your User

`connect()` returns a `WalletResult` containing a `provider`, a typed `signer`, and the `chainNamespace`:

```js
const result = await web3auth.connect({
  authConnectionId: "your-auth-connection-id",
  idToken: "JWT Token",
  userId: "user@example.com",
});

// result.provider  — the underlying key provider
// result.signer    — a chain-specific signer (WalletClient for EIP155, TransactionSigner for Solana, null for OTHER)
// result.chainNamespace — "eip155" | "solana" | "other"
```

### WalletResult

`connect()` returns a discriminated union based on `chainNamespace`:

| `chainNamespace` | `signer` type | Description |
|---|---|---|
| `eip155` | `WalletClient` (viem) | EVM-compatible chains |
| `solana` | `TransactionSigner` (@solana/signers) | Solana chains |
| `other` | `null` | Other chain namespaces |

```ts
if (result.chainNamespace === CHAIN_NAMESPACES.EIP155) {
  // result.signer is a viem WalletClient
  const address = result.signer.account?.address;
} else if (result.chainNamespace === CHAIN_NAMESPACES.SOLANA) {
  // result.signer is a @solana/signers TransactionSigner
  const address = result.signer.address;
}
```

## Migration from v4.x

### Breaking changes in v5.0.0

- **`init()` no longer takes parameters.** Chain configuration is now passed via the `chains` option in the constructor. Remove the `provider` parameter from `init()`.
- **`chains` is required.** Pass at least one `CustomChainConfig` in the constructor.
- **`connect()` returns `WalletResult` instead of a raw provider.** Access the provider via `result.provider` and a chain-typed signer via `result.signer`.
- **`verifier` / `verifierId` renamed.** Use `authConnectionId` and `userId` instead.
- **Node.js 22+ required.**

### Before (v4.x)

```js
const provider = new EthereumPrivateKeyProvider({ config: { chainConfig } });
web3auth.init({ provider });

const provider = await web3auth.connect({
  verifier: "verifier-name",
  verifierId: "user@example.com",
  idToken: "JWT Token",
});
```

### After (v5.0.0)

```js
const web3auth = new Web3Auth({
  clientId: "...",
  web3AuthNetwork: "sapphire_mainnet",
  chains: [{ chainNamespace: CHAIN_NAMESPACES.EIP155, chainId: "0x1", rpcTarget: "...", /* ... */ }],
});
await web3auth.init();

const result = await web3auth.connect({
  authConnectionId: "your-auth-connection-id",
  userId: "user@example.com",
  idToken: "JWT Token",
});
// result.provider — same provider as before
// result.signer  — typed signer for the chain
```

## ⏪ Requirements

- Node 22+

## 🩹 Examples

Checkout the examples for your preferred blockchain and platform in our [examples repository](https://github.com/Web3Auth/examples/)

## 🌐 Demo

Checkout the [Web3Auth Demo](https://demo-app.web3auth.io/) to see how Web3Auth can be used in your application.

## 💬 Troubleshooting and Discussions

- Have a look at our [GitHub Discussions](https://github.com/Web3Auth/Web3Auth/discussions?discussions_q=sort%3Atop) to see if anyone has any questions or issues you might be having.
- Checkout our [Troubleshooting Documentation Page](https://web3auth.io/docs/troubleshooting) to know the common issues and solutions
- Join our [Discord](https://discord.gg/web3auth) to join our community and get private integration support or help with your integration.

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