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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@sawport/react-sdk

v1.3.0

Published

The Sawport Widget enables secure customer interactions—video calls, chat, document upload, and e-signature—embedded directly into your website or web application.

Downloads

574

Readme

Sawport Widget Integration Guide

Overview

The Sawport Widget enables secure customer interactions—video calls, chat, document upload, and e-signature—embedded directly into your website or web application.

Available integrations:

  • Web (CDN Embedded)
  • React SDK
  • Vue.js ES Module Integration

This guide provides configuration steps and usage examples for all supported platforms.

Using Sawport Widget on the Web (CDN)

2.1 Add Required Scripts and Styles

Place this inside your HTML <head> tag:

<link
  href="https://cdn.jsdelivr.net/npm/@sawport/react-sdk/dist/react-sdk.css"
  rel="stylesheet"
/>

2.2 Create Widget Container & Mount the Widget

Place this immediately after the <body> tag:

<div style="position: fixed; bottom: 20px; right: 20px; z-index: 200" id="sawport-widget"></div>

<script src="https://cdn.jsdelivr.net/npm/@sawport/react-sdk/dist/index.standalone.js" type="text/javascript"></script>

<script type="text/javascript">
  function docReady(fn) {
    ['complete', 'interactive'].includes(document.readyState)
      ? setTimeout(fn, 1)
      : document.addEventListener('DOMContentLoaded', fn);
  }

  docReady(() => window.sawportReactSDK.mountWidget(
    {
      baseURL: "https://{{BASE_URL}}",
      apiURL: "https://{{BASE_URL}}/api/v1/",
      projectId: "{{PROJECT_ID}}",
      user: { email: '[email protected]', mobile: '080XXXXXXXXX', name: 'Firstname Lastname' }, // optional
    },
    "sawport-widget"
  ));
}
</script>

2.3 Complete HTML Example

<!DOCTYPE html>
<html>
  <head>
    <link
      href="https://cdn.jsdelivr.net/npm/@sawport/react-sdk/dist/react-sdk.css"
      rel="stylesheet"
    />
  </head>

  <body>
    <!-- Your website content -->

    <div
      style="position: fixed; bottom: 20px; right: 20px; z-index: 200"
      id="sawport-widget"
    ></div>

    <script src="https://cdn.jsdelivr.net/npm/@sawport/react-sdk/dist/index.standalone.js" type="text/javascript"></script>

    <script type="text/javascript">
      function docReady(fn) {
        ['complete', 'interactive'].includes(document.readyState)
          ? setTimeout(fn, 1)
          : document.addEventListener('DOMContentLoaded', fn);
      }
    
      docReady(() => window.sawportReactSDK.mountWidget(
        {
          baseURL: "https://{{BASE_URL}}",
          apiURL: "https://{{BASE_URL}}/api/v1/",
          projectId: "{{PROJECT_ID}}",
          user: { email: '[email protected]', mobile: '080XXXXXXXXX', name: 'Firstname Lastname' }, // optional
        },
        "sawport-widget"
      ));
    </script>
  </body>
</html>

2.4 Updating Enterprise Credentials Dynamically

<script type="text/javascript">
  window.sawportReactSDK.setSawportConfig({
    baseURL: 'https://{DASHBOARD_HOST_DOMAIN}',
    apiURL: 'https://{DASHBOARD_HOST_DOMAIN}/api/v1/',
    projectId: 'XXXXXXXXXXXXXX',
    user: {
      email: '[email protected]',
      mobile: '080XXXXXXXXX',
      name: 'Firstname Lastname',
    }
  });
</script>

Using the Widget in ReactJS

3.1 Install the SDK

yarn add @sawport/react-sdk

3.2 Configure the SDK (Global Config)

Wrap your app with SawportContext.Provider:

import { SawportContext } from '@sawport/react-sdk';

<SawportContext.Provider
  value={{
    config: {
      baseURL: 'https://{DASHBOARD_HOST_DOMAIN}',
      apiURL: 'https://{DASHBOARD_HOST_DOMAIN}/api/v1/',
      projectId: 'XXXXXXXXXXXXXX'
    }
  }}
>
  <YourApp />
</SawportContext.Provider>

3.3 Using the Widget

import { Widget } from '@sawport/react-sdk';

<Widget
  user={{
    email: '[email protected]',
    mobile: '080XXXXXXXXX',
    name: 'Firstname Lastname'
  }}
/>

3.4 Updating Config at Runtime

import { setSawportConfig } from '@sawport/react-sdk';

setSawportConfig({
  user: { 
    email: '[email protected]',
    mobile: '080XXXXXXXXX',
    name: 'Firstname Lastname'
  },
  baseURL: 'https://{DASHBOARD_HOST_DOMAIN}',
  apiURL: 'https://{DASHBOARD_HOST_DOMAIN}/api/v1/',
  projectId: 'XXXXXXXXXXXXXX'
});

Using the Widget in Vue.js

4.1 Install the SDK

yarn add @sawport/react-sdk

4.2 Create Widget Mounting Point

<div id="sawport-widget"></div>

4.3 Mount Widget From Vue App

<script setup>
import { onMounted } from 'vue'
import { mountWidget } from '@sawport/react-sdk'
import HelloWorld from './components/HelloWorld.vue'
// import the SDK css styling
import '@sawport/react-sdk/dist/react-sdk.css'

const dashboardUrl = 'https://{DASHBOARD_HOST_DOMAIN}'

onMounted(() => {
  mountWidget({
    baseURL: dashboardUrl,
    apiURL: `${dashboardUrl}/api/v1/`,
    projectId: 'XXXXXXXXXXXXXX',
    user: {
      email: '[email protected]',
      mobile: '2348123456789',
      name: 'Firstname Lastname'
    },
  }, 'sawport-widget')
})
</script>

<template>
  <div class="wrapper">
    <HelloWorld msg="You did it!" />
  </div>
</template>

API Reference: Sawport SDK

5.1 Widget Component

  • React component for embedding the widget.
  • Props:
    • user: Customer information
    • projectId: Enterprise ID

5.2 SawportContext

  • Global configuration provider.
  • Properties:
    • config: Sawport configuration object
    • setConfig: Update configuration

5.3 setSawportConfig

  • Function for updating SDK config globally.

5.4 sawportConfig Object

  • Fields:
    • user.name: Customer name
    • user.mobile: Customer phone number
    • user.email: Customer email address
    • projectId: Enterprise project ID
    • baseURL: Dashboard domain
    • apiURL: Dashboard API base

5.5 useSawportConfig

  • React hook to access the config object.

5.6 useSawportContext

  • Hook to retrieve both config and setConfig.

5.7 mountWidget

  • Mounts SDK widget into a DOM element.
  • Usage: mountWidget(config, "sawport-widget")

Summary

This page provides a complete guide for integrating the Sawport Widget across:

  • CDN-based web apps
  • React apps
  • Vue.js apps

It includes configuration references, usage patterns, and API documentation for all widget-related tools.