The Cart that Never Forgets
Eliminate database contention on launch day. Use Rivet Actors to hold shopping carts, reserve inventory, and power agentic search sessions across devices.
1import { actor } from "rivetkit";23export const shoppingCart = actor({4 state: { items: [], history: [] },56 actions: {7 // Instant recommendations based on hot state8 recommend: async (c) => {9 const recent = c.state.history.slice(-5);10 return await c.ai.recommend(recent);11 },1213 addItem: async (c, { productId, qty }) => {14 const stock = await c.rpc.inventory.reserve(productId, qty);15 if (!stock) throw "Out of Stock";1617 c.state.items.push({ productId, qty });18 c.broadcast("cart_updated", c.state);19 }20 }21});The Universal Session
Stop syncing database rows to keep devices in sync. With Rivet, the Actor is the session. All devices connect to the same living process.
Built for Conversion
Speed is revenue. Rivet makes your store feel instant.
Inventory Reservation
Hold items in the actor's memory for 10 minutes. If the user doesn't checkout, release stock instantly.
Universal Cart
The same cart state follows the user from mobile to desktop to tablet. No refresh required.
Agentic Search
Use the actor's session history to feed a vector search instantly, re-ranking results based on user intent.
Live Recommendations
Update suggested products in real-time as the user scrolls, based on their immediate view history held in RAM.
Flash Sales
Handle huge spikes in traffic. 100k users can add to cart simultaneously without locking your database.
Collaborative Shopping
Allow multiple users to view and edit the same cart (e.g. families or procurement teams).
High-Volume Drop
A streetwear brand launching a limited edition collection. 50,000 users arrive in 60 seconds.
- No Overselling: Atomic decrement of inventory in memory
- Queueing: Fair FIFO processing of checkout requests
- Instant Feedback: UI updates immediately on success/fail
Commerce at Scale
Marketplaces
Coordinate buyers and sellers in real-time auctions with instant bid updates.
Ticketing
Reserve seats for concerts or events. Prevent double-booking with atomic locks.
Food Delivery
Track order status, driver location, and inventory in a single stateful entity.
Subscription Apps
Manage access rights and feature gating dynamically based on payment status.
Works with your stack
Sell without limits
Build shopping experiences that are fast, reliable, and instantly synchronized.