@mushi-mushi/core
The universal foundation every SDK builds on. Framework-agnostic.
Install
pnpm add @mushi-mushi/coreAPI
Mushi.init(config) (web) / MushiProvider (React Native)
interface MushiConfig {
projectId: string // UUID from the console Projects page
apiKey: string // report:write key — shown once at project creation
apiEndpoint?: string // override for self-hosted deployments
}Get both values in one step by running mushi login or by creating a project in
the Mushi console — the ID and
key are shown together on the success screen after project creation.
MushiWidgetConfig (selected keys)
interface MushiWidgetConfig {
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
theme?: 'light' | 'dark' | 'auto'
trigger?: 'auto' | 'edge-tab' | 'attach' | 'manual' | 'hidden'
/** 1.19+ — privacy caption under screenshot preview */
screenshotSensitiveHint?: boolean | string
}See docs/SDK_SCREENSHOT_PREVIEW.md
for the full preview + consent flow.
submitReport(input)
interface MushiReport {
description: string
severity?: 'low' | 'medium' | 'high' | 'critical'
category?: 'bug' | 'feature_request' | 'usage_question' | 'other'
component?: string
screenshot?: Blob | string // base64 or Blob
metadata?: Record<string, unknown>
}flushOfflineQueueNow()
Force any queued reports out before page unload or app suspend. The web, React-Native, iOS, Android, Flutter, and Capacitor SDKs all wire this into the appropriate lifecycle hook automatically.
Region resolution
import { resolveRegionEndpoint, REGION_ENDPOINTS } from '@mushi-mushi/core'
const url = await resolveRegionEndpoint({ projectId: 'p_…', region: 'eu' })REGION_ENDPOINTS contains the canonical URLs:
const REGION_ENDPOINTS = {
us: 'https://dxptnwrhwsqckaftyymj.supabase.co/functions/v1/api',
eu: 'https://dxptnwrhwsqckaftyymj.supabase.co/functions/v1/api',
jp: 'https://dxptnwrhwsqckaftyymj.supabase.co/functions/v1/api',
}Last updated on