All skills
secondsky avatar

/sap-sac-custom-widget

@4d87d99
by Eddiesecondsky/sap-skills456 stars
120

SAP Analytics Cloud (SAC) Custom Widget development. Use when building custom visualizations, extending SAC with Web Components, or creating Widget Add-Ons. Covers JSON metadata, JavaScript Web Components, lifecycle functions, data binding with feeds, styling/builder panels, property/event/method definitions, third-party library integration, hosting, security, performance, and debugging. Includes Widget Add-On feature (QRC Q4 2023+) and templates for widgets, charts, and KPI cards.

Use this Skill: https://skilld.dev/gh/secondsky/sap-skills/sap-sac-custom-widget

This session only. Nothing lands on disk.

referenceslocal-builder-workflow.md

≈1.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Local Builder Workflow

Use this reference when a user wants a local SAC custom widget builder for enterprise machines, restricted laptops, or offline-first scaffold generation.

Table of Contents

  1. Purpose
  2. Boundary
  3. Optional Hosted Exploration
  4. Generated Package Shape
  5. Builder Controls
  6. Export Contract
  7. Usage Workflow
  8. Validation Checklist
  9. Source

Purpose

templates/local-builder/ provides a static, no-install browser builder for creating SAC custom widget scaffolds. It is inspired by browser-based widget builders, but keeps all work local and avoids external packages, public CDNs, remote scripts, tenant URLs, credentials, and online services.

Use it when users want to configure widget metadata, properties, feeds, methods, events, builder/styling component choices, and SAC upload artifacts from a browser UI before continuing with code edits.

Boundary

The local builder creates scaffolds and export artifacts. It does not validate live SAC import, tenant trust, resource permissions, story runtime behavior, or real model binding.

Use:

  • local-builder/ for scaffold generation and widget.json plus Resource-ZIP export.
  • design-runtime/ for local preview, scenario switching, design-token tuning, sample data, and agent iteration export.
  • Real SAC tenant import for final truth.

Optional Hosted Exploration

templates/local-builder/ remains the enterprise-safe default for scaffold generation and SAC artifact export. Suggest the hosted Custom Widget Builder or live demo only when the user explicitly permits public-web use for a desktop, non-sensitive visual prototype.

Do not send confidential screenshots, PDFs, tenant details, code, data, credentials, or internal assets to the hosted sites. They are feature-shape references, not live SAC runtime evidence. Treat downloads from them as untrusted external artifacts: validate the manifest and JavaScript locally, inspect the Resource-ZIP, and test import/runtime behavior in a real SAC tenant.

Generated Package Shape

Generated packages should include both local tooling folders when the user wants local iteration:

widget-name/
├── widget.json
├── widget.js
├── builder.js
├── styling.js
├── local-builder/
│   ├── index.html
│   ├── builder.css
│   ├── builder.js
│   ├── builder-config.json
│   └── server.mjs
└── design-runtime/
    ├── index.html
    ├── runtime.css
    ├── runtime.js
    └── design-runtime.json

Do not include local-builder/ or design-runtime/ in SAC Resource-ZIP output.

Builder Controls

The control palette maps local UI controls to portable SAC manifest properties:

Builder control SAC property type
Text input string
Number number
Integer integer
Hex color string string with a hex default
Toggle boolean
Dropdown string
Textarea string
Slider integer
Group label string
Divider boolean

Prefer hex color strings for portable generated packages. Use SAC Color only after the target tenant and exact panel flow accept it.

The Sample Patterns area provides SAP-sample-informed hints for common starting points:

  • Data-bound chart
  • KPI / gauge
  • Flow / hierarchy
  • Builder input utility
  • Widget Add-on reference
  • Build-based app reference

Pattern hints prefill only generic metadata, feeds, support flags, properties, methods, and events. They do not copy SAP sample runtime code, assets, dependencies, tenant URLs, or third-party libraries. Reference-only hints route Widget Add-ons and build-based applications to planning guidance outside the v1 local builder.

Export Contract

The primary builder output is the SAC Resource File upload flow:

  1. widget.json for the first SAC custom widget upload step.
  2. <slug>-resources.zip for the SAC Resource File upload step.

The Resource-ZIP must contain only root-level runtime resources:

widget.js
builder.js
styling.js

