Home - shopify-apac-ts/shopify-barebone-app-sample GitHub Wiki

Session Token (ID Token)

Basic usage of Session Token (ID Token)

Demo

For external service connection

Demo

Non embedded apps cannot use App Bridge or Session Token, so should render the external page with your own JWT

Demo

How to link a Shopify shop to an user of your external service

  1. In the login page, you should send the JWT with the shop name during the login process (your own JWT should be encoded with the app secret as Session Token does which prevents from fraud token insertion by others).
  2. If the user login successfully or the user is already logged-in, store the shop name in your database with the logged-in user ID.
  3. At the next time that the user is already logged-in or log in again, your service already has (know) the record of the ID and shop, and the user no longer needs to go to the Shopify app page.
  4. For publishing your app, this approach to limit the connecting point of your service and Shopify shops to the initial process of install is mandatory (see the guideline).
  5. Note that if your app is non embedded one, you can't get Built for Shopify badge.

Admin Link

External page protection and link to selected data

Demo

Theme App Extension

Theme editor and storefront working with App proxies

Demo

Line item properties, and Cart notes and attributes insertion without touching the original theme Liquid

Demo

Function for Discount

Automatic discount working with customer metafields

Demo

Function for Shipping

Shipping rate filtering by input zip code

Demo

Function for Payment

Payment method filtering by selected shipping rate

Demo

Web Pixels

Sending checkout events to GA4 through their API

Demo

Post-purchase

Upsell products set in each metafield and get the shop review score in the post-purchase flow

Demo

Checkout UI Extensions

Provide the same upsell and review as post-purchase with IP address blocking

Demo

Clone a checkout from upsell using Storefront API and set an blacklisted IP address

Demo

Show the current line items in smart phone only for the collapsed order summary

Demo

Block the checkout with "COMING SOON!" message and clear the cart if a larger quantity is given than allowed one

Demo

Set cart attributes in checkout in combination with Liquid and JavaScript in theme

Demo

TIPS

  • *Note that browser back doesn't work from checkout to cart page because it cashes the previous value and not Shopify's issue.
  • *If you want to clear the attribute value, set empty (zero length) string in Liquid form or Checkout UI Extension API

Order Management

Fulfillment and capture orders, and use fulfillment service for product inventory management and external fulfillments

Demo

TIPS: Inventory status transformation

Multipass

Login Shopify store with a dummy SSO

Demo

Bulk Operation

Import product data using JSONL file upload

Demo

Storefront API

Cart creation with a public token in a plain HTML page

Demo

How the public token is used at the client side

Demo

How the private token is used at the server side

Demo

TIPS

  • Public Token can be used for Storefront API only as X-Shopify-Storefront-Access-Token with unauthenticated scope only which can be revealed without expiration. Private Token can be used for Admin API as X-Shopify-Access-Token like OAuth Token, also for Storefront API as Shopify-Storefront-Private-Token With authenticated and unauthenticated scopes both (but they need to be included by the parent OAuth scopes) which can NOT be revealed and with expiration. Public / Private Token get disabled immediately once the parent OAuth token gets deactivated with the app uninstall or other token handling.

How to switch the language and country in context

Demo

TIPS

  • Checkout context depends on BuyerIdentity, so even if you create a checkout with a country locale (e.g. US), if the logged in customer has another country address (e.g. JP), the checkout context gets override with the customer's buyer identity.