One script tag lets a site's visitors contribute compute to the grid. It needs no API key, no account and no configuration.
Add this to your pages, ideally near the end of <body>:
<script src="https://YOUR-HOST/client.js" async></script>
The host above is filled in with this site's address, so the snippet can be copied as-is. Anyone may add it to any site. Contributing compute is separate from using it: a site that volunteers its visitors does not need an account, and an account is not needed to volunteer.
If the script is served from a CDN or a different path, point it at the grid explicitly with data-server="https://YOUR-HOST" on the tag.
If you have an mPAKT Grid account, the work your visitors' devices do can be credited to it. Take your volunteer code (it starts with vc_) from the volunteering panel on /account or /compute, and add it to the tag:
<script src="https://YOUR-HOST/client.js" data-account="vc_xxxxxxxxxxxx" async></script>
The code is public by design: it sits in your page's source and only says which account to credit. Anything that does not look like a code, and any code the grid does not know, is ignored, and the script works exactly as before. Accepted work earns a share of its value in credits, up to a daily cap, and a contributor tier over the last 30 days that takes a percentage off your boxes' costs and adds bonus credits to card purchases; work done for your own account's boxes, models or tasks earns nothing. If a code is misused, rotate it on the same panel and the old one stops earning at once (a tag that still carries it keeps working, uncredited). Crediting is optional and has no effect on what visitors see; their side of it is described in the participation agreement.
On first visit the script starts and shows a notice saying so, with two buttons: Opt out and Continue to site. The choice is remembered in a cookie on your domain, so they are only asked once.
Whether an opt-out model is appropriate for your visitors is your call and depends on where they are — some jurisdictions require prior consent for this kind of processing. The agreement page describes the behaviour accurately either way, and it may be embedded in an iframe as part of your own consent flow.
The script starts a Web Worker. All computation and networking happen there, never on the page's main thread, so your site's interactivity is unaffected. It uses WebGPU where the browser has it, an NPU through WebNN where one exists, and plain JavaScript otherwise. The worker holds its data in memory under fixed caps sized from the device, and releases it when the page closes.
Results a visitor produces are sometimes needed by another participant. When that happens the two browsers may connect directly instead of routing the data through the grid's server, which is faster for everyone. This is disclosed on the participation agreement, since establishing such a connection makes the two devices' IP addresses visible to each other.
It can also run other people's web applications. The script adds a hidden, sandboxed frame from the grid to your page, where the visitor's browser may run "boxes" (small web applications from the grid's Compute service), sometimes in a Linux virtual machine. Boxes cannot see your page, its cookies or storage, or your visitors' data, and a box's own internet access goes through the grid's servers, not the visitor's connection; but the browser does download runtimes and packages for them (several tens of MB the first time) and spends extra memory and processor time. A box's own files are fetched by the visitor's browser from GitHub (raw.githubusercontent.com) and checked against hashes the grid recorded, so your visitors' connection contacts GitHub as well as the grid, and the jsDelivr, npm and PyPI hosts. The agreement discloses this to visitors, and it all stops when they opt out.
The script is about 14 KB (5 KB compressed). The part that changes with each release is served from a versioned address and cached for a year; only a few-hundred-byte loader is fetched fresh, so an update reaches every visitor immediately.
The script exposes a small API on window.mpaktGrid, so you can put participation in your own settings UI rather than relying on the notice alone:
mpaktGrid.stop(); // withdraw now and for future visits
mpaktGrid.stop(true); // ...and reload, to be certain nothing is left running
mpaktGrid.start(); // opt back in
mpaktGrid.status; // "working" | "reconnecting" | "stopped" | ...
mpaktGrid.onStatus(s => console.log(s)); // returns an unsubscribe function
It appears once the script has loaded, so guard with if (window.mpaktGrid) if you call it early. The older name window.vTMu refers to the same object, so existing integrations keep working.
Content-Security-Policy, it needs to allow this host in script-src, connect-src and frame-src, plus worker-src blob:. The hidden frame has a Content-Security-Policy of its own, so the connections it makes do not need to be listed in yours.Cross-Origin-Embedder-Policy: require-corp can load it too; its scripts are served with Cross-Origin-Resource-Policy: cross-origin.The script tag is for websites. To contribute a computer of your own, with its GPU, TPU or NPU and limits you choose, use the volunteer program instead.
Delete the script tag. Any consent cookies previously set on your domain simply go unused.