# @toruslabs/solana-embed

> Embed script for solana blockchain

Latest version **3.0.1** (published 2025-08-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install @toruslabs/solana-embed
pnpm add @toruslabs/solana-embed
yarn add @toruslabs/solana-embed
bun add @toruslabs/solana-embed
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2025-08-13 |
| First published | 2021-10-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=20.x |
| Dependencies | 1 |
| Unpacked size | 252.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Torus Labs |
| Maintainers | torusresearch, chaitanyapotti, tetratorus, archit_web3, himanshunpm009 |
| Keywords | torus, wallet, Solana, embed, login, OAuth, crypto |

## Links

- npm: https://www.npmjs.com/package/@toruslabs/solana-embed
- Repository: https://github.com/torusresearch/solana-embed
- Homepage: https://github.com/torusresearch/solana-embed#readme
- Issues: https://github.com/torusresearch/solana-embed/issues
- npm.io page: https://npm.io/package/@toruslabs/solana-embed

## Dependencies (1)

- [@web3auth/ws-embed](https://npm.io/package/@web3auth/ws-embed.md) ^5.0.22

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

- 3.0.1 (latest) — 2025-08-13
- 3.0.0 — 2025-08-01
- 2.1.0 — 2024-04-09
- 2.0.0 — 2023-09-09
- 1.0.0 — 2023-05-23
- 0.3.4 — 2023-03-15
- 0.3.3 — 2023-02-08
- 0.3.2 — 2022-11-07
- 0.3.1 — 2022-11-07
- 0.3.0 — 2022-08-19
- 0.2.2 — 2022-06-13
- 0.2.1 — 2022-06-03
- 0.2.0 — 2022-05-20
- 0.1.6 — 2022-04-08
- 0.1.5 — 2022-02-24
- … 15 more at https://npm.io/package/@toruslabs/solana-embed/versions

## README

# Solana Embed (by Web3Auth)

[![npm version](https://badge.fury.io/js/%40toruslabs%2Fsolana-embed.svg)](https://badge.fury.io/js/%40toruslabs%2Fsolana-embed)
![npm](https://img.shields.io/npm/dw/@toruslabs/solana-embed)
[![minzip](https://img.shields.io/bundlephobia/minzip/@toruslabs/solana-embed?label=%22%22)](https://bundlephobia.com/result?p=@toruslabs/solana-embed)

> [Web3Auth](https://web3auth.io) 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 [Torus Documentation for Solana Embed](https://docs.tor.us/solana-wallet/api-reference/installation) to get started.

## 🔗 Installation

```shell
npm install --save @toruslabs/solana-embed
```

## ⚡ Quick Start

### Get your Client ID from Web3Auth Dashboard

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

![Web3Auth Dashboard - Torus Wallets](https://user-images.githubusercontent.com/6962565/187207779-9420f4ad-17e8-43fa-b578-0bc64f50e4d3.png)

## Initialize & Login

```ts
import Torus from "@toruslabs/solana-embed";

const torus = new Torus();
await torus.init();
await torus.login();
```

## 🩹 Examples

Checkout the examples `Solana Embed` in our [example directory.](https://github.com/torusresearch/solana-embed/tree/main/examples/vue-app)

## 🌐 Demo

Checkout the [Web3Auth Demo](https://demo-solana.tor.us/) to see how `Solana Embed` 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.

## Introduction

This module generates the javascript to include in a DApp via a script tag.
It creates an iframe that loads the Torus page and sets up communication streams between
the iframe and the DApp javascript context.

## Features

- Typescript compatible. Includes Type definitions

## Installation

### Bundling

This module is distributed in 3 formats

- `esm` build `dist/torus.esm.js` is es6 format
- `commonjs` build `dist/torus.cjs.js` in es5 format
- `umd` build `dist/torus.umd.min.js` in es5 format without polyfilling corejs minified

By default, the appropriate format is used for your specified usecase
You can use a different format (if you know what you're doing) by referencing the correct file

The cjs build is not polyfilled with core-js.
It is upto the user to polyfill based on the browserlist they target

### Directly in Browser

CDN's serve the non-core-js polyfilled version by default. You can use a different

jsdeliver

```js
<script src="https://cdn.jsdelivr.net/npm/@toruslabs/solana-embed"></script>
```

unpkg

```js
<script src="https://unpkg.com/@toruslabs/solana-embed"></script>
```

### Tips for NUXT

This is a plugin that works [only on the client side](https://nuxtjs.org/guide/plugins/#client-side-only). So please register it as a ssr-free plugin.

## Usage

Please refer to the [examples](examples) folder for details on usage using dynamic import.

## Rehydration

Torus uses `window.sessionStorage` to store user details.

So, if the user reloads the page, all his data would be rehydrated and the user doesn't need to log in.

The samples provided in the [examples](examples) folder illustrate the above case.

## Build

Ensure you have a `Node.JS` development environment setup:

```
git clone https://github.com/torusresearch/solana-embed.git
cd solana-embed
npm install
npm run build
```

To run tests:

```
npm run test:e2e:headful
npm run test:build-embed
```

entry-point: `index.js`

## Requirements

- This package requires a peer dependency of `@babel/runtime`
- Node 20+

## License

`solana-embed` is [MIT Licensed](LICENSE)

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