Build a web application
Last updated
Was this helpful?
Last updated
Was this helpful?
fhevmjs
is working out of the box and we recommend you to use it. We also provide three GitHub templates to start your project with everything set.
You can use to start an application with fhevmjs, using Vite + React + TypeScript.
You can also use to start an application with fhevmjs, using Vite + Vue + TypeScript.
You can also use to start an application with fhevmjs, using Next + TypeScript.
First, you need to install the library.
Once the WASM is loaded, you can now create an instance. An instance needs two element:
The blockchain public key. This key is needed to encrypt inputs
The blockchain' chain ID. This value is needed for reencryption process.
fhevmjs
uses ESM format. You need to set the . If your node project use "type": "commonjs"
or no type, you can force the loading of the web version by using import { createInstance } from 'fhevmjs/web';
To use the library in your project, you need to load the WASM of first with initFhevm
.
You can now use your instance to or do a .