protect() options
Every option you can pass to protect(), with its type, default and what it does.
Options
quoteDetails
The quote must match your product’s published fields: a variant the product doesn’t list, or an extra it doesn’t name, is refused. If the quote is refused, the step proceeds, as for any error, and the browser console lists each field that was refused.
Keep it fast and free of side effects. It’s called when a review starts, with up to 10 seconds to return. After an approval, it’s called each time the step is used, and the step waits up to 2.5 seconds (or timeoutMs) for it. If it throws, returns something that isn’t { quote, mobile }, or takes too long, the step proceeds and the browser console shows the reason. See After an approval.
userId
Your own ID for this customer, such as a customer or account number. It’s sent with each check, so you can search a customer’s checks and approvals in the portal, and your server gets it back with the review.
- 1 to 128 characters once trimmed, with no control characters. A value that breaks this is left out with a console warning, and the check still runs.
- Use an opaque ID from your own system, not an email address, phone number or name. If the value looks like an email address or phone number, it isn’t stored.
- It’s never kept in the browser’s storage.
signal
Your own detection result, sent instead of the embed’s own measures, for products set to use your own signal on the portal’s Agent detection page. All fields are optional:
See Agent detection for how a product uses it.
timeoutMs
How long the step waits for its check before it proceeds (fails open).
A value outside the range is clamped to it.
- The same limit bounds the comparison after an approval.
- A re-check after a fail-open waits 1 second, or
timeoutMsif that’s shorter. - When it runs out,
onResultreceivesfail_openwithreason: "timeout". - A longer limit means a customer can wait longer when HumanApproved is slow: at most twice per quote (the limit, then the 1-second re-check).
- For a monitor-only product no press waits, so
timeoutMsonly matters for products that can pause a press.