Skip to content

Getting Started โ€‹

GitHub package.json version (branch)

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 โ€‹

sh
npm install @iexec/dataprotector
sh
yarn add @iexec/dataprotector
sh
pnpm add @iexec/dataprotector
sh
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 โ€‹

ts
import { 
IExecDataProtectorCore
} from '@iexec/dataprotector';
const
web3Provider
=
window
.
ethereum
;
// Instantiate only the Core module const
dataProtectorCore
= new
IExecDataProtectorCore
(
web3Provider
);
ts
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.

ts
import {
  
IExecDataProtectorSharing
,
IExecDataProtectorCore
,
} from '@iexec/dataprotector'; // Instantiate only the Core module for read-only core methods const
dataProtectorCore
= new
IExecDataProtectorCore
();
ts
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

Interactive

Essential data protection features including encryption, access control, and secure storage.