Skip to content

Add App Events logging API - #1459

Draft
kristianpd wants to merge 2 commits into
Shopify:mainfrom
kristianpd:app-events-log
Draft

Add App Events logging API#1459
kristianpd wants to merge 2 commits into
Shopify:mainfrom
kristianpd:app-events-log

Conversation

@kristianpd

@kristianpd kristianpd commented Aug 24, 2026

Copy link
Copy Markdown

Description

Adds the Ruby SDK counterpart to shopify-app-js App Events logging:

  • ShopifyAPI.log validates and posts one App Event to the Global API.
  • ShopifyAPI::Auth::GlobalApiClientCredentials.global_api_client_credentials mints and caches the app-level JWT.
  • ShopifyAPI::Context.global_api_url supports HTTPS-only non-production Global API hosts.
  • A 401 response refreshes the token once. Other HTTP errors propagate to the caller.

The request contract uses snake_case JSON, string shop IDs, the 2026-07 API 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.rb
  • bundle exec ruby -Ilib -Itest test/app_events/event_payload_test.rb
  • bundle exec ruby -Ilib -Itest test/auth/global_api_client_credentials_test.rb
  • bundle exec rake test:library — 390 runs, 769 assertions
  • bundle exec rubocop — 119 files, no offenses

bundle exec srb tc cannot run on this Apple Silicon host because the locked sorbet-static binary is x86_64-only: Bad CPU type in executable. CI must provide the typecheck result.

The live local-Core smoke minted a Global API token, then the events endpoint returned 503 Service unavailable. Core logged PG::InternalError: view 'apps.app_installations' not found in view catalog from VerifyAppInstallation; the SDK request reached the endpoint, but the local Query Engine prerequisite blocked event ingestion.

Checklist:

  • My commit message follows the documented pattern.
  • I have performed a self-review of my own code.
  • I have added tests that prove my feature works.
  • I have updated the project documentation.
  • I have added a changelog line.

@github-actions github-actions Bot added the devtools-gardener Post the issue or PR to Slack for the gardener label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devtools-gardener Post the issue or PR to Slack for the gardener

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant