The documentation of shopify APIs is pretty good. Unfortunately I failed miserably to authenticate – and this is because from my point of view the naming of the PHP client is wrong – at least for private apps.
Big shout out to Fatih Samur whos blog entry helped me a lot!

This is the app info for private apps in the backend.
Context::initialize( $_ENV['SHOPIFY_API_KEY'], $_ENV['SHOPIFY_API_SECRET'], $_ENV['SHOPIFY_APP_SCOPES'], $_ENV['SHOPIFY_APP_HOST_NAME'], new FileSessionStorage('/tmp/php_sessions'), '2021-04', true, false, );
And this is the code example of the shopify php client.
$_ENV['SHOPIFY_API_KEY'], // => API-Schlüssel (the value in the middle)
$_ENV['SHOPIFY_API_SECRET'], // => TOKEN(!!) NOT THE SECRET!
$_ENV['SHOPIFY_APP_SCOPES'], // => Whatever you defined, comma separated.
$_ENV['SHOPIFY_APP_HOST_NAME'], // => your host without https:// and / as suffix.
Hope that helps someone in the future.
Leave a Reply