
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
@holochain/hc-web-client
Advanced tools
Holochain Conductor connection helper for web based UIs and any Javascript client
Thin wrapper around rpc-websockets
to enable calling zome functions in Holochain apps installed in a conductor. This module aims to fill a similar role to web3.js and allow for connecting to a holochain instance in a variety of scenarios.
The module can either be imported and used as part of a compiled web application or used in pure HTML. In the first case it is reccomended to download and install via npm npm install @holochain/hc-web-client
. It can then be imported or required using
const { connect } = require('@holochain/hc-web-client')
// or
import { connect } from '@holochain/hc-web-client'
For the pure HTML case the hc-web-client.js file in the dist/
folder must be moved to your project directory and imported using
<script type="text/javascript" src="path/to/hc-web-client-0.0.1.browser.min.js"></script>
This will add a holochainclient
field to the window object.
A full URL including port to the holochain interface is known and will never change. This is ok for development or very specific applications. Usage:
connect({ url: "ws://localhost:3000" }).then(({callZome, close}) => {
callZome('instanceId', 'zome', 'funcName')(params)
})
UI is being served by the holochain conductor. This is the most commonly anticipated usage. Interface port is unknown but valid interface is defined in the conductor config. In this case no url parameter is required and it will automatically call the conductor to retrieve the correct port to make calls on. Usage:
connect().then(({callZome, close}) => {
callZome('instanceId', 'zome', 'funcName')(params)
})
The holochain conductor exposes methods for each function of each zome of each running instance.
If the web client is connected to an admin interface there are also RPC methods to manage DNAs, UIs, interfaces and bridges. These can be called from the web client for exampe as:
connect().then(({call, close}) => {
call('admin/dna/install_from_file')(params)
})
View the Holochain JSON-RPC API documentation.
npm run build
. This will build to ./libnpm run build:web
. This will build to ./srcTests can be run using npm run test
To publish a new release to npm use the following steps. Ensure you are on the master branch then run
npm version patch
npm publish --access public
This will automatically build, lint, commit and push a new git tag before publishing. You can alternatively use npm version major|minor|patch
to increment the correct version number. Please do not modify the version number in the package.json directly.
This project is licensed under the AGPL-3.0 License
FAQs
Holochain Conductor connection helper for web based UIs and any Javascript client
The npm package @holochain/hc-web-client receives a total of 57 weekly downloads. As such, @holochain/hc-web-client popularity was classified as not popular.
We found that @holochain/hc-web-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.