@checkoutkit/redis
v0.2.0
Published
Redis-backed idempotency store for CheckoutKit
Downloads
76
Maintainers
Readme
@checkoutkit/redis
Shared idempotency store for @checkoutkit/server.
pnpm add @checkoutkit/redisYou need this if you run more than one instance. The default store is
in-memory, so a retry that lands on another replica finds no record and is
replayed as a fresh request — which on /complete means charging twice.
import { createAcpServer } from "@checkoutkit/server";
import { RedisIdempotencyStore, fromIoRedis } from "@checkoutkit/redis";
import Redis from "ioredis";
const acp = createAcpServer({
backend,
idempotency: new RedisIdempotencyStore({ client: fromIoRedis(new Redis(process.env.REDIS_URL!)) }),
});fromNodeRedis is provided for node-redis; anything that can run a script works
via the RedisCommandClient interface, so this package depends on no driver.
Claiming a key is a read-compare-write, so it runs as a Lua script — two concurrent requests carrying the same key must not both be told to proceed. Completing does not extend the TTL, and an expired key is not resurrected.
CheckoutKit is an independent community implementation of the Agentic Commerce Protocol. It is not affiliated with, sponsored by, or endorsed by OpenAI or Stripe.
Part of CheckoutKit · Apache-2.0
