iExec tools
Search
⌃K
Comment on page

Quick start

1. Sandbox

2. Getting started

2.1. Prerequisites

Before getting started, ensure that you have the following installed on your system:
- Node.js version 18 or higher
- NPM (Node.js package manager)\

2.2. Start a new project

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.
You can find the project here.

2.3. Basic installation

Install dataProtectorSDK .
With npm:
npm install @iexec/dataprotector
Or
With yarn:
yarn add @iexec/dataprotector
This package is an ESM package. Your project needs to be ESM too. Read more.
If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM.

2.4. Instantiate SDK

Browser
NodeJS
Instantiate the SDK in your front-end project:
2.4.1. Basic Instantiation
import { IExecDataProtector } from "@iexec/dataprotector";
​
const web3Provider = window.ethereum;
// instantiate
const dataProtector = new IExecDataProtector(web3Provider);
Instantiate the SDK in your back-end project:
2.4.1. Basic Instantiation
import { IExecDataProtector, getWeb3Provider } from "@iexec/dataprotector";
​
const { PRIVATE_KEY } = process.env;
// get web3 provider from a private key
const web3Provider = getWeb3Provider(PRIVATE_KEY);
​
// instantiate
const dataProtector = new IExecDataProtector(web3Provider);