@misar/lib (1.0.0)
Published 2026-03-13 15:03:57 +00:00 by misaradmin
Installation
@misar:registry=npm install @misar/lib@1.0.0"@misar/lib": "1.0.0"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
- Sentry Configuration: Error tracking setup with consent mode support
- 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
}
Sentry Configuration
import { getSentryBrowserConfig, getSentryServerConfig } from '@misar/lib/sentry';
// In sentry.client.config.ts
export default getSentryBrowserConfig({ analyticsConsent: true });
// In sentry.server.config.ts
export default getSentryServerConfig();
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
Sentry
getSentryBrowserConfig(): Gets browser-side Sentry configurationgetSentryServerConfig(): Gets server-side Sentry configurationfilterSensitiveData(): Filters PII from error reportsgetSentryTags(): Gets custom tags for error categorization
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)NEXT_PUBLIC_SENTRY_DSN: Sentry DSN for error trackingSENTRY_AUTH_TOKEN: Sentry auth token for source maps
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.5.2 |
| @supabase/supabase-js | ^2.47.10 |
| clsx | ^2.1.1 |
| tailwind-merge | ^2.6.0 |
Development dependencies
| ID | Version |
|---|---|
| typescript | ^5.7.3 |
Peer dependencies
| ID | Version |
|---|---|
| next | >=15.0.0 |
Details
2026-03-13 15:03:57 +00:00
Assets (1)
Versions (3)
View all
npm
45
24 KiB
lib-1.0.0.tgz
24 KiB