Add App Events logging API - #1459
Open
kristianpd wants to merge 3 commits into
Open
Conversation
kristianpd
force-pushed
the
app-events-log
branch
6 times, most recently
from
August 27, 2026 14:46
a49948b to
4350227
Compare
kristianpd
marked this pull request as ready for review
August 27, 2026 14:55
Add ShopifyAPI.log to send one App Event through the Global API using app-level client credentials, without a shop session. - Mint, cache, and refresh the Global API token from the configured api_key and api_secret_key, coalescing concurrent refreshes. - Retry once after a 401 and clear the exact rejected token. - Validate the documented payload limits before any HTTP request. - Pin GLOBAL_API_VERSION instead of following Context.api_version. - Report idempotent replays from the response header value. - Add a configurable HTTPS global_api_url for non-production hosts.
kristianpd
force-pushed
the
app-events-log
branch
from
August 27, 2026 14:57
4350227 to
f84398b
Compare
kristianpd
commented
Aug 27, 2026
| is_private:, | ||
| is_embedded:, | ||
| global_api_version: DEFAULT_GLOBAL_API_VERSION, | ||
| global_api_url: DEFAULT_GLOBAL_API_URL, |
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
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.
Description
Adds the Ruby SDK counterpart to
shopify-app-jsApp Events logging:ShopifyAPI.logvalidates and posts one App Event to the Global API.ShopifyAPI::Auth::GlobalApiClientCredentials.global_api_client_credentialsmints and caches the app-level JWT.ShopifyAPI::Context.global_api_urlsupports HTTPS-only non-production Global API hosts.401.expires_inandscoperesponse fields take precedence over JWT claim fallbacks.The request contract uses snake_case JSON, string shop IDs, the
2026-07API version floor, and both actual and documented idempotent replay headers.JavaScript reference: Shopify/shopify-app-js#3368
How has this been tested?
bundle exec ruby -Ilib -Itest test/app_events_test.rbbundle exec ruby -Ilib -Itest test/app_events/event_payload_test.rbbundle exec ruby -Ilib -Itest test/auth/global_api_client_credentials_test.rbbundle exec ruby -Ilib -Itest test/context_test.rbbundle exec rake test:library— 396 runs, 791 assertionsbundle exec rubocop— 119 files, no offensesbundle exec srb tccannot run on this Apple Silicon host because the lockedsorbet-staticbinary is x86_64-only:Bad CPU type in executable. CI must provide the typecheck result.Local Core smoke validation minted tokens, ingested events, and reported idempotent replays for
2026-07,2026-10, andunstable. The local installation cache was primed because the Query Engineapps.app_installationsview is unavailable in this environment.Checklist: