This is the official Twala Sign SDK for applications written in JavaScript.
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
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
Initialize the library with your appUuid
and appSecret
:
import Twala from '@twala-io/twala-js';
const twala = new Twala(appUuid, appSecret);
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);
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.
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