Installation
npm i togai-ui-widgets
General Usage
import "togai-ui-widgets/dist/style.css";
import "togai-ui-widgets/dist/packages/config-provider";
import "togai-ui-widgets/dist/packages/<package_name>";
import "togai-ui-widgets/dist/packages";
Sample Usage
Import the below in your app’s main file.
import "togai-ui-widgets/dist/style.css";
import "togai-ui-widgets/dist/packages/config-provider";
Initialize your app’s sub tree within which you gonna render the widgets with,
TogaiWidget.init(
token_obtained_from_togai_api,
{
primary: "#e6007e",
},
"sandbox"
);
import "togai-ui-widgets/dist/packages/metrics";
import { jsonStringify } from "togai-ui-widgets/dist/packages/utils";
<togai-metrics props={jsonStringify(props)} />;
Note : The widget wont render views unless the TogaiWidget is initialized with the token.