@misar/lib (2.0.2)
Published 2026-10-16 17:07:34 +00:00 by misaradmin
Installation
@misar:registry=npm install @misar/lib@2.0.2"@misar/lib": "2.0.2"About this package
@misar/lib
Shared utilities and configuration for the MisarIO monorepo.
Overview
This package contains shared utilities, types, and configurations used across all MisarIO applications and packages.
Features
- Supabase Integration: Client and server-side Supabase utilities with proper TypeScript types
- SSO Utilities: Helper functions for SSO operations
- Type Definitions: Shared TypeScript interfaces and types
Installation
pnpm add @misar/lib
Usage
Supabase Client
import { createClient } from '@misar/lib/supabase/client';
const supabase = createClient();
const { data, error } = await supabase.auth.getUser();
Supabase Server
import { createClient } from '@misar/lib/supabase/server';
export async function GET() {
const supabase = createClient();
const { data, error } = await supabase.auth.getUser();
// Handle server-side authentication
}
API Reference
Supabase
createClient(): Creates a Supabase client for client-side operationscreateServerClient(): Creates a Supabase client for server-side operationscreateAdminClient(): Creates an admin client with elevated permissions
SSO
hasCheckedSSO(): Checks if SSO has been checked this sessionmarkSSOChecked(): Marks SSO as checkedperformSilentSSOCheck(): Performs a silent SSO check
Environment Variables
NEXT_PUBLIC_SUPABASE_URL: Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY: Supabase anonymous keySUPABASE_SERVICE_ROLE_KEY: Supabase service role key (server-side)
Development
This package is part of the MisarIO monorepo. Changes here affect all applications.
# Build the package
pnpm build
# Run tests
pnpm test
# Type check
pnpm typecheck
Contributing
When adding new utilities:
- Ensure proper TypeScript types
- Add JSDoc documentation
- Include tests where appropriate
- Update this README if needed
License
MIT
Dependencies
Dependencies
| ID | Version |
|---|---|
| @supabase/ssr | ^0.8.0 |
| @supabase/supabase-js | ^2.47.10 |
| clsx | ^2.1.1 |
| tailwind-merge | ^2.6.0 |
Development dependencies
| ID | Version |
|---|---|
| @types/react | ^19.2.18 |
| typescript | ^5.9.3 |
Peer dependencies
| ID | Version |
|---|---|
| next | >=15.5.21 <16 |
| posthog-js | >=1.400.0 |