Web App SDK (for Browser based Apps)
Last updated
Last updated
Please note that the security of your private keys is your sole responsibility. Our JS SDK, which wraps Hedera SDK and Blade wallet API, has been developed to ensure the highest level of security possible. However, we do not take any responsibility for the security of your private keys. Please be aware that once someone else gains access to your private keys, they will have full control of your account, funds, tokens, and NFTs. We strongly recommend that you follow best practices for securing your private keys when using our SDK. Please be aware that private keys will never be sent over the network or shared with any third party through our SDK.
Node.js 16.x or higher (MacOS/Linux)
Node.js 16.x to 18.x (Windows)
There are two ways passing accountId
and accountPrivateKey
arguments to the SDK methods:
Pass accountId
and accountPrivateKey
as parameters to the SDK methods as strings. Make sure that private keys contain DER prefix (like: 302e020100300506032b657004220420
and are hex-encoded)
Pass empty accountId
and accountPrivateKey
in case you called setUser()
before. That credentials stored in SDK memory and will be used for all SDK methods calls until you destroy instance of BladeSDK or call resetUser()
or setUser()
again. Currently setUser()
support next user providers:
Magic
- Magic.link. Example: setUser("Magic", "your_email@domain.com")
Hedera
- enter accountId
and accountPrivateKey
. Example: setUser("Hedera", "0.0.45467464", "302e020100300506032b6570042204204323472EA5374E80B07346243234DEADBEEF25235235...")
In case of calling method with accountId
and accountPrivateKey
arguments, SDK will override current user with this credentials.
For more information, please check our Blade SDK Portal
Some other SDKs (Kotlin-Blade and Swift-Blade) depend on this repo. To publish a new bundle to those repos, run the following command:
On repos create pull request from newly created branch js/latest-build