Prebuilt user interfaces

We host and provide the user interface to be embedded in your application. This option allows customers to quickly start with the product, learn, and then iterate to improve the complete user journey. We provide a tested and validated user journey, always using our latest API version.

We invest in standardized user interface libraries that are optimized for conversion and that minimize the amount of work you have to do in integrating to our products.

When using the prebuilt user interfaces, you have access to all our products through a single integration.

Getting Started

Here's how to integrate our prebuilt user interfaces into your website:

Get your Customer ID and Config name

E-mail us at support@anessa.co, and we'll provide the Customer ID and Config name.

Please provide the URL of the domain where the prebuilt user interface will be embedded so its access can be configured. On any origin we have not added, the interface does not load at all. To develop and test, ask us for a separate test configuration for your staging site and localhost (see Before you go live).

Add the iframe to your website

The user interface is added as an iframe on an appropriate page. If you want to try the module as an iframe, it's on our demo page.

The iframe is embedded with the following html tag:

<iframe
  id="insurely-frame"
  title="Login and collect your data"
  src="https://blocks.anessa.co/"
  sandbox="allow-scripts
    allow-same-origin
    allow-popups
    allow-forms
    allow-popups-to-escape-sandbox
    allow-top-navigation"
></iframe>

Write the closing </iframe> tag. In HTML an <iframe> can't close itself with />, so everything after it on your page would be swallowed and never shown.

Add the required setup code

You'll need to add two pieces of code to your website's page header (the <head> section of your HTML):

Add the script: Copy and paste this code into your page header:

<script type="text/javascript" src="https://blocks.anessa.co/assets/bootstrap.js"></script>

Optional: If you need advisor dashboard features If you're using the advisor dashboard functionality, use this version instead:

<script
  type="text/javascript"
  src="https://blocks.anessa.co/assets/bootstrap.js"
  data-include-advisor-handle="true"
  data-include-reference-id="true"
></script>

Add your configuration: Add this code right after the script above, replacing the placeholder values with your actual Customer ID and Config name (provided in step 1):

<script>
  window.insurely = {
    config: {
      customerId: 'xxx',
      configName: 'abc-123',
    },
  };
</script>

What this does:

  • The first script loads our tools and functions
  • The second script tells us who you are and which settings to use

By default the script auto-updates so you always run the latest version. If your security policy requires you to verify the script with a Subresource Integrity (SRI) hash, you can pin an immutable, content-hashed copy instead — see Subresource Integrity.

Pre-fill customer information (optional)

You can pre-fill the interface with your customer's information so they don't have to enter it again. This is especially useful if you're adding the interface to a customer's account page or "My Pages" section.

When to use pre-filling:

  • Your customer is already logged into your website
  • You want to skip the initial company selection step
  • You want to personalize the experience for your customer

How to add pre-filled information:

Replace your existing configuration code with this expanded version:

<script>
  window.insurely = {
    config: { customerId: 'xxx', configName: 'abc-123' },
    prefill: {
      user: { swedishPersonalNumber: '200001020000' },
      dataAggregation: { company: 'se-demo' },
    },
  };
</script>

Before you go live

Three setup mistakes stop the interface from working without an obvious error.

Your domain must be on our list

The interface only runs on origins we have added to your configuration. On any other origin it does not load, and shows this configuration error instead:

The provided allowed origins are not allowed for the current origin: …

This includes localhost. Ask us for a separate test configuration for development and staging, and keep localhost off your production configuration: anyone can serve a page from their own localhost, so allowing it would let anyone run your production configuration.

Set window.insurely before the iframe is on the page

bootstrap.js reads your configuration only once, when it finds the iframe, so an iframe added to the page before window.insurely is set loads blank.

Give the iframe an id, and leave its size to us

  • Use id="insurely-frame". Any id works, but after a user signs in with BankID on their phone, the page scrolls back to the element with this id. With another id it stays where it is.
  • bootstrap.js sizes the iframe itself (width: 100%, max-width: 700px, min-height: 700px) and resizes its height to fit the content. Style the element around the iframe rather than the iframe, since these inline styles override your CSS.

The iframe needs an id. Without one, bootstrap.js can fail before it starts listening to the interface, and same-device BankID, scrolling and window.insurely.updateAuthToken() stop working.

Next Steps

Now that you have the basic integration set up, you can explore additional features:

Last updated on