Code Monkey home page Code Monkey logo

getting-started-widget-react's Introduction

Getting Started with Workspaces Widgets in React

This widget serves as a boilerplate for developing Avaya Workspaces Widgets. It demonstrates functionalities and capabilities from the Workspaces Widget Framework SDK and Avaya Experience Platform APIs. This widget is specifically designed for use within the Avaya Experience Platform.


โš ๏ธ Disclaimer

๐Ÿ’ก This sample application is provided for demonstration purposes only and is not intended for production use. We assume no responsibility for any issues arising from its use.


Current Capabilities

Workspaces Widget Framework SDK

Events

  • onAgentStateEvent: Subscribe to changes in Agent's state (logged in, ready, not ready, etc.).
  • onAnyInteractionEvent: Subscribe to any new Interaction on the agent's desktop.
  • onMediaEvent: Subscribe to Chat, SMS, Messaging, Email, or Social media data like participants or previous messages.

Methods

  • getConfiguration().user: Retrieve the full logged-in Agent configuration.
  • getTeamData(): Get the Agent's team data (colleagues & supervisors).
  • getInteractionData(): Obtain details of the current interaction.

For more events & methods, visit the documentation.

TODO: AXP APIs

Technology

The widget is built using React, Redux, and Webpack.

Folder Structure

โ”œโ”€โ”€ build // Build output folder
โ”œโ”€โ”€ src
โ”‚   โ”œโ”€โ”€ app
โ”‚   โ”‚   โ”œโ”€โ”€ config.js // Configuration file
โ”‚   โ”‚   โ””โ”€โ”€ store.js // Combined Store
โ”‚   โ”œโ”€โ”€ assets // Static Assets (Images, Files, etc.)
โ”‚   โ”‚   โ””โ”€โ”€ images 
โ”‚   โ”œโ”€โ”€ features 
โ”‚   โ”‚   โ””โ”€โ”€ sample-content // Sample Component
โ”‚   โ”‚       โ”œโ”€โ”€ SampleContent.js // React Component 
โ”‚   โ”‚       โ”œโ”€โ”€ SampleContent.module.css // Styling
โ”‚   โ”‚       โ”œโ”€โ”€ sampleContentAPI.js // API Client Calls
โ”‚   โ”‚       โ”œโ”€โ”€ sampleContentSlice.js // State Manager
โ”‚   โ”‚       โ””โ”€โ”€ sampleContentSlice.spec.js // Test File
โ”‚   โ”œโ”€โ”€ services
โ”‚   โ”‚   โ””โ”€โ”€ Auth.js // Authorization Service
โ”‚   โ””โ”€โ”€ shared-components // Shared React Components 
โ”œโ”€โ”€ secrets // Includes SSL certificates
โ”œโ”€โ”€ server.conf
โ”œโ”€โ”€ sample-widget.json // Widget JSON file to import to WS
โ””โ”€โ”€ webpack.config.js // Webpack configuration

To create your own feature:

  • Copy the sample-component folder format, adding required Components, API Calls, and WS Widget SDK Calls.
  • Update store.js with your new component reducer.

Build & Develop

Build and deploy your widget with the following steps after making necessary changes.

Prerequisites

  • Node.js version 18+.
  • Yarn.
  • Docker & Docker Compose (optional).
  • SSL Certificate & Key for serving built files.
  • Upload sample-widget.json to Avaya Experience Platform Admin Portal and Widget Management.

Using Docker

  1. Update docker-compose-dev.yml with SSL certificate locations.
  2. Build and deploy the widget:
    yarn install
    npm run build
    docker-compose -f docker-compose-dev.yml up # add -d for background process
  3. To apply changes, run npm run build and refresh workspaces.

Without Docker

  1. Install dependencies and build:
    yarn install
    npm run build
  2. Serve the build/ folder contents (especially bundle.js) using your preferred web server (NGINX, TomCat, IIS, etc.).

All Done!


If you've done everything correctly, it should look something like this.

Widget Screenshot


Contributions are welcome!

getting-started-widget-react's People

Contributors

zaelzanati avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.