Skip to content

feat: expose response status and error from getCredentials - #57

Draft
nicomiguelino wants to merge 1 commit into
mainfrom
feat/get-credentials-expose-status
Draft

feat: expose response status and error from getCredentials#57
nicomiguelino wants to merge 1 commit into
mainfrom
feat/get-credentials-expose-status

Conversation

@nicomiguelino

Copy link
Copy Markdown
Contributor

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. Both shopify-dashboard-app and salesforce-app have independently worked around this same gap in their own code.
  • 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.

Compatibility

This is additive and non-breaking. Existing callers that only destructure token/metadata are unaffected. Callers that need to distinguish a backend outage from an expected error can now inspect status.

Bumped 1.2.01.3.0 per this repo's versioning convention for a non-breaking feature addition.

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
nicomiguelino marked this pull request as draft July 20, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant