👨‍💻Widget integration: frontend

Actions to be taken by the frontend team

The widget consists of a container that is loaded by a JavaScript call. Follow this checklist to integrate the frontend:

<script>
   //operation_id: is an id generated by you that will be returned in the callback response
   //entities_to_display: array of entities to display. If it is an empty array, all entities will be displayed. To get all entity codes: https://api.wealthreader.com/entities/
    const wr_conf = {
        "operation_id": "5f5b5c5c-5f5b-5c5c-5f5b-5c5c5f5b5c5c",
        "entities_to_display": ["andbank", "bancamarch", "bankinter", "bbva", "caixabank", "degiro", "ing", "santander_emp", "triodos"],
        "wait_full_response": true
    }
 
    window.addEventListener("message", (e) => {
        var data = e.data;

        if (data === "flow completed") {
            console.log("El widget ha notificado que el flujo ha finalizado");
            //Aquí puedes escribir el código con lo que debe suceder cuando el flujo ha finalizado
        }
    });
</script>

<iframe id="wr-iframe" title="Wealth Reader widget" width="100%" frameBorder="0" referrerpolicy="origin"></iframe>
<script src="https://widget.wealthreader.com/js/load.js"></script>

ParameterDescriptionRequired

operation_id

Assigned operation id generated by the client. This id will be sent together with the response to the previously agreed callback URL.

entities_to_display

Entities to display in the widget. If no value is specified, all are shown.

You can get the complete list of entities at: https://api.wealthreader.com/entities/ This method and the rest are described in the OpenAPI definition, at the end of the document.

wait_full_response

If true, it sends the complete information: assets and their transactions. Otherwise the widget will only send the list of products, but not the transactions.

The reason to disable this option is to give the user the feeling of immediacy, but we do not recommend disabling it because the waiting time to retrieve the complete information is also short, in the order of seconds.

The default value is true.

default_login

If it has a valid entity_code value, the consent collection form for that entity will open directly. The complete list of entities can be obtained at https://api.wealthreader.com/entities/.

Última actualización