afex-app-widget
v1.3.11
Published
AFEX applications widget containing all AFEX's systems for easy accessibility by staff
Downloads
89
Readme
WidgetController Package
Installation
To install the WidgetController package, run the following command:
npm install afex-app-widget
Usage
Import the WidgetController component from the package and use it in your code as shown below:
//app-header.tsx
import React from "react";
import { WidgetController } from "afex-app-widget";
function App() {
const widgetConfig = {
widgetURL: "https://widgeturl.com",
SSO_URL: "https://ssourl.com",
apiKey: "someapikey",
email: "[email protected]",
};
return (
<div>
<h1>My App</h1>
<WidgetController config={widgetConfig} />
</div>
);
}
Props
config (IWidgetControllerProps, required): Configuration object for the Widget Controller component, containing the following properties:
position ("left" | "right", optional): Specifies the position of the widget. It can be either "left" or "right". If not provided, the default position is "left".
email (string, required): Specifies the email associated with the widget.
width (string, optional): Specifies the width of the widget. You can provide a string value representing the width. If not provided, the widget will have the default width.
apiKey (string, required): Specifies the API key for authentication.
color ("#FFFFFF" | "#8F9198", optional): Specifies the color of the Widget Controller. Use "#FFFFFF" for white or "#8F9198" for another color. Defaults to "#FFFFFF".
widgetURL (string, required): Specifies the endpoint used to fetch the list of service providers.
SSO_URL (string, required): Specifies the URL for Single Sign-On (SSO) based on the environment.