Configuration options
Basic settings (required)
| Name | Value | Description |
|---|---|---|
| customerId | string | Your unique customer ID from Insurely (required) |
| configName | string | The name of your specific configuration (required) |
| language | en | sv | da | fr | et | Choose the language for the interface (optional) |
| dataAggregation | Advanced settings | Additional options for tracking and references (see below) |
Advanced tracking settings
These settings help you track and organize data collections:
| Setting | Type | Description |
|---|---|---|
| referenceId | string (max 50 characters) | A unique reference number or code to identify this collection (letters, numbers, @, _, and - only) |
| advisorHandle | string | Links this collection to a specific advisor in your dashboard |
Information you can pre-fill
You can pre-fill these types of information:
| Category | Type | Description |
|---|---|---|
| customer | Customer object | See table below |
| user | User object | See table below |
| dataAggregation | Data aggregation object | See table below |
Customer contact information
| Field | Type | Description |
|---|---|---|
| Email address | Customer's email address (must be valid format) | |
| phoneNumber | Phone number | Customer's phone number (must be valid format) |
User personal details
| Field | Type | Description |
|---|---|---|
| swedishPersonalNumber | Personal number | Swedish personal number in format YYYYMMDDXXXX |
| estonianPersonalNumber | Personal number | Estonian personal number (must be valid format) |
| estonianPhoneNumber | Phone number | Estonian phone number (must be valid format) |
| norwegianPersonalNumber | Personal number | Norwegian personal number (must be valid format) |
| norwegianPhoneNumber | Phone number | Norwegian phone number (must be valid format) |
| username | Username or email | Login username or email (format depends on the insurance company) |
Data aggregation prefill
| Field | Type | Description |
|---|---|---|
| company | Company code | Pre-select an insurance company to skip the company selection step. Use format like se-xxxx, no-xxxx. You can find all available company codes in the module's status information. |
| companies | Array of company codes | Pre-select multiple insurance companies on the company selection step. Use format like se-xxxx, no-xxxx. You can find all available company codes in the module's status information. |
Complete example
Here's an example showing all the settings together:
<script
type="text/javascript"
src="https://blocks.test.insurely.com/assets/mobile-bootstrap.js"
></script>
<script async>
window.insurely = {
config: {
customerId: 'b823aa0f-0357-4f24-8506-3575dexample',
configName: 'insurely-se-blocks-test-example',
language: 'en',
dataAggregation: {
referenceId: '0000000-test',
},
},
prefill: {
user: {
swedishPersonalNumber: '200001020000',
username: 'testusername',
email: 'test@test.se',
},
},
};
</script>Track what happens in the interface (optional)
The Insurely interface can send you updates about what's happening during the data collection process. This is useful if you want to:
- Show progress indicators to your customers
- Track when collections start or complete
- Handle specific events (like when a user closes the interface)
Note: This feature is for developers. If you're not comfortable with code, you can skip this step.
| Event name | Value | Description |
|---|---|---|
| WAITING_FOR_INITIALIZATION | The module is waiting for initialization from bootstrap script | |
| APP_LOADED | When the module and all its content is loaded | |
| APP_CENTER | Scroll user to correct position when changing view (handled in bootstrap script) | |
| PAGE_VIEW | Name of current page | Sent on each page navigation. This is subject to change and we do not recommend to rely on this for tracking/analytic purposes |
| APP_CLOSE | When user clicks on 'close'-icon on the results page. It sends the user back to start. But could be used to close the module if used in a webview context in an mobile app | |
| SELECTED_AUTHENTICATION_METHOD | Authentication method | When the user has selected an authentication method |
| COLLECTION_ID | Will be sent right after the collection has started | |
| RESULTS | Array of collected data | The format of the data is dependent on the backendAPI version that is used. |
| RESULTS_SELECTED_ITEM | Id of the selected insurance item | Only for insurance. |
| COLLECTION_STATUS | All statuses in the data collection. The format of the data is dependent on the backendAPI version that is used. | |
| OPEN_SWEDISH_BANKID | Object containing url and autostartToken | Request to open the swedish BankID app |
To test the events (for developers):
Add this code to your browser's developer console to see what events are being sent:
window.addEventListener('message', ({ data }) => {
console.groupCollapsed(`${data.origin}: ${data.name}`);
console.log('Origin: ', data.origin);
console.log('Name: ', data.name);
console.log('Value: ', data.value);
console.groupEnd();
});Important note: The data format for the RESULT and COLLECTION_STATUS events is dependent on the backendAPI version that is used. This means that upgrading to a newer version of the backendAPI can change the format of the data.
Understand collection statuses
When a customer starts collecting their insurance data, the process goes through different stages. Here are the possible statuses you might see:
| Status | Description |
|---|---|
| RUNNING | The collection process has started and is actively running |
| LOGIN | Process is waiting for the user to provide login credentials |
| TWO_FACTOR_PENDING | Process is waiting for the user to complete two-factor authentication |
| COLLECTING | Actively gathering insurance data from the provider |
| COMPLETED_PARTIAL | Collection finished but only retrieved partial data (some data might be missing) |
| COMPLETED | Collection successfully finished with all expected data retrieved |
| COMPLETED_EMPTY | Collection finished successfully but no insurance data was found |
| USER_INPUT | Process is waiting for additional input from the user |
| FAILED | Collection process encountered an error and could not complete |
| WAITING_FOR_AUTHENTICATION | Process failed due to two-factor authentication timeout |
| CUSTOMER_ENROLLMENT_REQUIRED | User needs to enroll or register with the insurance provider before collection can proceed |
| INCORRECT_CREDENTIALS | The provided login credentials were invalid or incorrect |
Receive the collected data (optional)
If you have a data processing agreement (DPA) with Insurely, you can receive the actual insurance data that was collected. This allows you to:
- Store the data in your own system
- Process it for your own analysis
- Use it in your applications
Note: This feature requires a special agreement with Insurely and is only available to approved partners.
window.addEventListener('message', ({ event }) => {
const { data } = event;
if (data.name === 'RESULTS') {
console.log('Collection data:', data.value);
// Handle the collected data
}
});Last updated on