This browser SDK lets partner frontends embed a whitelabeled Fleck iframe and authenticate users via postMessage.
Add the SDK package to your app:
npm install @fleck.chat/partner-sdkNote
TypeScript types are included.
Install dependencies locally:
npm installCompiles fleck_sdk.cljs and bundles it into a single browser-ready file at dist/fleck_sdk.mjs.
npm run buildRuns browser-based tests in Chromium (via Web Test Runner + Playwright).
npm run test:install # run once to download browsers
npm run testnpm publish --access publicfleckSdk.init(options) returns a Promise that resolves to an SDK instance:
fleck.auth({ jwt }): Sends the partner-signed JWT to the iframe.fleck.iframe: The<iframe>element created by the SDK.fleck.origin: The computed origin fromsrc(e.g.,https://fleck.partner.gltd/app→https://fleck.partner.gltd).
<div id="fleck-container"></div>
<script type="module" src="./dist/fleck_sdk.mjs"></script>
<script type="module">
const options = {
container: document.getElementById('fleck-container'),
src: 'https://fleck.partner.gltd'
};
const fleck = await fleckSdk.init(options);
fleck.auth({ jwt: window.FLECK_JWT });
</script>MIT. See LICENSE.