How to use a php library installed with composer in a concrete5 website

I’m working on a website and I need to integrate a third-party library written in php.
I installed the php scripts with composer in the concrete/vendor folder (I’m not sure if this is the right place). I want to use this library in a custom block but I don’t know how to access it.
I feel this is the wrong way… if so where can I install third-party libraries and using them?

core/vendor should be for the core only. It will be overwritten next time you update the core (the folder may be updated with your library if you are on a composer install - I am not sure about that).

For most installs, ideally you would add the library in a package.

The autoloader for the library would then need to be registered by the package controller.

You can find examples of such in many of the free packages in the marketplace or community projects. Ignore all the rest of the package and just look at the autoloading and the vendor subdirectory.

You may find it advantageous to also build the rest of your functionality in the package.