Predict docs
Ask what a visitor will do next.
Predict reads a few page signals and returns a small, typed prediction. Your site decides what to show.
Install your own Worker on GitHub →
Install
Add the browser script to your site.
<script src="https://predict.coey.dev/snippet.js"></script> Make a prediction
const prediction = await Predict({
endpoint: "/predict",
session: crypto.randomUUID(),
action: "bounce"
}); The call returns the prediction. action is a caller-defined label that says why you are asking. Use any string. The examples below are not an allowlist.
Use the result
if (prediction.next === "compare") {
showPlanComparison();
}
if (prediction.next === "clarify") {
showHelpfulHint();
} Response
{
"next": "compare",
"confidence": 0.82,
"model": "jev-1.13.0",
"heads": { ... }
} next and confidence are the simple path. heads contains the full signal set for merchants that need more detail.
Actions
Actions are open labels from your site. Name them after the event that caused the prediction request.
action: "pricing_confusion"
action: "checkout_stall"
action: "returning_customer" Predict echoes your action as reason. It does not limit or reinterpret the label. The response field next is separate: it is Predict's suggested next step.
Deploy it yourself
Install the Worker in your own Cloudflare account when you are ready. Your endpoint, billing, and limits stay with you. The same open action API works with your own events and visitor flows.
What Predict does not do
It does not write copy, open popups, or change your page. It returns a signal. Your code owns the response.