0.1.0-beta.4 • Published 4 years ago

flash-assistant v0.1.0-beta.4

Weekly downloads
16
License
-
Repository
-
Last release
4 years ago

Hackaton ASSISTANT

Assistant HACKATON ASSISTANT

How to use

In Browser

(function (d, l, c) {
  var s = d.createElement('script');
  s.async = true;
  s.src = l;
  s.onload = c;
  d.body.append(s);
})(document, 'https://unpkg.com/flash-assistant@^0.1.0-beta.0/build/widget.js';, function () {
  var assistant = window.Assistant({
    //you can set the config initial
    user_id: '123',
    product: 'GOOGLE'
  });

  // Or later
  var assistant = window.Assistant();
  assistant.setConfig({  user_id : '123', product: 'GOOGLE' });
});

Via npm

// Assistant.ts <~ create in your application
import Assistant from 'flash-assistant';

export async function setConfig(yourConfig: IYourInterface) {
  const promiseAssistant = Assistant();
  const assistant = await promiseAssistant;
  if (!assistant) return;

  assistant.setConfig(yourConfig);
}