
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@ethersphere/swarm-extension
Advanced tools
JavaScript library for interaction with the Swarm browser extension
Library for interaction with the Swarm Browser Extension, from dApps or other browser extensions.
The library can be installed via npm:
npm install --save @ethersphere/swarm-extension
All interaction with the Swarm browser extension is established through the Swarm class:
import { Swarm } from '@fairdatasociety/swarm-extension'
By default the class will connect to the Swarm browser extension using its ID from the Google store. If you are running your version of the extension the class can be configured with a different extension ID.
const swarm = new Swarm() // Using the default Swarm ID from the Google store
const swarm = new Swarm('Swarm Extension ID...') // Using custom Swarm ID
To test if connection with the Swarm extension is established, call the echo
method:
const text = await swarm.echo<string>('test')
console.log(text) // 'test'
Before interacting with the library, Dapp should register new session by calling:
await swarm.register()
or new session will be implicitly created when calling any method for the first time.
After registering a new session, session ID will be available as:
swarm.sessionId
There are four different objects available in the Swarm calass:
Once when the instance of the Swarm class is not needed anymore, connection with the extension can be terminated.
swarm.closeConnection()
To enable Swarm HTML features, include the swarm-html.js
script into HTML page. For more details check Swarm HTML in the main readme
To watch for changes in the source code and recompile the library on change:
npm start
To build the library:
npm run build
FAQs
JavaScript library for interaction with the Swarm browser extension
The npm package @ethersphere/swarm-extension receives a total of 0 weekly downloads. As such, @ethersphere/swarm-extension popularity was classified as not popular.
We found that @ethersphere/swarm-extension demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.