Getting Started โ
Overview โ
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)
Installation โ
npm install @iexec/dataprotector
yarn add @iexec/dataprotector
pnpm add @iexec/dataprotector
bun add @iexec/dataprotector
This package is an ESM package. Your project needs to use ESM too. ย Read more
If you use it with Webpack, some polyfills will be needed. You can find a minimal working project here.
Instantiate SDK โ
import { IExecDataProtectorCore } from '@iexec/dataprotector';
const web3Provider = window.ethereum;
// Instantiate only the Core module
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
import { IExecDataProtectorCore, getWeb3Provider } from '@iexec/dataprotector';
// Get Web3 provider from a private key
const web3Provider = getWeb3Provider('YOUR_PRIVATE_KEY');
// Instantiate the Core module
const dataProtectorCore = new IExecDataProtectorCore(web3Provider);
Instantiate Without a Web3 Provider โ
For projects that only require read functions, you can instantiate the SDK without a Web3 provider.
import {
IExecDataProtectorSharing,
IExecDataProtectorCore,
} from '@iexec/dataprotector';
// Instantiate only the Core module for read-only core methods
const dataProtectorCore = new IExecDataProtectorCore();
import { IExecDataProtector } from '@iexec/dataprotector';
// Instantiate using the umbrella module for read-only functions
const dataProtector = new IExecDataProtector();
// Access to read-only core methods
const dataProtectorCore = dataProtector.core;
Advanced Configuration โ
To add optional parameters, see advanced configuration.
INFO
๐งช While protected data are processed in TEE by intel SGX technology by default, @iexec/dataprotector
can be configured to create and process protected data in the experimental intel TDX environment.
For more details see:
โ ๏ธ Keep in mind: TDX mode is experimental and can be subject to instabilities or discontinuity.
Sandbox โ
DataProtector Core
InteractiveEssential data protection features including encryption, access control, and secure storage.