@twala-io/twala-js
v1.1.2
Published
The official Node.js library for Twala API that provides convenient access and utilities for applications written in JavaScript.
Downloads
4
Maintainers
Readme
Twala Node.js Library
The official Node.js library of Twala API for applications written in server-side JavaScript.
Requirements
Before proceeding, please make sure that the below requirements are installed and running on your machine.
- Node.js >= v19.4.0
- npm >= 9.2.0
Installation
Open your terminal (for Mac and Linux) or command prompt (for Windows) and install the twala-js
npm package:
$ npm install @twala-io/twala-js --save
Usage
Initialize the library with your appUuid
, appSecret
, and RPC provider
:
import Twala from '@twala-io/twala-js';
const twala = new Twala(appUuid, appSecret, provider);
Use the library's methods as needed, such as generating nonces, generating account keys, and signing data:
// Generate a nonce
const nonce = twala.generateNonce();
// Generate account keys
const keys = twala.generateAccountKeys()
// Sign document
const signatureResult = twala.signDocumentUuid(uuid, privateKey);
Support
The most recent major release of twala-js
includes both new functionality and bug fixes. To take advantage of new features and bug patches, including those for security vulnerabilities, if you are using an earlier major version, we advise you to upgrade to the most recent version. Older major versions of the package will still be usable but won't receive updates.
Development
To contribute to the development of the Twala Node.js Library, follow these steps:
Clone the repository:
$ git clone [email protected]:twala-io/twala-js.git && cd twala-js
Install dependencies:
$ npm install
Run tests:
$ npm run test
Run linter:
$ npm run lint
Run formatter:
$ npm run format
Build the package:
$ npm run build
Publish the package:
$ npm publish --access public