How fragile is this proof of concept?

RionG
Giga Contributor

I have an Angular application built with Node that is bundled as a single IIFE. In ServiceNow, I created a UI Page that acts as the host document for the app. The compiled JavaScript and CSS are stored as attachments in ServiceNow, and the UI Page references those build artifacts directly:

<link rel="stylesheet" href="/sys_attachment.do?sys_id=1234" /> 
<script src="/sys_attachment.do?sys_id=5678"></script>


That UI Page is then embedded in a UI Builder page using a now-iframe component (/ui_page.do?sys_id=7890). The iframe is configured to fill the full width and height of the container, and the Angular app owns the entire UI within the iframe.

Data is passed from UI Builder into the Angular app via the Data property on the now-iframe. Currently, I’m sending user context and group information this way. From within the Angular app, I’m also able to make Table API REST calls, since the app runs in the ServiceNow session context and can detect the presence of the g_ck token on the parent window.

Problems identified so far:

  • Client-side routing has to be handled via querystring parameters (e.g. /app?page=home, /app?page=news) rather than path-based routes. I also have to sync the parameters in parent the URL <--> state of the app.

  • Any additional static assets (such as images) would need to be hosted in ServiceNow as well, likely using the same attachment-based pattern as the JS and CSS.

The primary use case is to support a number of simple external applications. Today, these apps maintain their own authentication, authorization, and SQL-based persistence in our Microsoft stack, even though the underlying user, group, and data may already exists in ServiceNow.

The goal is to embed simple applications into ServiceNow so their security and data access can be refactored to use ServiceNow, without fully rebuilding the UI in UI Builder / snabbdom. This provides a fast, pragmatic way to integrate lightweight apps while preserving their existing UI, and is especially appealing for rapid iteration and generative-AI–assisted development. 

I realize this is an unconventional approach, and I’m not committed to it. I’m mainly trying to understand how fragile it is in practice — what gotchas I might be missing, and whether this tends to break during upgrades or platform changes. I’m very open to being told this is a bad idea; I’m mainly sanity-checking the tradeoffs before going further.

0 REPLIES 0