Created
September 8, 2023 16:14
-
-
Save rafaelstz/05430b9197ea742936b06dfe95c9fd70 to your computer and use it in GitHub Desktop.
Standalone Shopify APP PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Shopify\Auth\FileSessionStorage; | |
use Shopify\Auth\Session; | |
use Shopify\Context; | |
use Shopify\ApiVersion; | |
Context::initialize( | |
apiKey: 'NA', | |
apiSecretKey: 'NA', | |
scopes: ['read_products'], | |
hostName: 'NA', // store.myshopify.com | |
sessionStorage: new FileSessionStorage(), | |
apiVersion: ApiVersion::JULY_2023, | |
isEmbeddedApp: false, | |
); | |
$session = new Session( | |
id: 'NA', | |
shop: 'store.myshopify.com', | |
isOnline: false, | |
state: 'NA' | |
); | |
$session->setAccessToken('ADMIN_API_ACCESS_TOKEN'); | |
$products = Product::all( | |
$session, // Session | |
); | |
var_dump($products); | |
die(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment