Using additional Composer package

So I am currently working on a Composer package with a small library that I want to use with CakePHP projects. My question is, how do I use the class I defined in this package in my controllers?

Running composer require my_vendor/my_lib works like a charm and adds the files like [cake_root]/vendor/my_vendor/my_lib/lib.php

However, how do I now use this? Slightly related, is this considered a plugin? Do I load it like a plugin?

Thanks in advance!

By default you can access all composer packages automatically.

So I wouldn’t have to do anything?

But at this point I get ‘no class found’ messages when I try $x = new MyClass() anywhere.

In your packages you have to specify root namespace that you house (e.g: Himan101) in the composer.json (see documentation)

then in the cakephp project

    use Hitman101\MyClass
    $x = new MyClass();