0.1.92 • Published 18 days ago

@descope/audit-management-widget v0.1.92

Weekly downloads
-
License
MIT
Repository
github
Last release
18 days ago

@descope/audit-management-widget

Setup

Create an .env file

In the widget package create an .env file which includes;

DESCOPE_BASE_URL=   # env base url, default: "https://app.descope.com"
DESCOPE_PROJECT_ID= # your Descope's project ID
DESCOPE_TENANT=     # tenant ID
DEBUG_MODE=         # "true" / "false", default: "false"
DESCOPE_THEME=      # "light" / "dark" / "os", default: "light"
DESCOPE_WIDGET_ID=  # default: "audit-management-widget"

Example

// replace x.x.x with the latest release of the widget: https://www.npmjs.com/package/@descope/audit-management-widget
<script src="https://static.descope.com/npm/@descope/audit-management-widget@x.x.x/dist/index.js"></script>
<descope-audit-management-widget
  base-url="<DESCOPE_BASE_URL>"
  project-id="<DESCOPE_PROJECT_ID>"
  tenant="<DESCOPE_TENANT>"
  debug="<DEBUG_MODE>"
  theme="<DESCOPE_THEME>"
  widget-id="<DESCOPE_WIDGET_ID>"
></descope-audit-management-widget>

Project Structure

  • /app - contains index.html
  • /lib - widget's source code
  • lib/widget - widget related implementations
  • lib/widget/api - Logic related to API calls
  • lib/widget/mixins - Widget specific logic
  • lib/widget/state - State management logic

API


Mixins

The widget is composed of mixins, each mixin contains specific logic parts, and sometime exposes an API that can be used in other mixins.

Mixins can be composed on top of each other, so we can create new mixins by composing several mixins together.

Mixins Creators

Functions that create mixins, can get a configuration, and returns the mixin functions.

Singleton Mixin

Since mixins are composable, in some cases we want to make sure a mixin is loaded only once. For example: When there is no need for its logic to run multiple times when composed in different mixins.

For this case we have a wrapper function (createSingletonMixin) to ensure that a mixin is loaded only once, regardless how many times it will be composed.

Mixins should be wrapped with the createSingletonMixin wrapper function, unless there is a reason for running the mixin's logic multiple times.

State

We're using several tools to handle the widget's state:

  • Redux Toolkit for the widget's state management.
  • Redux Thunk for API calls and async operations we're using
  • Reselect to compute derived data without hitting performance or triggering state recalculation when state is not mutated.

Drivers

An abstraction layer that provides an API for components, and enables handling interactions with components within the widget.

The motivation to use drivers is to decouple the widget's code from the component's implementation, and therefore it's important to interact with components only using drivers (and not relying on component's implementation details).

Dev

Use mock screens

Since screen are fetched dynamically, when developing a new screen for the widget you will probably want to use mock templates. To do so, simply replace the call to fetchWidgetPage with a string which includes your HTML.

0.1.91

21 days ago

0.1.92

18 days ago

0.1.90

25 days ago

0.1.89

1 month ago

0.1.88

2 months ago

0.1.86

2 months ago

0.1.87

2 months ago

0.1.85

2 months ago

0.1.84

2 months ago

0.1.83

2 months ago

0.1.82

2 months ago

0.1.52

5 months ago

0.1.53

5 months ago

0.1.54

5 months ago

0.1.55

5 months ago

0.1.56

5 months ago

0.1.57

5 months ago

0.1.58

5 months ago

0.1.59

5 months ago

0.1.50

5 months ago

0.1.51

5 months ago

0.1.49

5 months ago

0.1.41

6 months ago

0.1.42

6 months ago

0.1.43

6 months ago

0.1.44

5 months ago

0.1.45

5 months ago

0.1.46

5 months ago

0.1.47

5 months ago

0.1.48

5 months ago

0.1.80

3 months ago

0.1.81

3 months ago

0.1.40

6 months ago

0.1.38

6 months ago

0.1.39

6 months ago

0.1.74

4 months ago

0.1.30

6 months ago

0.1.75

4 months ago

0.1.31

6 months ago

0.1.76

4 months ago

0.1.32

6 months ago

0.1.77

4 months ago

0.1.33

6 months ago

0.1.78

4 months ago

0.1.34

6 months ago

0.1.79

3 months ago

0.1.35

6 months ago

0.1.36

6 months ago

0.1.37

6 months ago

0.1.70

4 months ago

0.1.71

4 months ago

0.1.72

4 months ago

0.1.73

4 months ago

0.1.29

6 months ago

0.1.63

5 months ago

0.1.64

5 months ago

0.1.65

5 months ago

0.1.66

4 months ago

0.1.67

4 months ago

0.1.68

4 months ago

0.1.69

4 months ago

0.1.60

5 months ago

0.1.61

5 months ago

0.1.62

5 months ago

0.1.28

6 months ago

0.1.27

6 months ago

0.1.25

6 months ago

0.1.26

6 months ago

0.1.24

6 months ago

0.1.23

6 months ago

0.1.22

6 months ago

0.1.21

6 months ago

0.1.20

6 months ago

0.1.19

6 months ago

0.1.18

6 months ago

0.1.17

7 months ago

0.1.16

7 months ago

0.1.15

7 months ago

0.1.14

7 months ago

0.1.11

7 months ago

0.1.12

7 months ago

0.1.13

7 months ago

0.1.10

7 months ago

0.1.9

7 months ago

0.1.8

7 months ago

0.1.7

7 months ago

0.1.4

7 months ago

0.1.6

7 months ago

0.1.5

7 months ago

0.1.2

7 months ago

0.1.3

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago