streaming, markdown, model selecting, and lots more

This commit is contained in:
Zoe
2026-02-02 23:16:06 -06:00
parent 8c28946703
commit d5a5945c03
114 changed files with 6109 additions and 2938 deletions
+18 -4
View File
@@ -2,10 +2,24 @@ export default defineNuxtPlugin({
name: 'better-auth-fetch-plugin',
enforce: 'pre',
async setup(nuxtApp) {
const triplit = useTriplitClient();
// Flag if request is cached
nuxtApp.payload.isCached = Boolean(useRequestEvent()?.context.cache)
nuxtApp.payload.isCached = Boolean(useRequestEvent()?.context.cache);
if (nuxtApp.payload.serverRendered && !nuxtApp.payload.prerenderedAt && !nuxtApp.payload.isCached) {
await useAuth().fetchSession()
const { session, fetchSession } = useAuth();
if (!session.value) {
await fetchSession();
}
if (!session.value) return;
if ('updateOptions' in triplit) {
triplit.updateOptions({
token: session.value.token,
});
}
}
}
})
},
});