Catchy by SphereOne
Add a check before the purchase runs.
Use the private Node SDK immediately before your existing server purchase function. Your host supplies the authority and current checkout evidence.
01 / Access
Request the private SDK.
Authorized users receive a packed SDK and setup help for Node 22.16 or newer. Public npm installation and a production purchase/model API are not available yet. The hosted playground uses synthetic fixtures.
02 / Host setup
Provide the server-owned checks.
authenticate- Resolve the current authenticated caller on every invocation, including receipt replay. Approval eligibility is checked separately.
read- Independently read the original approval and current checkout evidence. Client-supplied text is not spending authority.
semanticGate- Configure the semantic check and any model access your host uses.
claim- Synchronously and atomically claim the approval and budget. A Promise is not accepted for this callback; durable state and cross-process coordination belong to your host.
Persist authority, idempotency and reconciliation in your own backend. The wrapper does not supply a managed identity service, payment executor or cross-process database.
03 / Purchase boundary
Wrap the function you already use.
After authorized SDK setup, the call shape is:
const buy = guardPurchase(existingBuy, {
authenticate, read, semanticGate, claim
});
const result = await buy({ operationId, approvalId });This shows the wrapper interface, not a complete setup. Implement and configure the host callbacks first. The wrapper performs the checks and invokes existingBuy when approved. Do not execute the purchase again from its result.
04 / Outcomes
Separate the decision from execution.
Decision results are approved, blocked or needs_review. Execution outcomes are not_started, succeeded or unknown.
If execution is unknown, reconcile the operation with your purchase system before another payment attempt. Do not automatically retry. Your backend enforces the result and owns recovery.