2.0.19 • Published 7 months ago

ai12z v2.0.19

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

ai12z Web Components

ai12z is a library of web components to integrate ai12z platform to you website / web app.

Setup

To install from npm:

npm install ai12z@latest --save
npm install ai12z-cta --save
npm install ai12z-knowledge-box  --save

Getting Started

HTML

  • Put a script tag similar to this <script type='module' src='https://unpkg.com/ai12z@latest/dist/esm/library.js'></script> in the head of your index.html
  • Then you can use the element anywhere in your html
  • The tag named as ai12z-cta allows us to show the search results along with the follow up chat conversations and customize our search results.
  • This control is having two tag element which is mentioned below.
<<ai12z-cta>
  <privacy slot="custom-privacy"></privacy>
  <cta slot="cta"></cta>
</<ai12z-cta>
  • (Optional) This tag element allows us to add the privacy policy links.
  • (Optional) This tag element allows us to customize our page by adding our own tag elements within this element.

The control contains following properties to customize the page.

  • data-key (Required) api key from your ai12z project settings.
  • data-mode (Required) Allows us to enter the data-mode which will identify the server as local or dev or prod.
  • heading (Optional) allows us to show the header text.
  • button-text (Optional) allows us to customize the button name.
  • help-text (Optional) allows us to customize the helper text.
  • no-results-text (Optional) allows us to customize the no results found text.
  • auto-search (Optional) allows us to configure the search option.
  • placeholder (Optional) allows us to customize the placeholder text.
  • icon-src (Optional) allows us to add the icon to the search button.
  • categorize (Optional) allows us to customize the search results based on the category. By default the search results will be catogorized.
  • clear-memory (Optional) allows us to clear the previously searched data. By defualt, this property is set to true.
  • image-upload (Optional) allows us to perform a image based search.By default, this property is set to true.
  • The second control named as ai12z-knowledge-box allows us to send the query programmmatically through javascript and rendering the query results by clicking on the button.

The control contains following properties to customize the page.

  • data-key (Required) api key from your ai12z project settings.
  • data-mode (Required) Allows us to enter the data-mode which will identify the server as local or dev or prod.
  • question (Optional) allows us to set the question for on-load.
  • relavance-score (Optional) allows us to view the score of clicks, engagement, conversions and negative reviews.
  • feedback (Optional) allows us to add the thumbs up and down option for the question. By default this property set to true.

Usage

We are providing the option named as dataAttributes for assigning the JSON object programmatically and sending those object to the API payload for furthur use.

<script>
  const ele = document.querySelector('ai12z-cta');
  ele.dataAttributes = {
    content: {
      newlist: [
        {
          _uid: "BUY6Drn9e1",
          component: "foo",
          headline: "Foo"
        },
        {
          _uid: "gJZoSLkfZV",
          component: "bar",
          title: "Bar"
        },
        {
          _uid: "X1JAfdsZxy",
          component: "foo",
          headline: "Another headline"
        }
      ]
    }
};
</script>

Events

<script>
  // Reference to your component
  const ele = document.querySelector("ai12z-cta")

  // onErrored
  ele.addEventListener("errored", (event) => {
    console.error("Error:", event.detail)
  })

  // onButtonClicked
  ele.addEventListener("buttonClicked", (event) => {
    console.log("Button clicked:", event.detail)
  })

  // onMessageSent
  ele.addEventListener("messageSent", (event) => {
    console.log("Sent message:", event.detail)
  })

  // onMessageReceived
  ele.addEventListener("messageReceived", (event) => {
    console.log("Received message:", event.detail)
  })

  // onOpen
  ele.addEventListener("open", () => {
    console.log("Component opened")
  })

  // onClose
  ele.addEventListener("close", () => {
    console.log("Component closed")
  })
</script>


2.0.19

7 months ago

2.0.18

8 months ago

2.0.16

8 months ago

2.0.17

8 months ago

2.0.15

9 months ago

2.0.14

9 months ago

2.0.13

9 months ago

2.0.12

9 months ago

2.0.7

9 months ago

2.0.6

9 months ago

2.0.9

9 months ago

2.0.8

9 months ago

2.0.11

9 months ago

2.0.10

9 months ago

2.0.5

10 months ago

2.0.4

10 months ago

2.0.3

10 months ago

2.0.2-alpha.0

10 months ago

2.0.2-alpha.1

10 months ago

2.0.3-alpha.3

10 months ago

2.0.3-alpha.2

10 months ago

2.0.3-alpha.1

10 months ago

2.0.3-alpha.0

10 months ago

2.0.1-alpha.0

10 months ago

1.0.18

11 months ago

1.0.17

12 months ago

1.0.16

12 months ago

1.0.15

12 months ago

1.0.14

12 months ago

1.0.13

12 months ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.10

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2-alpha.0

1 year ago

0.0.1-alpha.76

1 year ago

0.0.1-alpha.75

1 year ago

0.0.1-alpha.67

1 year ago

0.0.1-alpha.66

1 year ago

0.0.1-alpha.69

1 year ago

0.0.1-alpha.68

1 year ago

0.0.1-alpha.65

1 year ago

0.0.1-alpha.64

1 year ago

0.0.1-alpha.70

1 year ago

0.0.1-alpha.72

1 year ago

0.0.1-alpha.74

1 year ago

0.0.1-alpha.73

1 year ago

0.0.1-alpha.63

1 year ago

0.0.1-alpha.61

1 year ago

0.0.1-alpha.62

1 year ago

0.0.1-alpha.60

1 year ago

0.0.1-alpha.59

1 year ago

0.0.1-alpha.56

1 year ago

0.0.1-alpha.58

1 year ago

0.0.1-alpha.57

1 year ago

1.0.0

1 year ago

0.0.1-alpha.55

1 year ago

0.0.1-alpha.54

1 year ago

0.0.1-alpha.53

1 year ago

0.0.1-alpha.49

1 year ago

0.0.1-alpha.50

1 year ago

0.0.1-alpha.52

1 year ago

0.0.1-alpha.51

1 year ago

0.0.1-alpha.47

1 year ago

0.0.1-alpha.48

1 year ago

0.0.1-alpha.45

1 year ago

0.0.1-alpha.44

1 year ago

0.0.1-alpha.46

1 year ago

0.0.1-alpha.43

1 year ago

0.0.1-alpha.42

1 year ago

0.0.1-alpha.41

1 year ago

0.0.1-alpha.34

1 year ago

0.0.1-alpha.36

1 year ago

0.0.1-alpha.38

1 year ago

0.0.1-alpha.39

1 year ago

0.0.1-alpha.33

1 year ago

0.0.1-alpha.32

1 year ago

0.0.1-alpha.30

2 years ago

0.0.1-alpha.31

2 years ago

0.0.1-alpha.29

2 years ago

0.0.1-alpha.27

2 years ago

0.0.1-alpha.26

2 years ago

0.0.1-alpha.28

2 years ago

0.0.1-alpha.25

2 years ago

0.0.1-alpha.23

2 years ago

0.0.1-alpha.22

2 years ago

0.0.1-alpha.24

2 years ago

0.0.1-alpha.21

2 years ago

0.0.1-alpha.20

2 years ago

0.0.1-alpha.18

2 years ago

0.0.1-alpha.17

2 years ago

0.0.1-alpha.19

2 years ago

0.0.1-alpha.16

2 years ago

0.0.1-alpha.15

2 years ago

0.0.1-alpha.14

2 years ago

0.0.1-alpha.12

2 years ago

0.0.1-alpha.11

2 years ago

0.0.1-alpha.13

2 years ago

0.0.1-alpha.10

2 years ago

0.0.1-alpha.9

2 years ago

0.0.1-alpha.8

2 years ago