uptake-affinity
A simple npm package for creating an iframe when a div has an ID of uptake-affinity
.
Installation
To install the package, run the following command:
npm install @uptake-affinity/typescript
Usage
Add a div with the ID uptake-affinity
to your HTML file:
<div id="uptake-affinity"></div>
Import the generateIframe
function and call it with the realm
value:
<script type="module">
import { generateIframe } from '@uptake-affinity/typescript';
generateIframe('affinity-test');
</script>
functions
The package exports the following functions:
generateIframe(realm: string): void
Creates an iframe and appends it to the div with the ID uptake-affinity.
getQueryParameter(parameter: string): string | null
Returns the value of the specified query parameter from the URL.
getCurrentHost(): string
Returns the current host of the document.
buildAffinityLoginUrl(redirectUri: string, realm: string, kcIdpHint: string, keycloakRootUrl?: string, clientId?: string): string
Builds a Keycloak login URL with the specified parameters.