Skip to content

skygdi/shopify-private-app-foundation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

A Shopify private APP skeleton

Setup:

Install:

composer require skygdi/shopify-private-app-foundation

APP Setup:

Allowed redirection URL(s):

https://your-app.ngrok.io/install
https://your-app.ngrok.io/install_authorize

Modify your .env:

SHOPIFY_APP_API_KEY="APP_key"
SHOPIFY_APP_API_SECRET="APP_secret"
SHOPIFY_APP_API_SCOPES="read_products,read_product_listings,read_themes,write_themes,read_script_tags,write_script_tags"

build your logic controller:

The entry URL is "/". So, you need to define this route on your own.
use Skygdi\ShopifyPrivateAPPFoundation\Traits\ShopifyInstallTrait;
class HomeController extends Controller
{
  use ShopifyInstallTrait; //Add
  function entry(Request $request){
    if( !$this->hashCheck($request) ) abort(403,"No Access Token Found");
    //Hash check success, means it came from Shopify APP.
    //Build your login code from here
    //Auth::loginUsingId(1); //Like login a user or an admin backend.
    //return redirect()->to('/admin');
  }
}

Update the session for Shopify frame

config/session.php
'secure'	=> true
'same_site'	=> 'none'

Usage:

Communicate with API token:

$this->loadShopDomain();
$this->loadAccessToken();
//Do your REST API call

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages