Offline export
Offline exporting of widgets allows you to create a local copy for offline or on-premise use. To perform this task, you will need to obtain an API key from your project settings and the widget ID from the share feature. This guide will walk you through the process.
Prerequisites
Before you begin, make sure you have the following:
- Node.js installed (version 18 or higher). The official Node.js website.
- API Key: You can obtain the API key by navigating to your project settings
- Widget ID: To locate the Widget ID, please visit the 'Share' section. The Widget ID is a unique identifier associated with the specific widget you intend to export.
Using the Command Line
To export a widget for offline use, follow these steps:
- Open your command line terminal.
- Execute the following command, replacing
[api key]
and[widget key id]
with your actual API key and widget ID:For example:curl -s https://scena.link/offline/download.js | node - [api key] [widget key id]
This command will download and save the widget locally tocurl -s https://scena.link/offline/download.js | node - "ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB" "aaaaabbbbb"
dist
directory. - Copy the downloaded contents to your webserver root or another directory of your choice.
Note: If you need to update the offline copy in the future, you can execute the same script again. It will only download new files, making the process faster.
Manual Download and Customization
Alternatively, you can manually download the download.js file from https://scena.link/offline/download.js and customize it to fit your needs. To do this, follow these steps:
- Open a web browser and navigate to https://scena.link/offline/download.js
- Right-click on the page and select "Save Page As" to download the
download.js
file to your computer. - Open your command line terminal.
- Navigate to the directory where you saved the
download.js
file. - Execute the following command, replacing
[api key]
and[widget key id]
with your actual API key and widget ID:node download.js [api key] [widget key id]
You can customize download.js according to your preferences.