Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.privacyboost.io/llms.txt

Use this file to discover all available pages before exploring further.

Installation

Package Installation

Install both the React SDK and the underlying TypeScript SDK:
# npm
npm install @sunnyside-io/privacy-boost @sunnyside-io/privacy-boost-react

# yarn
yarn add @sunnyside-io/privacy-boost @sunnyside-io/privacy-boost-react

# pnpm
pnpm add @sunnyside-io/privacy-boost @sunnyside-io/privacy-boost-react

Bundler Configuration

The SDK includes WebAssembly modules. See the TypeScript SDK installation guide for bundler-specific configuration.

Next.js

// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
  webpack: (config) => {
    config.experiments = {
      ...config.experiments,
      asyncWebAssembly: true,
    };
    return config;
  },
};

module.exports = nextConfig;

Vite

Works out of the box. No configuration needed.

Create React App

Requires react-app-rewired. See TypeScript installation.

TypeScript Configuration

Recommended tsconfig.json:
{
  "compilerOptions": {
    "target": "ES2020",
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "module": "ESNext",
    "moduleResolution": "bundler",
    "jsx": "react-jsx",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  }
}

Peer Dependencies

The React SDK requires:
  • react >= 18.0.0
  • @sunnyside-io/privacy-boost (latest)

Verifying Installation

import { PrivacyBoostProvider } from '@sunnyside-io/privacy-boost-react';

function App() {
  return (
    <PrivacyBoostProvider
      config={{
        appId: 'your-app-id',
        serverUrl: 'https://test-api.privacyboost.io',
        wethContractAddress: "0x4200000000000000000000000000000000000006"
      }}
      loadingComponent={<div>Loading...</div>}
    >
      <div>SDK loaded successfully!</div>
    </PrivacyBoostProvider>
  );
}

Next Steps