Bundler & WASM setup
@owlid/sdk is split so REST-only consumers don't pay the WASM cost.
Importing @owlid/sdk does not load the WASM module. The runtime
classes live behind the explicit @owlid/sdk/native subpath — opt in only
when you need to generate proofs locally.
Who needs @owlid/sdk/native
Anything that generates proofs or tokens locally — typically the holder's wallet UI, or CLI tools that build tokens out of band.
If your app only calls the verification or issuance REST endpoints, you
do not need the native subpath. Stick to the REST clients (or
@owlid/sdk root for the higher-level helpers) and your bundle stays
WASM-free.
Vite
Apps that import @owlid/sdk/native need a bundler that handles WASM. Use
vite-plugin-wasm and exclude the native packages from pre-bundling:
Vite — REST-only apps
If you only call REST endpoints, drop the wasm plugin and tell Vite not to pre-bundle the native chunks:
The optimizeDeps.exclude is the load-bearing line — without it Vite
attempts to pre-optimize a transitive WASM dep that never resolves and the
dev server 404s on *.wasm32-wasi.wasm.
Webpack / Next.js
Webpack handles WASM via its experiments.asyncWebAssembly flag plus
webpack.IgnorePlugin for the absent native binary platforms:
REST-only Next.js apps can also drop @owlid/sdk entirely and import the
clients directly; that path needs no special bundler config.
Configuration
Every package — clients and SDK alike — reads runtime configuration from
@owlid/config:
Resolution order: explicit override → configure() call →
window.__OWLID_CONFIG__ → import.meta.env.VITE_* →
process.env.OWLID_* / VITE_* → localhost defaults.