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
+22 -10
View File
@@ -1,10 +1,22 @@
export default defineNuxtPlugin(async (nuxtApp) => {
if (!nuxtApp.payload.serverRendered) {
await useAuth().fetchSession()
} else if (Boolean(nuxtApp.payload.prerenderedAt) || Boolean(nuxtApp.payload.isCached)) {
// To avoid hydration mismatch
nuxtApp.hook('app:mounted', async () => {
await useAuth().fetchSession()
})
}
})
export default defineNuxtPlugin({
name: 'better-auth-triplit',
enforce: 'pre',
async setup(nuxtApp) {
if (import.meta.client) {
const triplit = useTriplitClient();
const { session, fetchSession } = useAuth();
nuxtApp.hook('app:mounted', async () => {
if (!session.value) {
await fetchSession();
}
if (!session.value) return;
if ('startSession' in triplit) {
await triplit.startSession(session.value.token);
}
});
}
},
});