A static build of the apps is committed to this repository in the public/apps/ directory. In case of the webapp-schulverwaltung this happens automatically via a GitHub Actions Workflow. For the other apps the latest build has to be committed manually.
For more details see Deployment View.
The Evento Portal loads the apps in an <iframe>
to ensure a proper separation of the runtime environment. For more details on this decision see ADR 2: App Integration via iframe.
To compensate the limitations of the <iframe>
and setup communication between the Evento Portal and the app, each app has to include the public/scripts/iframe.js script in its index.html
:
<body>
<!-- App contents... -->
<script src="../../scripts/iframe.js" type="module"></script>
</body>
Apps can use client-side hash-routing, that means using the hash part of the URL to store application state. The Evento Portal ensures, that the hash part is mapped from the <iframe>
's URL to the browser URL and vice versa.
An app can rely on the following information that is provided by the Evento Portal:
What | Where | Note |
---|---|---|
Access token | sessionStorage.getItem("CLX.LoginToken") |
Value: quoted string ("ey..." ) |
Access token (legacy) | localStorage.getItem("CLX.LoginToken") |
Value: quoted string ("ey..." ) sessionStorage instead. |
Access token expiration (legacy) | localStorage.getItem("CLX.TokenExpire") |
Value: Unix timestamp in milliseconds when access token expires as string. |
User's locale | • localStorage.getItem("uiCulture") • Document's lang attribute (<html lang="de-CH"> )• culture_info property in access token |
Value: string of user's locale such as de-CH or fr-CH |
JSON.parse
on the value).