// Appwrite-Client der Seite: ein Client, die Dienste daraus. // Im Browser läuft die API über dieselbe Domain (`/v1`), damit das Session-Cookie first-party ist. import { Account, Client, Storage, TablesDB } from 'appwrite'; export const APPWRITE_ENDPOINT: string = import.meta.env.VITE_APPWRITE_ENDPOINT || `${location.origin}/v1`; export const APPWRITE_PROJECT: string = import.meta.env.VITE_APPWRITE_PROJECT_ID || 'aircard'; /** Datenbank, Tabelle und Bucket des Projekts (siehe web/scripts/appwrite-setup.mjs). */ export const IDS = { database: 'aircard', table: 'cards', bucket: 'card-images' } as const; export const client: Client = new Client().setEndpoint(APPWRITE_ENDPOINT).setProject(APPWRITE_PROJECT); export const account: Account = new Account(client); export const tables: TablesDB = new TablesDB(client); export const storage: Storage = new Storage(client);