Recording & Showing Hexus Demos in your App using SDK
Incase, you’d like to use the SDK instead of the chrome extension, please follow the steps below.
Note: Before you start recording your content, you need to install Hexus.js in your web app.
Hexus.js is a tiny piece of JavaScript code, which is loaded asynchronously in your web app, so it won’t affect your page load speed.
The installation is simple and only requires 3 quick steps:
- Choose installation method
- Install Hexus.js
- Replace placeholders
Step 1: Choose installation method
Hexus.js can be installed in one of 2 ways:
- Browser apps using module bundlers (such as Webpack or Rollup)
- Go to Step 2A (npm installation)
- Other browser apps and Google Tag Manager
- Go to Step 2B (HTML snippet installation)
We also have specific instructions for special apps/tools:
- Google Tag Manager
- Electron apps via hexus-electron
- GoHighLevel
- Self-hosted (WIP)
Example projects are available on the private GitHub link included in your license.
Step 2A. Private npm packages
The Hexus private npm hosts the following packages.
@hexus/hexus-capture
@hexus/hexus-search
Locale files are available in the package, but can also be imported from @hexus/hexus/locale/<locale_code>
.
Installing private npm packages
-
Create a new file in your project root folder and name it
.npmrc
. -
Copy the contents below to the file:
-
Replace
$HEXUS_NPM_TOKEN
with your private HEXUS npm token as shown on the customer portal under your license details.
HEXUS scoped packages are now automatically installed from the HEXUS repository.
Sometimes the package manager will stick to the test version, in that situation you can try the following before re-installing:
- Run
npm uninstall @hexus/hexus
. - Remove the
node_modules
folder andpackage-lock.json
file. - Reinstall
@hexus/hexus
.
Step 2B: HTML snippet installation
Only do this if you did not complete Step 2A.
Copy-paste the following snippet into your HTML document before the ending </body>
tag:
Important: Make sure to replace the placeholders with real, dynamic values from your app!
Integrating Hexus Capture in Your App React Example
Other example projects are available on the private GitHub link included in your license.
1. Installation
Ensure that you have installed the @hexus/hexus
package.
2. Integrating Hexus into Your Application
Integrate Hexus into your application to utilize its demo creation capabilities.
3. Example Usage in Your App
Integrate the demo recording and playback functionality into your application.
4. Capturing Click-Throughs
You can also capture click-through events using Hexus by utilizing its built-in methods.
This setup assumes that @hexus/hexus
provides the necessary methods (init
, startRecording
, stopRecording
, playDemo
, and captureClick
) to handle demo creation and click-through capturing. Adjust the implementation details as necessary based on the specific features and methods provided by the SDK.
Add CMD+K search and navigation in minutes
Improve your self-serve UX by offering keyboard-enabled searching of Hexus content, demos navigation across pages, and shortcuts to powerful actions
Other Example projects are available on the private GitHub link included in your license.
Integrating Hexus Search in Your App React example
1. Installation
First, ensure that you have installed the @hexus/hexus-search
package as described previously.
To display the recorded demos, you need to retrieve the saved data and render it in your application. Here’s an example using React:
2. Example Usage
To use the search functionality and display component in your application, you can integrate it as follows:
This is a basic example to get you started with recording and displaying search results using the @hexus/hexus-search
package in your application. You can expand on this by adding more features and improving the user interface as needed, adding shortcuts etc.