1.0.5 • Published 2 years ago

@uptake-affinity/typescript v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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.

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago