Skip to Content
v0.8.0 · shippedNative iOS / Android / Flutter / Capacitor SDKs, A2A discovery, SOC 2 readiness, residency, BYO storage, BYOK. Read the changelog →
SDK reference@mushi-mushi/core

@mushi-mushi/core

The universal foundation every SDK builds on. Framework-agnostic.

Install

pnpm add @mushi-mushi/core

API

initMushi(config)

interface MushiConfig { projectId: string apiKey: string // public API key region?: 'us' | 'eu' | 'jp' // optional pin; defaults to auto apiUrl?: string // override (self-hosted) enableOfflineQueue?: boolean // default true rateLimit?: { perMinute?: number } scrubPii?: boolean // default true logger?: MushiLogger }

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://us.api.mushimushi.dev', eu: 'https://eu.api.mushimushi.dev', jp: 'https://jp.api.mushimushi.dev', }
Last updated on