@xmtp/redis-persistence
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

redis-persistence

An example of a custom persistence layer that can be used for caching conversations in xmtp-js using Redis.

Usage

import { RedisPersistence } from "@xmtp/redis-persistence"
import { Client } from "@xmtp/xmtp-js"
import { createClient } from "@redis/client"

const redis = createClient({
  url: "redis://localhost:6379",
})
await redis.connect()

const client = await Client.create(someWallet, {
  basePersistence: new RedisPersistence(redis, "xmtp:"),
})

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.4
    147
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.4
    147
  • 0.0.3
    0
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i @xmtp/redis-persistence

Weekly Downloads

147

Version

0.0.4

License

MIT

Unpacked Size

101 kB

Total Files

12

Last publish

Collaborators

  • alexxmtp
  • fabriguespe
  • nplasterer-xmtp
  • saul-xmtp
  • nick-xmtp
  • xmtp-eng-robot
  • galligan