Difficulty: Advanced
Type: Feature
Summary
Expose safe response metadata such as request IDs so SDK consumers can correlate client-side failures with backend logs and support tickets.
Current Behaviour
SDK service methods return typed data objects and throw GuildPassError on failures, but successful calls do not expose response metadata. If the backend returns headers such as X-Request-ID, X-Correlation-ID, or Traceparent, consumers have no clear way to access those values for diagnostics.
Expected Behaviour
Consumers should be able to access safe response metadata when they need it, without changing the default ergonomic service method return values.
Suggested Implementation
Add an optional request option such as includeMeta: true or provide parallel methods that return { data, meta }. Capture safe headers like request ID, correlation ID, trace ID, status, and duration. Keep the default API backwards-compatible by returning plain data unless metadata is explicitly requested.
Files or Areas Likely Affected
src/http/httpClient.ts
src/http/http.types.ts
src/types/common.ts
src/access/access.service.ts
src/membership/membership.service.ts
src/roles/roles.service.ts
src/guilds/guilds.service.ts
docs/sdk-guide.md
tests/
Acceptance Criteria
Additional Notes
Do not make every service return a new shape by default. This should be an opt-in diagnostic feature to avoid breaking existing consumers.
Difficulty: Advanced
Type: Feature
Summary
Expose safe response metadata such as request IDs so SDK consumers can correlate client-side failures with backend logs and support tickets.
Current Behaviour
SDK service methods return typed data objects and throw
GuildPassErroron failures, but successful calls do not expose response metadata. If the backend returns headers such asX-Request-ID,X-Correlation-ID, orTraceparent, consumers have no clear way to access those values for diagnostics.Expected Behaviour
Consumers should be able to access safe response metadata when they need it, without changing the default ergonomic service method return values.
Suggested Implementation
Add an optional request option such as
includeMeta: trueor provide parallel methods that return{ data, meta }. Capture safe headers like request ID, correlation ID, trace ID, status, and duration. Keep the default API backwards-compatible by returning plain data unless metadata is explicitly requested.Files or Areas Likely Affected
src/http/httpClient.tssrc/http/http.types.tssrc/types/common.tssrc/access/access.service.tssrc/membership/membership.service.tssrc/roles/roles.service.tssrc/guilds/guilds.service.tsdocs/sdk-guide.mdtests/Acceptance Criteria
Additional Notes
Do not make every service return a new shape by default. This should be an opt-in diagnostic feature to avoid breaking existing consumers.