Replies: 1 comment
-
Converting the storage configuration into Storage Adapters can be very useful to integrate with local json databases or even Astro DB if they want to. I'm not talking of providing support for relational databases. More like to provide a clean key/value adapter interface to extend and use it to customize the location of our data. import LocalStorage from '@keystatic/local-storage'
export default config({
storage: new LocalStorage()
}) import Storage from '@keystatic/storage'
class CustomStorage extends Storage {
kind = 'custom'
async list () { } // list of files?
async getItem (key) { } // return an item
async setItem (key, value) { } // store an item
// ... maybe some auth methods for github, gitlab authentication
}
export default config({
storage: new CustomStorage()
}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Allow project develoeprs to describe their own storage backend, allowing them to wire up other gitlike apis (or what ever other storage api they like):
I don't think it matters what the storage services might be (gitlab, azure, https://min.io/) but more that the interface that keystatic expects should be defined and pluggable.
end result should be that I can write an npm package that can be inserted into the keystatic config that changes how content is read and written.
Beta Was this translation helpful? Give feedback.
All reactions