App reviews, troubleshooting, and recommendations
let say we are in a Handler class of a webhook
class ProductsHandler implements Handler
{
public function handle(string $topic, string $shop, array $body): void{
switch ($topic) {
case Topics::PRODUCTS_CREATE: {
// how to get a session instance here so we can perform shopify api call
//
// $session = ?
//$client = new Rest($session->getShop(), $session->getAccessToken());
}
}
}
}
Solved! Go to the solution
This is an accepted solution.
i found a solution
as we already have the $shop variable so we can do this
$session = Utils::loadOfflineSession($shop);
This is an accepted solution.
i found a solution
as we already have the $shop variable so we can do this
$session = Utils::loadOfflineSession($shop);
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025