- Install nanostores for lightweight state management - Add enhanced Directus client with auth and realtime - Configure PWA with offline support and service worker - Enable auto-sitemap generation for SEO - Add Partytown for web worker analytics - Implement image optimization with astro-imagetools - Add bundle visualizer for performance analysis - Enable Brotli compression for all assets - Add Vite Inspect for debugging - Create sidebar state management store - Install TipTap rich text editor - Add React Hook Form + Zod validation - Add TanStack Query for data fetching All plugins tested and build verified successfully.
13 lines
541 B
TypeScript
13 lines
541 B
TypeScript
import { createDirectus, rest, authentication, realtime } from '@directus/sdk';
|
|
import type { SparkSchema } from '@/types/schema';
|
|
|
|
const DIRECTUS_URL = import.meta.env.PUBLIC_DIRECTUS_URL || 'https://spark.jumpstartscaling.com';
|
|
|
|
export const directus = createDirectus<SparkSchema>(DIRECTUS_URL)
|
|
.with(authentication('cookie', { autoRefresh: true, mode: 'json' }))
|
|
.with(rest())
|
|
.with(realtime());
|
|
|
|
// Re-export for convenience
|
|
export { readItems, readItem, createItem, updateItem, deleteItem, aggregate } from '@directus/sdk';
|