Open jamesarosen opened 11 months ago
Ah! This example suggests the solution is to use PluggableStorage
from the browser SDK.
This issue seems relevant again now that this library's README says,
The JavaScript SDK is an isomorphic library for both Node.js and Web browser environments.
Yes @jamesarosen ,
As explained here, this package doesn't support custom storages yet :/.
Because of the benefits you mentioned, we plan to support it, but there is no ETA yet. Let's keep this issue open until we have a solution for it.
I'd like to use Vercel KV as my storage. It's an implementation of Redis, but it doesn't expose a Redis URL. Instead, there's a JavaScript client library that supports the same methods.
Ideally, there would be some contract, expressed as a TypeScript interface, for a custom storage. I'd then be able to pass in my own factory instead of
"memory"
or"redis"
.Currently, that's impossible because
getStorage
is closure-scoped, as isgetModules
, which calls it.Some additional benefits of this approach:
localStorage
or Cloudflare KV