-
Notifications
You must be signed in to change notification settings - Fork 0
feat: shopify demo #1
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
leggetter
wants to merge
17
commits into
main
Choose a base branch
from
feat/shopify-demo
base: main
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
Conversation
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
- Created package.json for project dependencies and scripts. - Added public HTML for demo landing page with styling. - Implemented TTS request handling in app.js with dynamic request loading. - Developed TTS demo HTML with form for text input and model selection. - Styled TTS demo page with CSS for better user experience. - Built Express router for TTS API, including request persistence and audio file handling. - Integrated Deepgram API for TTS generation with callback handling. - Set up server with environment variable validation and static file serving. - Configured TypeScript settings for the project.
…capabilities - Implemented a new STT (Speech-to-Text) demo in the Deepgram integration. - Added frontend components for audio recording, playback, and transcription request management. - Created backend routes for handling audio uploads and transcription requests. - Integrated Deepgram's STT API for processing audio files and receiving transcription results via webhooks. - Updated package.json to include necessary dependencies for multer and types. - Enhanced UI with status messages and auto-refresh functionality for transcription requests.
- Added .gitignore to exclude dependencies, environment files, and IDE configurations. - Created package.json for project dependencies and scripts for simulated webhook sending and demo destination. - Developed plan.md outlining project objectives, requirements, and execution steps for the demo. - Implemented README.md with setup instructions, demo checklists, and troubleshooting tips. - Added TypeScript configuration (tsconfig.json) for project compilation. - Created scripts for Hookdeck connection upsert, simulated webhook sending, and demo destination server. - Included a template for Shopify app configuration (shopify.app.toml.template) to integrate with Hookdeck.
…hould be generated from the template and not be in source control
…on and Hookdeck output files
…velopment environments - Updated script to create or update both production (HTTP destination) and development (CLI destination) Hookdeck connections. - Added environment variable loading from a .env file for better configuration management. - Improved error handling and output messages for connection upsert operations. - Regenerated shopify.app.toml from a template, preserving existing client_id if present.
- Introduced a TypeScript script to create or update both production and development Hookdeck connections, improving local debugging capabilities. - Updated README to reflect changes in setup instructions, including new environment variable requirements and detailed connection setup steps. - Enhanced demo objectives and checklists to clarify the use of production and development connections for comprehensive testing scenarios.
Major refactoring to improve setup workflow and reduce manual steps: - Remove SHOPIFY_CLIENT_SECRET env var requirement - Now dynamically fetches SHOPIFY_API_SECRET via `shopify app env show --path` - Uses execSync with --path flag for reliable directory resolution - Add automatic .env file management - New updateEnvFile() function automatically adds/updates HOOKDECK_SOURCE_URL - Preserves existing env vars and formatting - Eliminates manual step of copying source URL - Replace template-based approach with direct TOML manipulation - Remove dependency on shopify.app.toml.template - Parse and update existing shopify.app.toml using @iarna/toml - Preserve all existing configuration (client_id, other webhooks, etc.) - Add user confirmation prompt before replacing existing order webhooks - Add validation and error handling - Validate shopify.app.toml exists before running - Better error messages for Shopify CLI failures - Graceful handling of .env file update failures This change requires users to run `shopify app dev` first to create shopify.app.toml, then the upsert script handles the rest automatically.
…t script - Changed deduplication header from X-Shopify-Event-Id to x-shopify-event-id to match case sensitivity. - Updated rate limit configuration from 5 requests per second to 1 request per minute to trigger backpressure
- Updated the script to allow inclusion or exclusion of customer.phone in the payload for testing failure scenarios. - Improved environment variable loading by resolving the .env file path relative to the script location. - Added command line flags `--no-customer-phone` and `--with-customer-phone` to control customer phone inclusion. - Enhanced help message to reflect new options and clarify environment variable usage.
- Removed the alternative command example for sending simulated webhooks using `ts-node`, streamlining the instructions for users. - Maintained focus on the primary method for sending simulated webhooks to enhance clarity.
- Move webhook handling from separate Express server to Shopify app - Add webhook handler at shopify/app/routes/webhooks.shopify.orders.$.tsx - Implement realistic error handling with sendConfirmationText() function - Remove Express dependencies (saves ~900 lines in package-lock.json) - Update webhook path to /webhooks/shopify/orders for multi-vendor approach - Update upsert script to append path to Hookdeck source URL - Update simulated webhook sender to use new path - Update shopify.app.toml injection to include full webhook URI - Simplify setup flow - Remove shopify.app.toml.template (now injects directly into existing file) - Update upsert script to read SHOPIFY_API_SECRET from shopify app env show - Automatically manage HOOKDECK_SOURCE_URL in .env file - Fix port configuration - Set port to 4000 in shopify.web.toml - Update vite.config.ts default port to 4000 with strictPort - Update all documentation and scripts to use port 4000 consistently - Add Shopify webhook trigger script - Add scripts/03-trigger-shopify-webhook.ts for triggering webhooks via CLI - Support --topic and --address flags - Update README with new setup flow and webhook handler documentation - Document new Shopify app-first setup process - Update Demo 3 steps to reflect webhook handler in Shopify app - Remove references to old destination server
- Make SHOPIFY_CLIENT_SECRET required in simulation script (always include HMAC signature) - Automatically set SHOPIFY_CLIENT_SECRET in .env via upsert script - Clean up debug code from webhook handler - Update README to reflect automatic SHOPIFY_CLIENT_SECRET setup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR introduces a brand‑new, deterministic Shopify webhooks demo built around Hookdeck, covering setup, backpressure, and logs/retry from end to end. It provisions Hookdeck connections via API, wires Shopify webhooks through Hookdeck into the Shopify app itself, and provides scripts plus documentation to make the entire flow repeatable and demo‑friendly.
What’s Included
New Hookdeck + Shopify demo harness
scripts/01-hookdeck-upsert.ts) that:HOOKDECK_API_KEY) to create/update two connections:shopify-orders-prod-conn(HTTP destination) andshopify-orders-dev-conn(CLI destination, same source).shopify app env show --path ./shopifyto extractSHOPIFY_API_SECRETfrom the Shopify CLI (no manual env wiring).shopify/shopify.app.tomlexists and fails with clear guidance if not (instructs to runshopify app devfirst).shopify.app.tomlvia@iarna/tomlto injectorders/*webhook subscriptions directly into the existing file.HOOKDECK_SOURCE_URLin.envso other scripts can rely on a single, canonical value.Webhooks integrated into the Shopify app
shopify/app/routes/webhooks.shopify.orders.$.tsx.orders/*topics viaauthenticate.webhook(request), while reading the canonical topic (orders/create, etc.) from theX-Shopify-Topicheader.orders/create, callssendConfirmationText(customer.phone).phoneis missing, the handler throws and returns a 500, simulating a real-world “missing phone, cannot send SMS” failure you’ll later fix and then retry via Hookdeck.Consistent webhook path and URL handling
/webhooks/shopify/ordersto emphasize a multi‑vendor pattern.01-hookdeck-upsert.ts:/webhooks/shopify/ordersto the Hookdeck source URL when injecting webhook URIs intoshopify.app.toml.scripts/02-send-simulated-webhooks.ts:HOOKDECK_SOURCE_URLfrom.envand appends/webhooks/shopify/orderswhen sending simulated Shopify webhooks.scripts/03-trigger-shopify-webhook.ts(new):shopify app webhook triggerto send real Shopify webhooks through Hookdeck to/webhooks/shopify/orders.--topicand uses:--address {HOOKDECK_SOURCE_URL}/webhooks/shopify/orders--api-version 2026-01to avoid interactive prompts.--path ./shopifyso the CLI finds the right app.Port and dev‑experience hardening
port = 4000inshopify/shopify.web.toml.shopify/vite.config.tsto default to port4000and enablesstrictPort: trueso Vite fails instead of picking a random port.01-hookdeck-upsert.sh) and docs to consistently reference port 4000.package.jsonandpackage-lock.json.@iarna/tomland@types/iarna__tomlfor safe TOML parsing/writing.Documentation for a first‑time demo
shopify-webhooks-at-scale/README.mdto describe this as a new, end‑to‑end demo:shopify app devfirst, thennpm run upsertto configure Hookdeck and app webhooks.HOOKDECK_API_KEYandHOOKDECK_SOURCE_URLare used and automatically managed.shopify.app.toml).orders/*).shopify.app.toml.template) and the removed Express destination server.Why This Matters
shopify.app.toml, Hookdeck connections, and.envstay in sync via the TypeScript upsert script and well‑documented flows.