Allowed additions are root-level PNG/JPG icons that are referenced by the manifest. Exclude:

  • widget.json
  • local-builder/
  • design-runtime/
  • HTML, CSS, Markdown, JSON, tests, source-only helpers, docs, and nested folders

For SAC Resource-ZIP mode, manifest webcomponents[].url values should be root-relative, such as "/widget.js", "/builder.js", and "/styling.js".

Usage Workflow

  1. Open templates/local-builder/index.html directly.
  2. If direct file mode is blocked, run node server.mjs from templates/local-builder/ and open the loopback URL printed by Node.
  3. Configure metadata, support flags, component tags, properties, feeds, methods, and events.
  4. Optionally apply a Sample Pattern as a generic starting point.
  5. Download widget.json.
  6. Download the Resource-ZIP.
  7. Validate generated files with /widget-validate and JavaScript syntax checks.
  8. Upload widget.json first in SAC.
  9. Upload the Resource-ZIP only after SAC accepts the manifest and enables Resource File upload.
  10. Test with real story data in SAC.

Validation Checklist

Before delivering a package generated through the local builder:

  • widget.json parses and includes methods and events as objects.
  • Component tags are lowercase hyphenated values.
  • Resource-ZIP contains only allowed root-level files.
  • Resource-ZIP does not include builder UI files, preview runtime files, docs, or nested folders.
  • node --check widget.js, node --check builder.js, and node --check styling.js pass for generated component files.
  • Every generated manifest property is read by runtime code, not only stored by a panel or exporter.
  • Numeric controls reject partial or non-finite input and preserve legal zero values.
  • Local preview uses the final component files, not preview-only shared helpers.
  • Live SAC import/runtime validation is not claimed unless performed in a tenant.

Source

Source: SKILL.md on GitHub

1 alert16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides a comprehensive environment and templates for developing SAP Analytics Cloud (SAC) Custom Widgets. It promotes robust security best practices, including subresource integrity (SRI), XSS prevention via input sanitization, and proper Shadow DOM encapsulation. It includes local tools for scaffold generation and iteration that operate on the user's machine without requiring external packages or services.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer6mo

    3/16 files flagged

  • ZeroLeaks5mo

    2 findings · Score: 80/100

Signed by skilld at 4d87d99. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated last month
What it can do
Reads files Runs commands Network
All 3 allowed tools
ReadBashWebFetch
Other metadata
metadata
{
  "maintainer": "Eduard Jiglau",
  "maintainer_email": "hello@sap-ai-skills.com",
  "website": "https://sap-ai-skills.com",
  "version": "2.4.1",
  "last_verified": "2026-06-12",
  "sac_version": "2026.8",
  "errors_prevented": "40+",
  "official_docs": [
    "https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/0ac8c6754ff84605a4372468d002f2bf/75311f67527c41638ceb89af9cd8af3e.html",
    "https://help.sap.com/doc/c813a28922b54e50bd2a307b099787dc/release/en-US/CustomWidgetDevGuide_en.pdf"
  ],
  "samples_repo": "https://github.com/SAP-samples/analytics-cloud-datasphere-community-content/tree/main/SAC_Custom_Widgets",
  "keywords": [
    "sap analytics cloud",
    "sac custom widget",
    "web component sac",
    "json metadata widget",
    "widget lifecycle functions",
    "onCustomWidgetBeforeUpdate",
    "onCustomWidgetAfterUpdate",
    "onCustomWidgetResize",
    "onCustomWidgetDestroy",
    "sac data binding",
    "dataBindings feeds",
    "styling panel widget",
    "builder panel widget",
    "sac echarts integration",
    "sac d3js integration",
    "third party library sac",
    "widget hosting sac",
    "integrity hash widget",
    "sha256 integrity",
    "widget security cors",
    "sac widget debugging",
    "sac analytics designer widget",
    "optimized story experience widget",
    "sac widget api",
    "widget add-on",
    "sac script api widget",
    "shadow dom web component",
    "sac tooltip customization",
    "plot area addon",
    "sac resource zip upload",
    "root relative widget url",
    "resource file upload",
    "builder focus collapse state",
    "self contained component js",
    "resource zip artifact naming",
    "chat download artifacts"
  ]
}

README badge

README badge for secondsky/sap-skills/sap-sac-custom-widget