feat: expose response status and error from getCredentials - #57
Draft
nicomiguelino wants to merge 1 commit into
Draft
feat: expose response status and error from getCredentials#57nicomiguelino wants to merge 1 commit into
nicomiguelino wants to merge 1 commit into
Conversation
getCredentials() never checked the response status, so consumers had no way to distinguish a backend outage (5xx) from an expected error (e.g. integration not connected) other than a token-less body. Both shopify-app and salesforce-app have independently worked around this same gap. getCredentials() now resolves with the response status and, when present, the backend's error message, in addition to token/metadata. It still resolves rather than rejects on non-2xx responses, and a failed JSON parse now falls back to an empty body instead of throwing, so existing callers that only destructure token/metadata are unaffected. Bump to 1.3.0 (non-breaking, additive change).
nicomiguelino
marked this pull request as draft
July 20, 2026 23:38
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.
Summary
getCredentials()never checked the response status, so consumers had no way to distinguish a backend outage (5xx) from an expected error (e.g. "integration not connected") other than a token-less body. Bothshopify-dashboard-appandsalesforce-apphave independently worked around this same gap in their own code.getCredentials()now resolves with the responsestatusand, when present, the backend'serrormessage, in addition totoken/metadata.Compatibility
This is additive and non-breaking. Existing callers that only destructure
token/metadataare unaffected. Callers that need to distinguish a backend outage from an expected error can now inspectstatus.Bumped
1.2.0→1.3.0per this repo's versioning convention for a non-breaking feature addition.