@agent-cards/commerce-sdk package gives your agent a buy tool that searches stores, builds a cart, and places the order once the shopper approves it. The package also hands your server a message, ready to post into the shopper’s chat, for each moment the shopper should hear about, such as a saved card or a placed order.
Install
@agent-cards/commerce-sdk/browser imports no Node module, so any build tool takes it.
Wire it up
agent.ts
AgentcardClient, one buy tool for the shopper user-42, and one turn for the shopper’s message. Pass turn to your model as its tool. The Quickstart page walks through each framework.
Exports
Every name below comes from@agent-cards/commerce-sdk, except the browser entry.
Client
Buy tool
Turn
Listen
Webhooks
Messages and steps
Browser entry
The browser entry also re-exports the action-link helpers.
Guides
Each guide shows what the shopper sees, the code that implements it, and how to check it in the sandbox.- Quickstart
- Showing products and carting the one the shopper picks
- Showing stores and their menus
- Sending each link: approval, Vault and store sign-in
- Adding a card for a new shopper
- Approving a purchase
- Signing in to a store’s account
- Taking the next step once the shopper finishes outside the chat
- Showing the cart
- Answering each shopper message in its own turn
- Acknowledging the shopper: a reaction or a short text