Skip to content

fleckchat/partner-sdk

Repository files navigation

Fleck Partner SDK

This browser SDK lets partner frontends embed a whitelabeled Fleck iframe and authenticate users via postMessage.

Install (Consumers)

Add the SDK package to your app:

npm install @fleck.chat/partner-sdk

Note

TypeScript types are included.

Install (Contributors)

Install dependencies locally:

npm install

Build

Compiles fleck_sdk.cljs and bundles it into a single browser-ready file at dist/fleck_sdk.mjs.

npm run build

Test

Runs browser-based tests in Chromium (via Web Test Runner + Playwright).

npm run test:install # run once to download browsers
npm run test

Publish

npm publish --access public

SDK Interface

fleckSdk.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 from src (e.g., https://fleck.partner.gltd/apphttps://fleck.partner.gltd).

Usage

<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>

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published