Nuxt x Better Auth
A Nuxt app with a private, auth-gated content area powered by Better Auth.
content.ts
import { CacheArtifact, comarkContent } from 'comark-content'
import fs from 'comark-content/sources/fs'
export const content = comarkContent({
source: fs('./content'),
cache: {
loadManifest: async () => {
const value = await import('nitropack/runtime')
.then(({ useStorage }) => useStorage('assets:content'))
.then((storage) => storage.getItem<CacheArtifact>('manifest.json'))
return value
},
loadSnapshot: async (name) => {
const value = await import('nitropack/runtime')
.then(({ useStorage }) => useStorage('assets:content'))
.then((storage) => storage.getItem<CacheArtifact>(`snapshot-${name}.json`))
return value
},
},
})