Setting global block attribute value

You could make use of register_post_field() to add the API key to the post object which you then can retrieve via getEditedPostAttribute() in the editor.
In register_post_field() you can define by yourself via get_callback/update_callback how/where the API key should be saved like post meta or an option.

To update the API key in the editor use the editPost() dispatch function which will invoke your update_callback.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)