← 返回
安全合规 Key 中文

Xaman Wallet Integration

Integrate Xaman wallet SDK to authenticate users, connect wallets, request XRP payments, and manage sessions on the XRP Ledger.
集成 Xaman 钱包 SDK,实现用户身份验证、钱包连接、XRP 支付请求及 XRP Ledger 会话管理。
harleyscodes
安全合规 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 787
下载
💾 10
安装
1
版本
#latest

概述

Xaman Wallet Integration

Quick Start

  1. Load the SDK (in layout.tsx or HTML head):
  2. <script src="https://xumm.app/assets/cdn/xumm-oauth2-pkce.min.js"></script>
    
  1. Initialize and connect:
  2. const XummPkce = (window as any).XummPkce;
    const xumm = new XummPkce(API_KEY, {
      redirectUrl: window.location.origin + "/dashboard"
    });
    
    // Listen for auth events
    xumm.on("success", async (state) => {
      const account = (await xumm.state())?.me?.account;
      console.log("Connected:", account);
    });
    
    // Start auth flow (opens popup)
    await xumm.authorize();
    

API Key

Get your API key from: https://xumm.app/dashboard/developer

Environment variable: NEXT_PUBLIC_XAMAN_API_KEY

Key Methods

  • new XummPkce(apiKey, options) - Initialize SDK
  • xumm.authorize() - Start OAuth flow, opens Xaman app
  • xumm.state() - Get current user session
  • xumm.logout() - Clear session
  • xumm.on("success", callback) - Listen for successful auth
  • xumm.on("error", callback) - Listen for errors

Options

{
  redirectUrl: string,      // Where to redirect after auth
  rememberJwt: boolean,     // Persist session in localStorage (default: true)
  storage: Storage,        // Custom storage (default: localStorage)
  implicit: boolean        // Use implicit flow (default: false)
}

Session Recovery

The SDK auto-restores sessions. Call xumm.logout() before authorize() to force fresh login.

Troubleshooting

  • Popup blocked: Browser popup blocker may prevent authorize() - call from user action
  • Account undefined: Use xumm.state().then(s => s.me.account) after success event
  • CORS errors: Ensure redirectUrl matches your app's origin

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 08:40 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,697
security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,584
developer-tools

Hedera Transaction Builder

harleyscodes
构建、签名并提交 Hedera 交易,包括 HBAR 转账、代币操作和智能合约调用至 Hedera 网络。
★ 0 📥 1,329