How do I pass multiple block configurations to a behavior? I am trying to create a Drupal 8 module that implements a Curator IO widget, so I created a block plugin with its own custom configuration.

public function blockForm($form, FormStateInterface $form_state) {
  $form['curator_io_settings'] = array(
    '#type' =&gt; 'fieldset',
    '#title' =&gt; t('Curator IO Settings'),
    '#collapsible' =&gt; TRUE,
    '#collapsed' =&gt; FALSE,
  );

  $form['curator_io_settings']['feed_id'] = [
    '#type' =&gt; 'textfield',
    '#title' =&gt; $this-&gt;t('Enter your unique Feed Id'),
    '#default_value' =&gt; $this-&gt;configuration['feed_id'],
    '#maxlength' =&gt; 256,
    '#size' =&gt; 64,
    '#description' =&gt; t('Set your unique feed id found at curator io'),
  ];

  return $form;
}


I attached my library from the build method and passed a variable so I can work with it in jQuery.

public function build() {
  $build = [
    '#theme' =&gt; 'curatorio_io',
    '#attached' =&gt; [
      'library' =&gt; [
        'curatorio/curatorio_assets',
      ],
      'drupalSettings' =&gt; [
        'curatorio' =&gt; [
          'feed_id' =&gt; $this-&gt;configuration['feed_id'],
        ]
      ]
    ],
  ];

  return $build;
}


I am getting this variable value in JavaScript using the following code.

(function ($, Drupal, drupalSettings) {
  'use strict';
  Drupal.behaviors.curatorio = {
    attach: function (context, settings) {
      console.log(drupalSettings.curatorio);
    }
  }
};


It is working fine for one instance of the block.

When I add 2 or more instances of this block, only the first block works. I can understand that no matter how many instance I create for this block, the JavaScript will always get included once, so how do I pass multiple values for feed_id to the JavaScript behavior?
So as Leigh suggested I send this data values into a twig file 

  public function build() {

    $build = [
      '#theme' =&gt; 'curatorio_io',
      '#id' =&gt; uniqid(),
      '#feed_id' =&gt; $this-&gt;configuration['feed_id'],
      '#widget_type' =&gt; $this-&gt;configuration['widget_type'],
      '#attached' =&gt; [
        'library' =&gt; [
          'curatorio/curatorio_assets',
        ],
      ],
    ];

    return $build;
  }


Now in my twig file, I put those values into data attributes

&lt;div class ="curator-feed"  id = "{{ id }}" data-feed-id = "{{ feed_id }}"  data-widget-type = "{{ widget_type }}" &gt;

&lt;/div&gt;


and in js I attached my JS logic to get attribute value and attach Plugin into it.