speculumapp
v1.0.2
Published
Seamlessly guide customers through your website, catalog, or products with our powerful co-browsing feature, Screen Share, and Live Video. Remove barriers and significantly enhance your customer experience.
Downloads
11
Maintainers
Readme
Speculum
Seamlessly guide customers through your website, catalog, or products with our powerful co-browsing feature, Screen Share, and Live Video. Remove barriers and significantly enhance your customer experience.
Table of Contents
Installation
You can install the Speculum package via npm:
npm install speculumapp
Usage
To use the Speculum package in your project, you can import it as follows:
import { Speculumapp } from 'speculum';
// Initialize the Speculum SDK
let spec = new Speculumapp({});
spec.initialize({
apikey: "paste your key",
});
Example
Here’s a basic example of how to integrate Speculum into your application:
<script>
// Initialize speculum variable
let speculum;
// Create a new script element to load the Speculum SDK
const scriptElement = document.createElement("script");
scriptElement.src = "https://sdk.speculumapp.xyz/speculum.min.js";
scriptElement.async = true;
// Insert the script before the first existing script tag
const firstScriptTag = document.getElementsByTagName("script")[0];
firstScriptTag.parentNode.insertBefore(scriptElement, firstScriptTag);
// Define the onload function to initialize speculum once the SDK is loaded
scriptElement.onload = function () {
if (!speculum) {
try {
speculum = new Speculumapp({});
speculum.initialize({
apiKey: "your license key", // Replace with your actual license key
});
} catch (error) {
console.error("Failed to initialize Speculum SDK:", error);
}
}
};
// Optional: Handle script loading errors
scriptElement.onerror = function () {
console.error("Failed to load the Speculum SDK.");
};
</script>