Configuration options

Basic settings (required)

NameValueDescription
customerIdstringYour unique customer ID from Insurely (required)
configNamestringThe name of your specific configuration (required)
languageen | sv | da | fr | etChoose the language for the interface (optional)
dataAggregationAdvanced settingsAdditional options for tracking and references (see below)

Advanced tracking settings

These settings help you track and organize data collections:

SettingTypeDescription
referenceIdstring (max 50 characters)A unique reference number or code to identify this collection (letters, numbers, @, _, and - only)
advisorHandlestringLinks this collection to a specific advisor in your dashboard

Information you can pre-fill

You can pre-fill these types of information:

CategoryTypeDescription
customerCustomer object See table below
userUser object See table below
dataAggregationData aggregation object See table below

Customer contact information

FieldTypeDescription
emailEmail addressCustomer's email address (must be valid format)
phoneNumberPhone numberCustomer's phone number (must be valid format)

User personal details

FieldTypeDescription
swedishPersonalNumberPersonal numberSwedish personal number in format YYYYMMDDXXXX
estonianPersonalNumberPersonal numberEstonian personal number (must be valid format)
estonianPhoneNumberPhone numberEstonian phone number (must be valid format)
norwegianPersonalNumberPersonal numberNorwegian personal number (must be valid format)
norwegianPhoneNumberPhone numberNorwegian phone number (must be valid format)
usernameUsername or emailLogin username or email (format depends on the insurance company)

Data aggregation prefill

FieldTypeDescription
companyCompany codePre-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.
companiesArray of company codesPre-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 nameValueDescription
WAITING_FOR_INITIALIZATIONThe module is waiting for initialization from bootstrap script
APP_LOADEDWhen the module and all its content is loaded
APP_CENTERScroll user to correct position when changing view (handled in bootstrap script)
PAGE_VIEWName of current pageSent on each page navigation. This is subject to change and we do not recommend to rely on this for tracking/analytic purposes
APP_CLOSEWhen 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_METHODAuthentication methodWhen the user has selected an authentication method
COLLECTION_IDWill be sent right after the collection has started
RESULTSArray of collected dataThe format of the data is dependent on the backendAPI version that is used.
RESULTS_SELECTED_ITEMId of the selected insurance itemOnly for insurance.
COLLECTION_STATUSAll statuses in the data collection. The format of the data is dependent on the backendAPI version that is used.
OPEN_SWEDISH_BANKIDObject containing url and autostartTokenRequest 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:

StatusDescription
RUNNINGThe collection process has started and is actively running
LOGINProcess is waiting for the user to provide login credentials
TWO_FACTOR_PENDINGProcess is waiting for the user to complete two-factor authentication
COLLECTINGActively gathering insurance data from the provider
COMPLETED_PARTIALCollection finished but only retrieved partial data (some data might be missing)
COMPLETEDCollection successfully finished with all expected data retrieved
COMPLETED_EMPTYCollection finished successfully but no insurance data was found
USER_INPUTProcess is waiting for additional input from the user
FAILEDCollection process encountered an error and could not complete
WAITING_FOR_AUTHENTICATIONProcess failed due to two-factor authentication timeout
CUSTOMER_ENROLLMENT_REQUIREDUser needs to enroll or register with the insurance provider before collection can proceed
INCORRECT_CREDENTIALSThe 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