Redis adapter
@ltikit/adapter-redis provides the NonceStore only — ideal for serverless, where in-memory state
can’t enforce single-use nonces across cold invocations. Single-use is guaranteed by an atomic GETDEL.
Redis holds the nonce store; platforms are durable config, so pair this with a durable
PlatformStore — Prisma, Supabase, or your own.
npm i @ltikit/core @ltikit/adapter-redisWire the store
Section titled “Wire the store”import { createLti, staticKeyStore } from '@ltikit/core'import { redisNonceStore, fromUpstash } from '@ltikit/adapter-redis'import { Redis } from '@upstash/redis'
export const lti = createLti({ keys: staticKeyStore({ /* ...your tool keypair... */ }), nonces: redisNonceStore(fromUpstash(Redis.fromEnv())), // fast serverless nonces platforms: prismaPlatformStore(prisma), // or supabase / your own})No hard dependency on any Redis client — redisNonceStore takes a structural RedisLike
(set with TTL + atomic getdel). Ships helpers for the common clients:
import { fromUpstash, fromIoRedis, fromNodeRedis } from '@ltikit/adapter-redis'- Single-use is enforced by
GETDEL: a replayedstatefinds nothing →consumereturnsnull. - Nonces are short-lived — the
createcall sets the key with the record’s TTL, so expired handshakes clean themselves up.