Installation
Package Installation
Install the Privacy Boost TypeScript SDK using your preferred package manager:Bundler Configuration
The SDK includes WebAssembly (WASM) modules that require specific bundler configuration.Vite
Vite works out of the box. No additional configuration needed.Webpack 5
Add the following to yourwebpack.config.js:
Next.js
Add to yournext.config.js:
Create React App
CRA requiresreact-app-rewired to modify webpack:
config-overrides.js:
package.json scripts:
Rollup
esbuild
Content Security Policy
If your application uses CSP, add the following directives:TypeScript Configuration
Recommendedtsconfig.json settings:
Node.js Usage
For Node.js applications:Verifying Installation
Test your installation:Troubleshooting
”WebAssembly is not defined”
Ensure your bundler supports WebAssembly and you’re running in a browser or Node.js environment that supports WASM.”Failed to load WASM module”
Check that:- Your bundler is configured correctly
- The WASM file is being served with the correct MIME type (
application/wasm) - Your CSP allows
wasm-unsafe-eval
TypeScript errors
Ensure you have TypeScript 4.7+ and the correctmoduleResolution setting in tsconfig.json.