{"_id":"@algorandecosystem/liquid-client","name":"@algorandecosystem/liquid-client","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@algorandecosystem/liquid-client","version":"1.0.0","description":"Connect to a Liquid Auth service","main":"./lib/index.js","types":"./lib/index.d.ts","browser":"./liquid-client.esm.js","type":"module","publishConfig":{"provenance":true,"access":"public"},"exports":{".":{"types":"./lib/index.d.ts","default":"./lib/index.js"},"./attestation":{"types":"./lib/attestation.d.ts","default":"./lib/attestation.js"},"./assertion":{"types":"./lib/assertion.d.ts","default":"./lib/assertion.js"},"./assertion/fetch":{"types":"./lib/assertion.fetch.d.ts","default":"./lib/assertion.fetch.js"},"./signal":{"types":"./lib/signal.d.ts","default":"./lib/signal.js"},"./errors":{"types":"./lib/errors.d.ts","default":"./lib/errors.js"},"./encoding":{"types":"./lib/encoding.d.ts","default":"./lib/encoding.js"}},"scripts":{"dev":"wait-on -t 3s http://localhost:3000/auth/session && vite","build":"vite build","build:docs":"typedoc --plugin typedoc-plugin-markdown --out docs src src/client","lint":"eslint --fix src","bench":"vitest bench","test":"vitest","test:browser":"vitest --browser.headless","test:cov":"vitest run --coverage","typedoc":"typedoc --tsconfig tsconfig.app.json","typedoc:watch":"typedoc --watch --tsconfig tsconfig.app.json","typedoc:serve":"nodemon --watch docs --exec \"http-server ./docs\"","typedoc-dev":"concurrently \"npm:typedoc:*\"","release":"semantic-release"},"author":{"name":"Algorand Ecosystem"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/algorandecosystem/liquid-auth-js.git"},"devDependencies":{"@codecov/vite-plugin":"^1.9.0","@semantic-release/changelog":"^6.0.3","@semantic-release/commit-analyzer":"^12.0.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^10.0.3","@semantic-release/npm":"^12.0.0","@semantic-release/release-notes-generator":"^13.0.0","@types/uuid":"^10.0.0","@typescript-eslint/eslint-plugin":"^7.8.0","@typescript-eslint/parser":"^7.8.0","@vitest/browser":"^3.0.8","@vitest/coverage-v8":"^3.0.8","concurrently":"^9.1.2","conventional-changelog-conventionalcommits":"^8.0.0","eslint":"^8.57.0","eslint-config-prettier":"^9.1.0","eslint-plugin-prettier":"^5.1.3","eslint-plugin-tsdoc":"^0.2.17","glob":"^11.0.1","http-server":"^14.1.1","nodemon":"^3.1.9","playwright":"^1.51.0","semantic-release":"^23.0.8","socket.io-mock-ts":"^1.0.2","typedoc":"^0.27.9","typedoc-plugin-markdown":"4.4.2","typescript":"^5.8.2","vite":"^6.2.2","vite-bundle-analyzer":"^0.18.0","vite-plugin-dts":"^4.5.3","vitest":"^3.0.8","wait-on":"^8.0.3"},"dependencies":{"eventemitter3":"^5.0.1","qrcode":"^1.5.4","socket.io-client":"^4.7.5","tweetnacl":"^1.0.3","uuid":"^10.0.0"},"_id":"@algorandecosystem/liquid-client@1.0.0","gitHead":"e1c8583f579c4f20cfb9e429abc8a0069b2d95ad","bugs":{"url":"https://github.com/algorandecosystem/liquid-auth-js/issues"},"homepage":"https://github.com/algorandecosystem/liquid-auth-js#readme","_nodeVersion":"20.20.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-T3MUF0mwT6Xiq53skYcam0sud0OkDZ3cbRGtiUIWqmO2oUFOlI5coIdtSyMQvCjc2DKlX22yx5HLjBLqsxFvHA==","shasum":"b491575d4655ff0d8464e4fa78303b0aff7d6304","tarball":"https://registry.npmjs.org/@algorandecosystem/liquid-client/-/liquid-client-1.0.0.tgz","fileCount":102,"unpackedSize":534750,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@algorandecosystem%2fliquid-client@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXRadyBYaFvszlwBOpjJsOhhbOEU+xXdpdTKD3kJLGyQIhANM0mtcAjR1r4sA8mA6/SXJCt8wanENZg6HMEz+kp8Fp"}]},"_npmUser":{"name":"algorandecosystem","email":"contact@algorand.eco"},"directories":{},"maintainers":[{"name":"algorandecosystem","email":"contact@algorand.eco"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/liquid-client_1.0.0_1772075674741_0.4599507104188092"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-26T03:14:34.566Z","1.0.0":"2026-02-26T03:14:34.906Z","modified":"2026-02-26T03:14:35.350Z"},"maintainers":[{"name":"algorandecosystem","email":"contact@algorand.eco"}],"description":"Connect to a Liquid Auth service","homepage":"https://github.com/algorandecosystem/liquid-auth-js#readme","repository":{"type":"git","url":"git+https://github.com/algorandecosystem/liquid-auth-js.git"},"author":{"name":"Algorand Ecosystem"},"bugs":{"url":"https://github.com/algorandecosystem/liquid-auth-js/issues"},"license":"Apache-2.0","readme":"# @algorandecosystem/liquid-client\n\n[![CI](https://github.com/algorandfoundation/liquid-auth-js/actions/workflows/CI.yml/badge.svg)](https://github.com/algorandfoundation/liquid-auth-js/actions/workflows/CI.yml)[![Publish Package](https://github.com/algorandfoundation/liquid-auth-js/actions/workflows/package-release.yml/badge.svg)](https://github.com/algorandfoundation/liquid-auth-js/actions/workflows/package-release.yml)[![codecov](https://codecov.io/gh/algorandfoundation/liquid-auth-js/graph/badge.svg?token=AKN7VATWTO)](https://codecov.io/gh/algorandfoundation/liquid-auth-js)[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)\n\nThis project is an example Client for TypeScript for using the Liquid-Auth API.\n\n# 🎉 Getting Started\n\n## 📦 Install\n\n```bash\nnpm install algorandfoundation/liquid-auth-js --save\n````\n\n# 📝 Usage\n\n```typescript\nimport {SignalClient} from '@algorandecosystem/liquid-client';\nconst client = new SignalClient(window.origin);\n```\n\nSee the [liquid-auth documentation](https://liquidauth.com/clients/browser/introduction/) for more information on the API.\n\n## 🔐 Browser Wallet Integration\n\n#### Create a new account and passkey\n```typescript\nconst testAccount = algosdk.generateAccount();\n// Sign in to the service with a new credential and wallet\nawait client.attestation(async (challenge: Uint8Array) => ({\n    type: 'algorand', // The type of signature and public key\n    address: testAccount.addr, // The address of the account\n    signature: toBase64URL(nacl.sign.detached(challenge, testAccount.sk)), // The signature of the challenge\n    requestId: '019097ff-bb8d-7f68-9062-89543625aca5', // Optionally authenticate a remote peer\n    device: 'Demo Web Wallet' // Optional device name\n}))\n```\n#### Sign in with an existing account\n```typescript\nawait client.assertion(\n    credentialId, // Some known credential ID\n    {requestId: '019097ff-bb8d-7f68-9062-89543625aca5'} // Optional requestId to link\n)\n```\n#### Peering with a remote client\n\n```typescript\n// Create the Peer Connection and await the remote client's answer\nclient.peer('019097ff-bb8d-7f68-9062-89543625aca5', 'answer').then((dataChannel: RTCDataChannel)=>{\n    // Handle the data channel\n    dataChannel.onmessage = (event: MessageEvent) => {\n        console.log(event.data)\n    }\n})\n```\n\n## 🌐 Dapp Integration\n\n```typescript\nconst requestId = SignalClient.generateRequestId();\nclient\n    .peer(requestId, 'offer')\n    .then((dataChannel: RTCDataChannel)=>{\n        // Handle the data channel\n        dataChannel.onmessage = (event: MessageEvent) => {\n            console.log(event.data)\n        }\n    })\nconst blob = await client.qrCode()\n```\n\n## 🏗️ Interfaces\n\n```typescript\ninterface SignalClient {\n  readonly url: string; // Origin of the service\n  type: \"offer\" | \"answer\" // Type of client\n  peerClient: RTCPeerConnection | PeerClient // Native WebRTC Wrapper/Interface\n  socket: Socket // The socket to the service\n\n  readonly authenticated: boolean; // State of authentication\n  readonly requestId?: string; // The current request being signaled\n\n  /**\n   * Generate a Request ID\n   */\n  generateRequestId(): string;\n\n  attestation(...args: any[]): Promise<any>;\n  assertion(...args: any[]): Promise<any>;\n  \n  /**\n   * Top level Friendly interface for signaling\n   * @param args\n   */\n  peer(requestId: string, type: 'offer' | 'answer', config?: RTCConfiguration): Promise<void>;\n\n  /**\n   * Link a Request ID to this client\n   * @param args\n   */\n  link(...args: any[]): Promise<LinkMessage>;\n\n  /**\n   * Wait for a desciption signal\n   * @param args\n   */\n  signal(...args: any[]): Promise<string>;\n\n  /**\n   * Terminate the signaling session\n   */\n  close(): void\n  \n  \n  /**\n   * Listen to Interface events\n   * @param args\n   */\n  on(...args: any[]): void;\n\n  /**\n   * Emit an event to the interface\n   * @param channel\n   * @param callback\n   */\n  emit(channel: string, callback: (...args: any[])=>void)\n\n}\n```\n## ❤️ Community\n\n[![stargazers](https://reporoster.com/stars/dark/algorandfoundation/liquid-auth-js)](https://github.com/algorandfoundation/liquid-auth-js/stargazers)\n[![forks](https://reporoster.com/forks/dark/algorandfoundation/liquid-auth-js)](https://github.com/algorandfoundation/liquid-auth-js/network/members)","readmeFilename":"README.md","_rev":"1-379f15a007be2c94c16cc30ceb7d69d4"}