@fruga/sdk
v1.3.5
Published
Fruga SDK
Readme
Fruga SDK (@fruga/sdk)
A lightweight, embeddable widget that allows third-party partners to display insurance quotes and cashback offers directly on their websites.
Currently the SDK ships the Relay widget. The Connect widget is not available yet — its export paths exist but are subject to change.
Installation
pnpm add @fruga/sdkQuick start (React)
import { FrugaWidget } from '@fruga/sdk/loader/react';
export default function MyPage() {
return (
<div style={{ width: '100%', minHeight: '600px' }}>
<FrugaWidget partnerKey="YOUR_PARTNER_KEY" />
</div>
);
}An imperative API (init/mount/unmount/retry from @fruga/sdk/loader) and a script-tag build are also available. init() resolves to a FrugaHandle; pass onError to be notified if a mount fails (see docs/INSTALLATION.md).
2026-09-15: the default
baseUrlabove (production) cannot serve the widget yet — passbaseUrl="https://api-dev.fruga.co.uk"until it is promoted. See the Status callout in docs/INSTALLATION.md.
Native SDKs
Relay also ships as a native WebView-plus-bridge SDK: Android (Android 10+, JitPack), iOS (iOS 16.4+, Swift package) and @fruga/react-native (React Native 0.73+, react-native-webview peer, not yet published — see packages/react-native/README.md).
Documentation
Full integration guides, authentication/JWT setup, configuration options, and API reference live at docs.fruga.co.uk — start with the Relay Getting Started guide.
- CHANGELOG.md — partner-facing changes by release.
- docs/DECISIONS.md — why the SDK behaves the way it does.
- docs/INSTALLATION.md — install, CDN/script-tag embedding, and upgrade notes.
Development
pnpm install
pnpm dev # Watch mode for all apps/packages
pnpm build # Production build
pnpm test # Run tests
pnpm test:coverage # Run tests with coverage (required before a PR; see CONTRIBUTING.md)License
Apache-2.0 — see LICENSE.
