@proofgeist/fmdapi
Version:
FileMaker Data API client
23 lines • 738 B
JavaScript
export function upstashTokenStore(config, options = {}) {
const { prefix = "" } = options;
const getRedis = async () => {
const redis = await import("@upstash/redis");
return new redis.Redis(config);
};
return {
getToken: async (key) => {
const redis = await getRedis();
return redis.get(prefix + key);
},
setToken: async (key, value) => {
const redis = await getRedis();
await redis.set(prefix + key, value);
},
clearToken: async (key) => {
const redis = await getRedis();
await redis.del(prefix + key);
},
};
}
export default upstashTokenStore;
//# sourceMappingURL=upstash.js.map