Skip to main content

Embeddable Widget

Experimental

The TeleID Widget is in an early experimental phase and is available for evaluation purposes only. The API and configuration options may change without notice. If you would like to see a live demo and/or give feedback before it's finalized, reach out to support@idkollen.se.

The TeleID Widget is an embeddable web component that lets you add remote identification to any web application.

widgetImage

How it works

  1. The agent fills in the form and then clicks Identify.
  2. The recipient receives the request and completes the identification.
  3. The widget shows the verified result.

Installation

Include the widget script in your page's HTML. The widget is self-contained and has no external dependencies.

<script src="https://cdn.idkollen.se/widget/teleid/v1/teleid-widget.js"></script>

Add a container element where the widget should appear:

<div id="teleid-widget"></div>

JavaScript API

Select the widget element to access its API.

const widget = IDkollenTeleID.init({
element: document.getElementById('teleid-widget'),
baseUrl: '/idkollen',
language: 'ENGLISH',
// customFetch: window.fetch,
});
FieldDescription
elementThe container element, or a selector, where to insert the widget.
baseUrlThe base URL for the API. Defaults to /idkollen.
languageThe language for the widget: ENGLISH, SWEDISH, NORWEGIAN, DANISH, or FINNISH.
customFetchCustom fetch implementation.

widget.fillForm(fields)

Fill form fields programmatically, for example with data already available in your application:

widget.fillForm({
method: 'PHONE',
phone: '+1234567890',
});
FieldDescription
methodPre-select the contact method: SSN, PHONE, EMAIL, or CHAT.
phonePre-fill the phone number field.
emailPre-fill the email field.
ssnPre-fill the SSN field.
providerPre-select the eID provider.

widget.resetForm()

Clears the form and resets the widget to its initial state.

widget.start()

Submits the form programmatically, equivalent to clicking the Identify button. Returns a Promise that resolves once the session has been created.

widget.cancel()

Cancels the current session. Equivalent to clicking the Cancel button while the widget is waiting for the recipient.

Events

The widget fires DOM events on the container element:

widget.addEventListener('teleid:completed', (e) => {
const { user } = e.detail;
console.log(user.name, user.ssn);
});
EventFired whene.detail
teleid:startedThe session has been created and the link was sent.{ id }
teleid:completedThe customer successfully identified themselves.{ id, user }
teleid:failedThe session failed or was cancelled.{ id, error }
teleid:cancelledThe agent cancelled the session from the widget.{ id }

Backend endpoints

Since API keys must never be exposed to the browser, the widget communicates with your own backend, which proxies calls to the IDkollen API. You need to implement four endpoints.

SDK

Eventually you will be able to use the IDkollen SDKs to implement these endpoints.

Fetch services

The widget will call this endpoint to check for supported settings.

GET {base-url}/service
Accept: application/json

Your backend should call GET /v3/service on the IDkollen API and return the response with a 200 status code.

Start authentication

The widget calls this endpoint when the agent submits the form.

POST {base-url}/teleid
Content-Type: application/json
Accept: application/json

Your backend should call POST /v3/teleid on the IDkollen API and pass through the request body and return a 200 status code..

Fetch authentication status

The widget polls this endpoint to check progress.

GET {base-url}/teleid/{id}
Accept: application/json

Your backend should call GET /v3/teleid/{id} on the IDkollen API and return the response with a 200 status code.

Cancel authentication

The widget calls this endpoint when the agent cancels the authentication.

DELETE {base-url}/teleid/{id}

Your backend should call DELETE /v3/teleid/{id} on the IDkollen API and return a 204 response.

Support

For questions or to request access to the widget, contact support@idkollen.se.