- Home
- Getting Started
- Adding Mobile Solution Extensions
- Manually Uploading Bundles
- Debugging Solution Extensions Using Sourcemaps
- Using Existing Bearer Token For Upload
- Mobile Solution Extensions On Viya 3.5 (10.8)
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.
- 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.
- Writing solution extensions across various JavaScript frameworks.
- Manually creating and registering solution extensions as Custom Elements within the DOM.
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.
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.jsNOTE: The variables
SVI_BUNDLE_PATHandSMI_BUNDLE_PATH, if it is included, must point to the relative path of a valid JavaScript bundle.
You can now upload solution extensions to your own deployed instance of SAS Visual Investigator.
- 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
- Add the upload script to your
package.jsonfile:"scripts": { "upload": "env-cmd node -e \"require('@sassoftware/vi-solution-extension-upload/src/uploader').upload()\"", ... }
- 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.
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()"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.
For more information about the vi-solution-extension-upload package, see https://www.npmjs.com/package/@sassoftware/vi-solution-extension-upload.