Embed Tritium as an HTML Element


NOTE: WASM distributions of Tritium are currently a work in progress and the API surface can and will change over time.

Embed Tritium in your existing web platform with just a small code snippet.

<script type="module">
    import init, * as bindings from 'https://tritium.legal/static/tritium.js';
    const wasm = await init({ module_or_path: 'https://tritium.legal/static/tritium_bg.wasm' });
    window.wasmBindings = bindings;
</script>

<style>
    #tritium-canvas {
        display: block;
        width: 100%;
        height: 100%;
    }
</style>
<canvas id="tritium-canvas"></canvas>