Comment on page
Quick start
Before getting started, ensure that you have the following installed on your system:
In this section, we will show you how to set up and call the different methods of the SDK in a React.js app.
You can reach the following open-source GitHub project, clone it and start from there.
Install
web3MailSDK
.With npm:
npm install @iexec/web3mail
Or
With yarn:
yarn add @iexec/web3mail
If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM.
Browser
NodeJS
Instantiate the SDK in your front-end project:
2.4.1. Basic Instantiation
import { IExecWeb3mail } from "@iexec/web3mail";
const web3Provider = window.ethereum;
// instantiate
const web3mail = new IExecWeb3mail(web3Provider);
Instantiate the SDK in your back-end project:
2.4.1. Basic Instantiation
import { IExecWeb3mail, getWeb3Provider } from "@iexec/web3mail";
const { PRIVATE_KEY } = process.env;
// get web3 provider from a private key
const web3Provider = getWeb3Provider(PRIVATE_KEY);
// instantiate
const web3mail = new IExecWeb3mail(web3Provider);
Last modified 2mo ago