Guide
Introduction
eideasy-browser-client is a handy tool that you can use to handle the client side parts of the identification and signing flows when using eID Easy API.
A typical signing implementation using the eID Easy API and the eideasy-browser-client would look like this:
- Prepare the files for signing by sending a server side request to the /prepare-files-for-signing endpoint.
- /prepare-files-for-signing endpoint returns a docId.
- Create a browser client instance using the docId.
- Use any of the eideasy-browser-client's signing modules (e.g. idCardSignature, smartIdSignature, mobileIdSignature etc.) to complete the signing process.
- eID Easy server sends a POST request containing doc_id and signer_id to your configured "Signature notification URL" when the user has finished signing the document.
Installation
NOTE
We are constantly improving our browser-client and releasing new versions. Make sure to use the latest version of the browser-client to get access to the latest signing and authentication methods.
Set up
eideasy-browser-client uses iframes to communicate with some of the browser extensions and OS level components. To ensure that the browser-client works correctly, you need to whitelist the domain where you plan to use it as follows:
- In the self-service portal, navigate to My Webpages, scroll to the website where you wish to use the browser-client and click "Edit".
- Scroll to the section "Allowed iframe parent hostnames"
- Enter the hostname of the website where you plan to use the browser-client. For example, if you plan to use the browser-client on
https://example.com/subpage
, then enterhttps://example.com
. - Done! You can now use the browser-client on the specified website.
NPM
- Install with npm or Yarn:
yarn add @eid-easy/eideasy-browser-client
npm install @eid-easy/eideasy-browser-client
- Import createClient:
import createClient from '@eid-easy/eideasy-browser-client';
CDN
- Add the script tag:
<script src="https://cdn.jsdelivr.net/npm/@eid-easy/eideasy-browser-client@2.114.2/dist/eideasy-browser-client.js" integrity="sha256-QpRoV0K0VM9HtsQvAVaqWKc3NcGhrej9mMRpudjofcM=" crossorigin="anonymous"></script>
- Use the eidEasyBrowserClient object to access createClient:
const createClient = window.eidEasyBrowserClient.createClient;