-
Notifications
You must be signed in to change notification settings - Fork 0
Centralize sample storefront configuration #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kyle-schellen
wants to merge
1
commit into
05-12-align_workspace_dev_commands_in_root_dev.yml
Choose a base branch
from
ks-shared-storefront-env
base: 05-12-align_workspace_dev_commands_in_root_dev.yml
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # Checkout Kit sample storefront configuration. | ||
| # Copy this file to .env, fill in local values, then run: | ||
| # scripts/setup_storefront_env | ||
| # Optional Apple Pay and Customer Account API values can stay blank. | ||
| # | ||
| # Do not commit real values from .env or generated platform config files. | ||
|
|
||
| # Storefront details | ||
| STOREFRONT_DOMAIN=your-store.myshopify.com | ||
| STOREFRONT_ACCESS_TOKEN=your-public-storefront-access-token | ||
| # Optional Apple Pay merchant identifier used by accelerated checkout flows. | ||
| STOREFRONT_MERCHANT_IDENTIFIER= | ||
|
|
||
| # Storefront API version | ||
| API_VERSION=2026-04 | ||
|
|
||
| # Customer Account API (optional) | ||
| CUSTOMER_ACCOUNT_API_CLIENT_ID= | ||
| CUSTOMER_ACCOUNT_API_SHOP_ID= | ||
| CUSTOMER_ACCOUNT_API_VERSION=2026-04 | ||
|
|
||
| # Buyer identity defaults used by sample apps | ||
| EMAIL=checkout-kit@example.com | ||
| ADDRESS_1=650 King Street | ||
| ADDRESS_2=Shopify HQ | ||
| CITY=Toronto | ||
| COMPANY=Shopify | ||
| COUNTRY=CA | ||
| FIRST_NAME=Evelyn | ||
| LAST_NAME=Hartley | ||
| PROVINCE=ON | ||
| ZIP=M5V 1M7 | ||
| PHONE=+14165550100 | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,4 @@ jobs: | |
| with: | ||
| test-path: ./Scripts/build_samples | ||
| job-name: Build Sample Apps | ||
| setup-storefront-env: true | ||
This file contains hidden or 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
13 changes: 7 additions & 6 deletions
13
platforms/android/samples/MobileBuyIntegration/.env.example
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,15 @@ | ||
| # Platform-local example for the Android sample. Prefer the repo-root | ||
| # .env.example for shared setup, then run scripts/setup_storefront_env. | ||
| STOREFRONT_DOMAIN=<yourdomainhere.myshopify.com> | ||
| STOREFRONT_ACCESS_TOKEN=<storefront access token> | ||
| API_VERSION=2026-04 | ||
|
|
||
| CUSTOMER_ACCOUNT_API_CLIENT_ID=<configured customer account api client id> | ||
| CUSTOMER_ACCOUNT_API_REDIRECT_URI=shop.<shop id>.app://callback | ||
|
|
||
| CUSTOMER_ACCOUNT_API_GRAPHQL_BASE_URL=https://shopify.com/<shop id>/account/customer/api/<api version>/graphql | ||
| CUSTOMER_ACCOUNT_API_AUTH_BASE_URL=https://shopify.com/authentication/<shop id> | ||
| # Android derives Customer Account redirect and API URLs from the shop ID and version. | ||
| CUSTOMER_ACCOUNT_API_SHOP_ID=<shop id> | ||
| CUSTOMER_ACCOUNT_API_VERSION=2026-04 | ||
|
|
||
| # Demo buyer identity used when the "Prefill checkout" toggle is enabled in Settings. | ||
| # Phone must be in E.164 format (+1XXXXXXXXXX for Canada). | ||
| PREFILL_EMAIL=test.buyer@example.com | ||
| PREFILL_PHONE=+16135550123 | ||
| EMAIL=checkout-kit@example.com | ||
| PHONE=+14165550100 |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,57 +1,7 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Function to create .env file for a sample app | ||
| create_env_file() { | ||
| local app_name="$1" | ||
| local env_path="./samples/${app_name}/.env" | ||
| set -e | ||
|
|
||
| if [ ! -f "$env_path" ]; then | ||
| echo "Creating ${app_name} .env file..." | ||
| cat >"$env_path" <<EOF | ||
| STOREFRONT_DOMAIN=${STOREFRONT_DOMAIN} | ||
| STOREFRONT_ACCESS_TOKEN=${STOREFRONT_ACCESS_TOKEN} | ||
| EOF | ||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
|
||
| # Add optional authentication configuration if provided | ||
| if [ -n "$SHOP_ID" ] && [ -n "$CUSTOMER_ACCOUNT_API_CLIENT_ID" ]; then | ||
| cat >>"$env_path" <<EOF | ||
|
|
||
| CUSTOMER_ACCOUNT_API_CLIENT_ID=${CUSTOMER_ACCOUNT_API_CLIENT_ID} | ||
| CUSTOMER_ACCOUNT_API_REDIRECT_URI=shop.${SHOP_ID}.app://callback | ||
|
|
||
| CUSTOMER_ACCOUNT_API_GRAPHQL_BASE_URL=https://shopify.com/${SHOP_ID}/account/customer/api/${CUSTOMER_ACCOUNT_API_VERSION}/graphql | ||
| CUSTOMER_ACCOUNT_API_AUTH_BASE_URL=https://shopify.com/authentication/${SHOP_ID} | ||
| EOF | ||
| fi | ||
| echo "✓ Created ${app_name} .env file" | ||
| fi | ||
| } | ||
|
|
||
| # Prompt for Shopify credentials | ||
| echo "Setting up .env files for sample apps..." | ||
| echo "Please provide your Shopify storefront credentials:" | ||
| read -p "Storefront Domain (e.g., yourstore.myshopify.com): " STOREFRONT_DOMAIN | ||
| read -p "Storefront Access Token: " STOREFRONT_ACCESS_TOKEN | ||
|
|
||
| if [ -z "$STOREFRONT_DOMAIN" ] || [ -z "$STOREFRONT_ACCESS_TOKEN" ]; then | ||
| echo "Error: Both storefront domain and access token are required." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Optional authentication configuration | ||
| echo "" | ||
| echo "Optional: Customer Account API configuration (needed for authentication features)" | ||
| echo "Press Enter to skip if you don't need authentication features." | ||
| read -p "Shop ID (optional): " SHOP_ID | ||
| read -p "Customer Account API Client ID (optional): " CUSTOMER_ACCOUNT_API_CLIENT_ID | ||
| read -p "Customer Account API Version (default: unstable): " CUSTOMER_ACCOUNT_API_VERSION | ||
|
|
||
| # Set default API version if not provided | ||
| if [ -z "$CUSTOMER_ACCOUNT_API_VERSION" ]; then | ||
| CUSTOMER_ACCOUNT_API_VERSION="unstable" | ||
| fi | ||
|
|
||
| # Create .env files for both sample apps | ||
| create_env_file "MobileBuyIntegration" | ||
|
|
||
| echo "✓ Sample app .env files are ready!" | ||
| exec "$SCRIPT_DIR/../../../scripts/setup_storefront_env" "$@" |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we make it clear anywhere what we use this for?