Skip to content

Memory

Reference doc for the Memory storage adapter.

Configure OpenAuth to use a simple in-memory store.

This is useful for testing and development. It’s not meant to be used in production.

import { MemoryStorage } from "@openauthjs/openauth/storage/memory"
const storage = MemoryStorage()
export default issuer({
storage,
// ...
})

Optionally, you can persist the store to a file.

MemoryStorage({
persist: "./persist.json"
})

Methods

MemoryStorage

MemoryStorage(input?)

Parameters

Returns StorageAdapter

MemoryStorageOptions

Configure the memory store.

MemoryStorageOptions.persist?

Type string

Optionally, backup the store to a file. So it’ll be persisted when the issuer restarts.

{
persist: "./persist.json"
}