Registering
use() returns an unsubscribe function. You can call it before the runtime has installed: a pre-install shim queues plugins and replays them at install time, so script order doesn’t matter. window.nameless.ready resolves once bundle data is loaded, if you need to wait for state rather than just register.
addToCart.before
Runs after selections validate, before the cart request. It can block the add or attach line properties.
Return one of:
PLUGIN_BLOCKED with "{code}: {message}", and remaining before hooks are skipped.
lineProperties are keyed by selector id and land on the matching Shopify cart line as line-item properties. Multiple hooks merge; later hooks win per key.
addToCart.after
Fire-and-forget, runs after the cart responds. Same context plus result:
{ warnings: string[] } to surface messages in the host’s warning log. You cannot change the outcome from here.
Execution semantics
Because slow hooks are cut off at 1500ms, keep network calls out of
before, or accept that a slow response is treated as “no opinion”.