Hosting SAP Analytics Cloud Custom Widgets Resources

Objective

After completing this lesson, you will be able to explain the different hosting options for SAP Analytics Cloud custom widget resource files.

Hosting Custom Widgets

Introduction

Imagine you've developed a fantastic custom widget for SAP Analytics Cloud, enhancing your dashboards with unique visualizations and functionalities. Now, you need to make it accessible within your SAP Analytics Cloud environment. This lesson will guide you through the process of hosting your custom widget's resource files, ensuring they are readily available for your dashboards and applications.

Custom Widget Components

Custom widgets in SAP Analytics Cloud consist of two main components: the custom widget JSON file and the resource files. The JSON file defines the widget structure and references the resource files. The resource files, on the other hand, contain the actual code and assets that make the widget function, such as JavaScript and image files.

To successfully deploy a custom widget, both the JSON file and the resource files must be accessible to SAP Analytics Cloud at runtime. The JSON file is uploaded directly to your SAP Analytics Cloud instance.

The resource files can either be hosted on an external HTTPS-enabled web server or directly within SAP Analytics Cloud.

This lesson focuses on the different hosting options available for these resource files.

SAP Analytics Cloud offers two primary methods for hosting custom widget resource files: internal hosting within SAP Analytics Cloud and external hosting using a web server.

Internal Hosting in SAP Analytics Cloud

SAP Analytics Cloud allows you to host resource files directly within your tenant. This approach involves packaging the resource files into a ZIP archive and uploading it to SAP Analytics Cloud. The custom widget JSON file then references these files using relative paths.

Upload File

Advantages:

  • Simplified deployment: All custom widget artifacts are kept within SAP Analytics Cloud, streamlining the deployment process.
  • No external web server required: Eliminates the need for managing an external web server.

Restrictions

Keep in mind these restrictions if you want to upload the resource files into SAP Analytics Cloud:

  • Ensure that you have the Create permission for custom widget within your SAP Analytics Cloud tenant.
  • The file name extension of the compressed files must be .zip
  • The ZIP file should be no larger than 10 MB
  • The ZIP file supports ONLY the following resource files: Web Component JavaScript, Web Component JavaScript of the Styling Panel, Web Component JavaScript of the Builder Panel, and icon.
  • CSS and HTML files are not supported
  • File types for icons must be .jpg or .png
  • Subfolders in the ZIP file are not supported
  • At most 50 custom widgets with resources hosted by SAP are allowed on each tenant

External Hosting (Example: GitHub Pages)

In this approach, custom widget resource files are hosted on an external HTTPS-enabled web server. The custom widget JSON file references these files using absolute URLs.

The external server acts as a static file repository. SAP Analytics Cloud loads the resource files at runtime but does not execute them on the server.

GitHub Pages provides a free and convenient way to host static website content directly from a GitHub repository. It offers a simple and effective solution for hosting custom widget resource files. However, it's essential to consult the GitHub Pages documentation for usage limits and best practices before deploying to a production environment.

If you want to know more details visit the Hosting SAP Analytics Cloud Custom Widgets into GitHub - SAP Community page.

Summary

  • SAP Analytics Cloud custom widgets require both a JSON file (uploaded to the tenant) and resource files (hosted on a web server).
  • Internal hosting within SAP Analytics Cloud offers simplifies deployment by keeping all widget artifacts within SAP Analytics Cloud but has limitations on file size, type, and the number of widgets.
  • External hosting, such as with GitHub Pages, provides greater flexibility and scalability for resource files.
  • Both hosting concepts are supported and can be used depending on organizational preferences and requirements.