@glow-xyz/glow-client

中文文档
1.5.2发布于 2026/10/25ISCTypeScriptCommonJS构建来源已验证近 30 天下载 6221

The @glow-xyz/glow-client gives you a client to interact with the Glow Desktop and Safari Extension from your website or dApp.

原始使用文档
文档目录4 节
  1. Installing
  2. Usage
  3. Differences with Existing Wallets
  4. Alternatives

@glow-xyz/glow-client

The @glow-xyz/glow-client gives you a client to interact with the Glow Desktop and Safari Extension from your website or dApp.

If you're building a website that interacts with Solana, you can use the @glow-xyz/glow-client to ask the user to:

  • connect their Solana wallet
  • sign messages
  • approve transactions

Installing

# npm
npm install @glow-xyz/glow-client

# yarn
yarn add @glow-xyz/glow-client

# pnpm
pnpm install @glow-xyz/glow-client

Usage

import { GlowClient } from "@glow-xyz/glow-client";

const glowClient = new GlowClient();

glowClient.on("update", () => {
  console.log("Current address", glowClient.address);
});

// Connect
const { address } = await glowClient.connect();

// Sign Message
const { signature_base64: sig1 } = await glowClient.signMessage({
  message_utf8: "Hi this is a message!",
});
const { signature_base64: sig2 } = await glowClient.signMessage({
  message_hex: "deadbeef", // You can specify different message formats
});

// Sign Transaction
// Transaction from @solana/web3.js
const transaction = Transaction.from(Buffer.from(str, "base64"));
await glowClient.signTransaction({
  transaction,
  network: Solana.Network.Devnet,
});

Differences with Existing Wallets

Setting the Network

Phantom and other wallets default to the Solana network chosen in the wallet's popup. This is a security vulnerability because it leads to simulations failing.

With Glow, we let the dApp specify which network the transaction is for. So when you call glowClient.signTransaction you also pass in the network parameter.

Localnet

Unfortunately, we aren't able to support Localnet at this time because we make RPC calls from our backend, not the client. Our backend cannot connect to your local machine.

Alternatives

The most popular project in the ecosystem is the @solana-labs/wallet-adapter which is great if you want to support every wallet in the ecosystem.

But if you want to just support Glow and have a lighter, easier API to work with, this is a useful library for you!

We also plan on adding more fun methods to the Glow JS SDK that other wallets probably won't support. So those methods will be found here and not in the @solana-labs/wallet-adapter.

版本与发布记录

@glow-xyz/glow-client 共发布 14 个版本,首次发布于 2022/07/04;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.5.2latest2026/10/2522 天前
1.5.12026/06/194 个月前
1.5.02024/11/162 年前
1.4.22022/12/053 年前
1.4.12022/10/174 年前
1.4.02022/10/104 年前

关于 @glow-xyz/glow-client 的常见问题

@glow-xyz/glow-client 是什么?

The @glow-xyz/glow-client gives you a client to interact with the Glow Desktop and Safari Extension from your website or dApp.

如何安装 @glow-xyz/glow-client?

在项目目录运行 npm install @glow-xyz/glow-client,或使用 pnpm add / yarn add / bun add。

@glow-xyz/glow-client 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@glow-xyz/glow-client 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@glow-xyz/glow-client 可以商用吗?

@glow-xyz/glow-client 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@glow-xyz/glow-client 的下载量有多少?

根据 npm 官方下载统计,@glow-xyz/glow-client 在 2026/10/17 – 2026/11/15 这 30 天内被下载 6,221 次,日均约 207 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@glow-xyz/glow-client 还在维护吗?

最新版本 1.5.2 发布于 2026/10/25(22 天前);至今共发布 14 个版本,其中过去 12 个月发布了 2 个;首次发布于 2022/07/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。