{"bugs":{"url":"https://github.com/streamr-dev/network/issues"},"dist":{"shasum":"8ea3faa83e833dc763e5846e3c8efeba8c8dfe24","tarball":"https://registry.npmjs.org/streamr-client/-/streamr-client-100.0.0-testnet-two.4.tgz","fileCount":269,"integrity":"sha512-K4Io5KIQtqQZ9+YxpiSQXaN1cpzzOTmTTMm1gPdQGRL+JB43TjoGSQS8TPCmOSpfer7hcKr1GPqE3hx8eRbZKg==","signatures":[{"sig":"MEYCIQDEBPjidpzXeQiwwNcNa2WvjINI3gon29NFv5FVtfHdYAIhAOCPFaBu58cmM+w5QmrgTjgqvFAtNpmlXctGkPuiLTfA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":31491358},"main":"./src/exports-commonjs.js","name":"streamr-client","types":"./types/src/index.d.ts","author":{"name":"Streamr Network AG","email":"contact@streamr.network"},"readme":"<p align=\"center\">\n  <a href=\"https://streamr.network\">\n    <img alt=\"Streamr\" src=\"https://raw.githubusercontent.com/streamr-dev/network-monorepo/main/packages/client/readme-header.png\" width=\"600\" />\n  </a>\n</p>\n\n<h1 align=\"left\">\n  Streamr JavaScript Client\n</h1>\n\n![latest npm package version](https://img.shields.io/npm/v/streamr-client?label=latest)\n![GitHub stars](https://img.shields.io/github/stars/streamr-dev/network-monorepo?style=social)\n[![Discord Chat](https://img.shields.io/discord/801574432350928907.svg?label=Discord&logo=Discord&colorB=7289da)](https://discord.gg/FVtAph9cvz)\n\nThe Streamr Client library allows you to easily interact with the [Streamr Network](https://streamr.network) from\nJavaScript-based environments, such as browsers and [Node.js](https://nodejs.org). The library wraps a Streamr light node for publishing and subscribing to messages. It also contains convenience functions for creating and managing streams.\n\n**[Checkout our documentation](https://docs.streamr.network) for the full usage instructions.**\n\n## Quickstart\nThe client is available on [NPM](https://www.npmjs.com/package/streamr-client) and can be installed simply by:\n\n```\nnpm install streamr-client\n```\n\nIf using TypeScript you can import the library with:\n```js\nimport { StreamrClient } from 'streamr-client'\n```\nIf using Node.js you can import the library with:\n\n```js\nconst { StreamrClient } = require('streamr-client')\n```\n\n## Environments and frameworks\n**NodeJS**\n- NodeJS `16.13.x` is the minimum required version. NodeJS `18.13.x`, NPM `8.x` and later versions are recommended.\n\n**Browser (Website/WebApps)**\n- To use with react please see [streamr-client-react](https://github.com/streamr-dev/streamr-client-react)\n- For usage in the browser include the latest build, e.g. by including a `<script>` tag pointing at a CDN:\n- `<script src=\"https://unpkg.com/streamr-client@latest/streamr-client.web.min.js\"></script>`\n\n**Browser extension**\n- Due to the stricter security rules inside browser extensions you must use the web build version of the Streamr Client.\n\n## Usage\n\n### Full API reference\nFor a full API reference visit https://api-docs.streamr.network/.\n\n### Client creation\nIn Streamr, Ethereum accounts are used for identity. You can generate an Ethereum private key using any Ethereum wallet, or you can use the utility function [`StreamrClient.generateEthereumAccount()`](#utility-functions), which returns the address and private key of a fresh Ethereum account. A private key is not required if you are only subscribing to public streams on the Network.\n\n```js\nconst streamr = new StreamrClient({\n    auth: {\n        privateKey: 'your-private-key'\n    }\n})\n```\n\nAuthenticating with an Ethereum private key contained in an Ethereum (web3) provider (e.g. MetaMask):\n```js\nconst streamr = new StreamrClient({\n    auth: {\n        ethereum: window.ethereum,\n    }\n})\n```\n\nYou can also create an anonymous client instance that can interact with public streams:\n```js\nconst streamr = new StreamrClient()\n```\n\n### Creating a stream\n```js\n// Requires MATIC tokens (Polygon blockchain gas token)\nconst stream = await streamr.createStream({\n    id: '/foo/bar'\n})\n\nconsole.log(stream.id) // e.g. `0x12345.../foo/bar`\n```\n\n### Subscribing\n```js\nconst streamId = '0x7d275b79eaed6b00eb1fe7e1174c1c6f2e711283/ethereum/gas-price'\n\nstreamr.subscribe(streamId, (message) => {\n    // handle for individual messages\n})\n\n```\n### Publishing\nPublishing messages requires your Ethereum account to have permission to publish. See the [stream permission docs](https://docs.streamr.network/usage/streams/permissions) for more information.\n\n```js\n// Requires MATIC tokens (Polygon blockchain gas token)\nconst stream = await streamr.createStream({\n    id: '/foo/bar'\n})\n\nawait stream.publish({ timestamp: Date.now() })\n```\n\n### Requesting historical messages\nBy default `subscribe` will not request historical messages.\n\nYou can fetch historical messages with the `resend` method:\n```js\nstreamr.resend(streamId, { last: 10 }, (msgs) => {\n  console.log(\"messages\": msgs);\n});\n```\n\n___\n\n**This Readme only scratches the surface of what's possible - be sure to [checkout our documentation](https://docs.streamr.network) for the full usage instructions.**\n","browser":"./streamr-client.web.js","exports":{"browser":"./streamr-client.web.js","default":{"import":"./src/exports-esm.mjs","require":"./src/exports-commonjs.js"}},"gitHead":"1f6fec0d6ede5ca47b63ca898a4782368656efa9","license":"Apache-2.0","_npmUser":{"name":"harbu","email":"harbuzen@gmail.com"},"homepage":"https://github.com/streamr-dev/network#readme","#IMPORTANT":"babel-runtime must be in dependencies, not devDependencies","repository":{"url":"git+https://github.com/streamr-dev/network.git","type":"git","directory":"packages/client"},"_npmVersion":"10.2.3","description":"JavaScript client library for Streamr","directories":{},"maintainers":[{"name":"samigabor","email":"samoila.gabor@yahoo.com"},{"name":"fonty1","email":"mr.matto@gmail.com"},{"name":"hpihkala","email":"henri.pihkala@streamr.com"},{"name":"tumppi","email":"tuomas.koponen@streamr.com"},{"name":"harbu","email":"harbuzen@gmail.com"},{"name":"mariusz_io","email":"mariusz@mariusz.io"},{"name":"pzsavola","email":"petri.savolainen@spaceify.net"},{"name":"juslesan","email":"santeri.juslenius@gmail.com"},{"name":"jtakalai","email":"juuso.takalainen@streamr.com"},{"name":"streamr-dev","email":"devtools@streamr.com"},{"name":"teogeb","email":"teo@streamr.com"},{"name":"samt1803","email":"samt1803@gmail.com"}],"_nodeVersion":"18.19.0","dependencies":{"idb":"^7.1.1","sha3":"^2.1.4","uuid":"^9.0.1","lodash":"^4.17.21","split2":"^4.2.0","sqlite":"^5.1.1","core-js":"^3.33.3","p-limit":"^3.1.0","sqlite3":"^5.0.3","lit-siwe":"^1.1.8","tsyringe":"^4.8.0","env-paths":"^2.2.1","p-memoize":"4.0.4","quick-lru":"^7.0.0","secp256k1":"^5.0.0","node-fetch":"^2.7.0","p-throttle":"4.1.1","ts-toolbelt":"^9.6.0","@streamr/dht":"100.0.0-testnet-two.4","eventemitter3":"^5.0.0","ts-essentials":"^9.4.1","@babel/runtime":"^7.23.4","@streamr/utils":"100.0.0-testnet-two.4","@streamr/config":"^5.1.0","readable-stream":"^4.4.2","reflect-metadata":"^0.1.13","@streamr/protocol":"100.0.0-testnet-two.4","@ethersproject/abi":"^5.5.0","@ethersproject/web":"^5.5.0","@lit-protocol/core":"^2.2.5","@ethersproject/bytes":"^5.5.0","@ethersproject/wallet":"^5.5.0","@babel/runtime-corejs3":"^7.23.4","@ethersproject/address":"^5.5.0","@ethersproject/bignumber":"^5.5.0","@ethersproject/constants":"^5.5.0","@ethersproject/contracts":"^5.5.0","@ethersproject/providers":"^5.5.0","@lit-protocol/uint8arrays":"^2.2.61","@ethersproject/transactions":"^5.5.0","@streamr/trackerless-network":"100.0.0-testnet-two.4","@ethersproject/abstract-signer":"^5.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"ajv":"^8.8.2","util":"^0.12.4","bytes":"^3.1.1","buffer":"^6.0.3","express":"^4.17.1","typedoc":"^0.25.4","webpack":"^5.89.0","benchmark":"^2.1.4","ts-loader":"^9.5.1","weak-napi":"^2.0.2","nightwatch":"^3.3.2","@babel/core":"^7.23.3","@types/heap":"^0.2.34","@types/uuid":"^9.0.7","ajv-formats":"^2.1.1","webpack-cli":"^5.1.4","babel-loader":"^9.1.3","chromedriver":"^119.0.0","concurrently":"^8.2.2","@jest/globals":"^29.5.0","@types/lodash":"^4.14.202","@types/split2":"^4.2.3","webpack-merge":"^5.10.0","@types/secp256k1":"^4.0.6","@babel/preset-env":"^7.23.3","@types/node-fetch":"^2.6.4","crypto-browserify":"^3.12.0","jest-leak-detector":"^27.3.1","jest-matcher-utils":"^29.5.0","@streamr/test-utils":"100.0.0-testnet-two.4","babel-plugin-lodash":"^3.3.4","eslint-plugin-import":"^2.29.0","lodash-webpack-plugin":"^0.11.6","terser-webpack-plugin":"^5.2.5","webpack-bundle-analyzer":"^4.10.1","@babel/preset-typescript":"^7.23.3","@ethersproject/wordlists":"^5.5.0","git-revision-webpack-plugin":"^5.0.0","node-polyfill-webpack-plugin":"^2.0.1","@babel/plugin-transform-runtime":"^7.23.4","babel-plugin-add-module-exports":"^1.0.4","@babel/plugin-proposal-decorators":"^7.23.3","@babel/plugin-transform-modules-commonjs":"^7.23.3","babel-plugin-transform-typescript-metadata":"^0.3.2"},"optionalDependencies":{"bufferutil":"^4.0.8","utf-8-validate":"^6.0.3"},"_npmOperationalInternal":{"tmp":"tmp/streamr-client_100.0.0-testnet-two.4_1703263971349_0.13313374086479546","host":"s3://npm-registry-packages"},"_id":"streamr-client@100.0.0-testnet-two.4","version":"100.0.0-testnet-two.4"}