amplify-js icon indicating copy to clipboard operation
amplify-js copied to clipboard

Provide a way to make REST API calls at the method level without reaching out to Cognito

Open tonyawad88 opened this issue 5 months ago • 1 comments

Is this related to a new or existing framework?

No response

Is this related to a new or existing API?

REST API

Is this related to another service?

No response

Describe the feature you'd like to request

Currently, when using Amplify v6's REST API client (get, post, put, etc. from aws-amplify/api), all requests automatically attempt to authenticate through Cognito, even when calling public API endpoints that don't require authentication. This results in unnecessary calls to AWSCognitoIdentityService.GetId and can cause performance overhead and potential errors for public endpoints.

Describe the solution you'd like

Add an authMode option to the REST API method options that allows developers to specify authentication behavior at the method level. Suggested authMode values: • 'none' - No authentication, skip Cognito calls entirely

Describe alternatives you've considered

Developers currently have to:

  1. Use native fetch() instead of Amplify's REST client
  2. Accept the performance overhead of unnecessary Cognito calls

Additional context

No response

Is this something that you'd be interested in working on?

  • [ ] 👋 I may be able to implement this feature request
  • [ ] ⚠️ This feature might incur a breaking change

tonyawad88 avatar Jul 06 '25 11:07 tonyawad88