managarten/packages/shared-auth-stores/src/index.ts
Wuesteon d36b321d9d style: auto-format codebase with Prettier
Applied formatting to 1487+ files using pnpm format:write
  - TypeScript/JavaScript files
  - Svelte components
  - Astro pages
  - JSON configs
  - Markdown docs

  13 files still need manual review (Astro JSX comments)
2025-11-27 18:33:16 +01:00

45 lines
1.3 KiB
TypeScript

/**
* @manacore/shared-auth-stores
*
* Svelte 5 auth store factories for the ManaCore monorepo.
*
* Provides two approaches:
* 1. createAuthStore - Generic factory that works with any auth service adapter
* 2. createSupabaseAuthStore - Direct Supabase integration for simpler setups
*
* @example Generic auth store with custom adapter
* ```ts
* import { createAuthStore } from '@manacore/shared-auth-stores';
* import { authService } from '$lib/auth';
* import type { AppUser } from '$lib/types';
*
* export const authStore = createAuthStore<AppUser>(authService);
* ```
*
* @example Supabase auth store
* ```ts
* import { createSupabaseAuthStore } from '@manacore/shared-auth-stores';
* import { createBrowserClient } from '@supabase/ssr';
*
* const getClient = () => createBrowserClient(url, key);
* export const authStore = createSupabaseAuthStore(getClient);
* ```
*/
// Factory functions
export { createAuthStore } from './createAuthStore.svelte';
export { createSupabaseAuthStore } from './createSupabaseAuthStore.svelte';
export type {
CreateSupabaseAuthStoreOptions,
SupabaseUser,
} from './createSupabaseAuthStore.svelte';
// Types
export type {
BaseUser,
AuthResult,
AuthServiceAdapter,
AuthStoreState,
AuthStoreActions,
AuthStore,
} from './types';