Skip to content

Latest commit

 

History

History
83 lines (65 loc) · 4.04 KB

File metadata and controls

83 lines (65 loc) · 4.04 KB

SAS Visual Investigator Solution Extensions

Table of Contents

  1. Home
  2. Getting Started
  3. Adding Mobile Solution Extensions
  4. Manually Uploading Bundles
  5. Debugging Solution Extensions Using Sourcemaps
  6. Using Existing Bearer Token For Upload
  7. Mobile Solution Extensions On Viya 3.5 (10.8)

Manually Uploading Bundles

The @sassoftware/vi-solution-extension-upload package enables developers to upload a bundled collection of solution extensions to a deployed instance of SAS Visual Investigator.

Prerequisites

  • A deployed instance of SAS Visual Investigator 10.8 or later (extra steps are required when uploading mobile solution extensions to a 10.8 server, detailed here).
  • A JavaScript bundle containing solution extensions to upload.

Use cases

  • Writing solution extensions across various JavaScript frameworks.
  • Manually creating and registering solution extensions as Custom Elements within the DOM.

Vue Example

For a detailed example of how to create and upload a solution extension written in VueJS, refer to the Vue Example in the examples directory.

Setup

The upload tool requires specific environment variables to be set in order to upload solutions to a remote server. In order to specify the login credentials, server address, and bundle path, you must create and populate an .env file with the following environment variables:

SVI_HOSTNAME=http://example-host.na.sas.com
SVI_USERNAME=username
SVI_PASSWORD=password
SVI_BUNDLE_PATH=./dist/elements/main.js
SMI_BUNDLE_PATH=./dist/mobile-elements/main.js

NOTE: The variables SVI_BUNDLE_PATH and SMI_BUNDLE_PATH, if it is included, must point to the relative path of a valid JavaScript bundle.

Uploading to SAS Visual Investigator

You can now upload solution extensions to your own deployed instance of SAS Visual Investigator.

via Package Script

  1. Install the @sassoftware/vi-solution-extension-upload and env-cmd package(s) as dev dependencies:
    npm install --save-dev env-cmd @sassoftware/vi-solution-extension-upload
  2. Add the upload script to your package.json file:
    "scripts": {
        "upload": "env-cmd node -e \"require('@sassoftware/vi-solution-extension-upload/src/uploader').upload()\"",
        ...
    }
  3. Run the upload script:
    npm run upload

If unsuccessful, check that the bundle path, login credentials, and server address that you have provided are correct.

via the CLI

You can also run the solution extension upload script directly from the CLI by adding the environment variables in .env to your environment and running the upload script directly via node:

# Export .env to local environment
export $(grep -v '^#' .env | xargs)

# Install upload tooling globally
npm i -g @sassoftware/vi-solution-extension-upload

# Run the upload script directly
node -e "require('@sassoftware/vi-solution-extension-upload/src/uploader').upload()"

Versioning

Solution extensions have a numeric version which is automatically incremented each time an extension bundle is uploaded. On SAS Viya 4, this version ensures that the browser retrieves the latest script on refresh without requiring users to clear their cache.

Additional resources

For more information about the vi-solution-extension-upload package, see https://www.npmjs.com/package/@sassoftware/vi-solution-extension-upload.