Skip to content

Adapters ​

An adapter is a repository implementation for one specific service: it implements StorageRepository, DocumentsRepository, or AssetsRepository on top of R2, a filesystem, a git host, a SQL database, and so on. Everything above the repository contract — the JSON:API servers, the Decap backend, your own code — works the same whichever adapter you plug in. See Repositories for how the contracts fit together.

Most applications only need a storage adapter: laikacms/documents/catalog and laikacms/assets/catalog project documents and assets onto any storage adapter, and any serializer (JSON, YAML, Markdown, raw) works with any storage adapter.

All adapters ​

An adapter can provide a storage, documents and assets repository; the columns link to each one's documentation.

AdapterStorageDocumentsAssets
GitHubStorage
GitLabStorage
BitbucketStorage
GitHub CDNStorage
Cloudflare R2StorageAssets
S3-compatibleStorage
Drizzle ORMStorageDocuments
FilesystemStorage
Browser File SystemStorage
Web StorageStorage
WebDAVStorage
ObsidianDocumentsAssets
JSON:API proxyStorageDocumentsAssets

The list is compiled from adapters.yaml in the repository root, and each adapter page from the README next to its implementation.

Writing your own ​

Any class that extends StorageRepository (or DocumentsRepository / AssetsRepository) is an adapter. Run it against the shared contract tests in laikacms/storage/testing (and documents/testing, assets/testing) to check it behaves like the built-in ones.

Released under the MIT License.