@misar/lib (2.1.0)

Published 2026-10-27 02:39:55 +00:00 by misaradmin

Installation

@misar:registry=
npm install @misar/lib@2.1.0
"@misar/lib": "2.1.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
  • 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 operations
  • createServerClient(): Creates a Supabase client for server-side operations
  • createAdminClient(): Creates an admin client with elevated permissions

SSO

  • hasCheckedSSO(): Checks if SSO has been checked this session
  • markSSOChecked(): Marks SSO as checked
  • performSilentSSOCheck(): Performs a silent SSO check

Environment Variables

  • NEXT_PUBLIC_SUPABASE_URL: Supabase project URL
  • NEXT_PUBLIC_SUPABASE_ANON_KEY: Supabase anonymous key
  • SUPABASE_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:

  1. Ensure proper TypeScript types
  2. Add JSDoc documentation
  3. Include tests where appropriate
  4. Update this README if needed

License

MIT

Dependencies

Dependencies

ID Version
@supabase/ssr ^0.12.7
@supabase/supabase-js ^2.118.0
clsx ^2.1.1
tailwind-merge ^2.6.1

Development dependencies

ID Version
@types/react ^19.3.0
react ^19.3.1
react-dom ^19.3.1
typescript ^5.9.3

Peer dependencies

ID Version
next >=15.5.27 <16
posthog-js >=1.438.12
react ^18.0.0 || ^19.0.0
react-dom ^18.0.0 || ^19.0.0
Details
npm
2026-10-27 02:39:55 +00:00
432
latest
91 KiB
Assets (1)
lib-2.1.0.tgz 91 KiB
Versions (11) View all
2.1.0 2026-10-27
2.0.3 2026-10-22
2.0.2 2026-10-16
2.0.1 2026-10-16
2.0.0 2026-09-15