Skip to content

Instantly share code, notes, and snippets.

@rafaelstz
Created September 8, 2023 16:14
Show Gist options
  • Save rafaelstz/05430b9197ea742936b06dfe95c9fd70 to your computer and use it in GitHub Desktop.
Save rafaelstz/05430b9197ea742936b06dfe95c9fd70 to your computer and use it in GitHub Desktop.
Standalone Shopify APP PHP
<?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