Skip to main content

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:

  1. Open your command line terminal.
  2. Execute the following command, replacing [api key] and [widget key id] with your actual API key and widget ID:
    curl -s https://scena.link/offline/download.js | node - [api key] [widget key id]
    For example:
    curl -s https://scena.link/offline/download.js | node - "ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB" "aaaaabbbbb"
    This command will download and save the widget locally to dist directory.
  3. 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:

  1. Open a web browser and navigate to https://scena.link/offline/download.js
  2. Right-click on the page and select "Save Page As" to download the download.js file to your computer.
  3. Open your command line terminal.
  4. Navigate to the directory where you saved the download.js file.
  5. 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.