@uptake-affinity/typescript
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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.

Package Sidebar

Install

npm i @uptake-affinity/typescript

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

4.97 kB

Total Files

6

Last publish

Collaborators

  • anthony.garand