npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@deliveryassured-ai/web-html-script-tag

v1.0.2

Published

## Overview

Downloads

10

Readme

DeliveryAssured Client Integration

Overview

This project integrates the Vapi client into any website, providing a voice assistant for support purposes. The Vapi client is powered by an easy-to-install JavaScript SDK, which is included in the website via a simple code snippet.

Features

  • Voice Assistant: Enhance user experience with our voice assistant instantly.
  • Customization: Configure the assistant's settings to match your website's needs.
  • UI Flexibility: If needed, use the exposed CSS classes to further customize the appearance and behavior of the assistant on your webpage.

Installation

To add DeliveryAssured to your website, include the following javascript snippet in your HTML file inside a script tag:

<script>
  (function (d, t) {
    var g = document.createElement(t),
      s = d.getElementsByTagName(t)[0];
    g.src =
      "https://cdn.jsdelivr.net/npm/@deliveryassured-ai/web-html-script-tag@latest/dist/assets/index.js";
    g.defer = true;
    g.async = true;
    s.parentNode.insertBefore(g, s);

    g.onload = function () {
      const deliveryassured = window.deliveryassuredSDK.run({
        apiKey: "", // required Use your Public Key
        assistant: assistant, // required
        assistantOverrides: {}, // optional (This lets you override the assistant configuration and can be used alongside assistantId.)
        config: buttonConfig // optional
      });

      if(deliveryassured) {
        // Extend more using deliveryassured

      }
    };
  })(document, "script");
</script>

Where value of assistant can be your assistant ID (Dashboard > Assistants > Select your assistant > Copy the id) or assistant config like below example.

const assistant = {
  model: {
    provider: "openai",
    model: "gpt-3.5-turbo",
    systemPrompt:
      "You're a versatile AI assistant named DeliveryAssured who is fun to talk with.",
  },
  voice: {
    provider: "11labs",
    voiceId: "paula",
  },
  firstMessage: "Hi, I am DeliveryAssured how can I assist you today?",
};

You can also create squad using the assistant to handle complex workflows and tasks. For example.


const squad = {
  "squad": {
    "members": [
      {
        "assistantId": "information-gathering-assistant-id",
        "assistantDestinations": [{
          "type": "assistant",
          "assistantName": "Appointment Booking",
          "message": "Please hold on while I transfer you to our appointment booking assistant.",
          "description": "Transfer the user to the appointment booking assistant after they say their name."
        }],
      },
      {
        "assistant": {
          "name": "Appointment Booking",
        },
      }
    ]
  }
}

(function (d, t) {
    var g = document.createElement(t),
      s = d.getElementsByTagName(t)[0];
      g.src =
        "https://cdn.jsdelivr.net/npm/@deliveryassured-ai/web-html-script-tag@latest/dist/assets/index.js";
    g.defer = true;
    g.async = true;
    s.parentNode.insertBefore(g, s);

    g.onload = function () {
      const deliveryassured = window.deliveryassuredSDK.run({
        apiKey: "", // required Use your Public Key
        squad: squad, // You can pass in squad as an option to create squad.
        config: buttonConfig // optional
      });

      if(deliveryassured) {
        // Extend more using deliveryassured

      }
    };
  })(document, "script");


You can also customise the look and feel of your DeliveryAssured Support Button using the following configurations. The button will have 3 states, idle, loading and active.

const buttonConfig = {
  position: "bottom-right", // "bottom" | "top" | "left" | "right" | "top-right" | "top-left" | "bottom-left" | "bottom-right"
  offset: "40px", // decide how far the button should be from the edge
  width: "50px", // min-width of the button
  height: "50px", // height of the button
  idle: {
    // button state when the call is not active.
    color: `rgb(93, 254, 202)`,
    type: "pill", // or "round"
    title: "Have a quick question?", // only required in case of Pill
    subtitle: "Talk with our AI assistant", // only required in case of pill
    icon: `https://unpkg.com/[email protected]/icons/phone.svg`,
  },
  loading: {
    // button state when the call is connecting
    color: `rgb(93, 124, 202)`,
    type: "pill", // or "round"
    title: "Connecting...", // only required in case of Pill
    subtitle: "Please wait", // only required in case of pill
    icon: `https://unpkg.com/[email protected]/icons/loader-2.svg`,
  },
  active: {
    // button state when the call is in progress or active.
    color: `rgb(255, 0, 0)`,
    type: "pill", // or "round"
    title: "Call is in progress...", // only required in case of Pill
    subtitle: "End the call.", // only required in case of pill
    icon: `https://unpkg.com/[email protected]/icons/phone-off.svg`,
  },
};

Configuration

You can customize the assistant by modifying the assistant object. The apiKey should be replaced with your unique key provided by DeliveryAssured.

UI Customization

The SDK exposes several CSS classes that can be targeted for custom styling. Here is a list of the classes you can customize:

  • .deliveryassured-btn: The main class for the DeliveryAssured button.
  • .deliveryassured-btn-is-idle: The class for the DeliveryAssured button when the call is disconnected.
  • .deliveryassured-btn-is-active: The class for the DeliveryAssured button when the call is active.
  • .deliveryassured-btn-is-loading: The class for the DeliveryAssured button when the call is connecting.
  • .deliveryassured-btn-is-speaking: The class for the DeliveryAssured button when the bot is speaking.
  • .deliveryassured-btn-pill: The class for DeliveryAssured button to set pill variant.
  • .deliveryassured-btn-round: The class for DeliveryAssured button to set round variant.

You can add custom styles to these classes to match the look and feel of your website. These are exposed in case u need some more customisations besides the position, color and offset config available currently.