@crossup/storefront is the only thing your store needs from CrossUp. It
requests recommendations, reads your catalog, carries a made-up visitor and sends
signals in batches, and it can’t break your page.
@crossup/storefront.
Create the instance
One per page. Only the key and the connection are required.What it does for you
- The visitor: a made-up id on every request. It can be turned off, kept in memory or replaced.
- The context: page, referrer, language and screen. It identifies no one.
- The connection: you set it once, not on every call.
- The signals: queued, batched and retried on their own.
The guarantees
tryGetRecommendationsreturnsnullif something fails. It never throws.track.*never throws or waits for the network: call it withoutawait.- A signal that fails on the network is retried on its own, with the same id.
- If the engine doesn’t answer, the recommendation comes back empty with a reason, not an error.
What you will see
If you don’t see it
Request recommendations
The request, and what comes back.
Visitor and context
What travels, what doesn’t, and what to do without consent.