0.4.0 • Published 7 months ago

fogbender v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

fogbender

https://fogbender.com/

NPM

Install

npm install fogbender

Or if you are using other package managers like yarn, pnpm or bun:

npm i -g @antfu/ni && ni fogbender

Usage

import { createNewFogbender } from "fogbender";

const addFogbender = async rootEl => {
  const clientUrl = "https://main--fb-client.netlify.app";
  const token = {
    widgetId: "dzAwMTQ5OTEzNjgyNjkwNzA3NDU2",
    customerId: "org123",
    customerName: "Org Name",
    userId: "example_PLEASE_CHANGE",
    userEmail: "user@example.com",
    userHMAC: "04b7c1aab187a84bfa3160b99c100df08c78b3a1e25884fc13d8d72a9b96ddc3",
    userName: "User Name",
    userAvatarUrl:
      "https://user-images.githubusercontent.com/7026/108277328-19c97700-712e-11eb-96d6-7de0c98c9e3d.png", // optional
  };

  const fogbender = createNewFogbender();
  fogbender.setClientUrl(clientUrl);
  fogbender.setToken(token);
  const cleanup = await fogbender.renderIframe({ headless, rootEl });
  return cleanup;
};

const rootEl = document.getElementById("root");
const cleanup = addFogbender(rootEl);
setTimeout(() => {
  cleanup();
}, 10000);

Examples

License

MIT © JLarky

0.4.0

7 months ago

0.2.3

9 months ago

0.2.2

10 months ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.6

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago