- Newest
- Most votes
- Most comments
Debugging Steps
Check for Differences in Token Handling:
Ensure that the token received in your frontend is identical to the one you're testing with in the AppSync query dashboard. Log the token in your frontend before sending it to verify its format.
Verify Headers on Frontend Request:
Ensure that the Authorization header is being correctly set in the request from the frontend.
Some frontends might add or modify headers automatically, so it’s important to verify this step.
CORS and Network Issues:
If the frontend is on a different domain than AppSync, ensure that CORS (Cross-Origin Resource Sharing) is properly configured.
Check browser developer tools for any network or CORS errors that might be preventing the request from going through correctly.
Check for Differences in Event Structure:
Log the event structure received in your Lambda function when triggered by the frontend versus the AppSync query dashboard. There might be differences in how the event is structured, especially in how headers or authorization tokens are passed.
Environment Variables:
Ensure that the CLERK_API_KEY environment variable is correctly set in the Lambda function environment.
Error Handling and Logs:
Double-check that all errors and unexpected paths are logged in your Lambda function to CloudWatch. You mentioned that you're not seeing logs from the frontend request, so consider adding a log statement at the very beginning of your Lambda handler to confirm if it’s being triggered.
Testing with Postman or Curl:
Try replicating the request from the frontend using a tool like Postman or Curl. This can help isolate whether the issue is in the frontend code or the AppSync configuration.
Relevant content
- AWS OFFICIALUpdated a year ago

Thank you so much for your reply!
I have tried several approaches. Since I cannot see at all the logs from the request from my frontend, I'm not sure if the token is correct. However, I am almost sure it is, since I have tested the same value from AWS console and worked.
About the headers I use on this call, I can see on network tab that I am using the correct API-Key and the url to make the request is also correct. Not sure what else to check about the headers.
About CORS and Network Issues, I don't see any error on logs or network tabs. The CLERK_API_KEY is also correct. Also, the Event Structure is the same and correct.
Making the request using Curl I can see this error: "errors" : [ { "errorType" : "UnauthorizedException", "message" : "You are not authorized to make this call." } ]
About the logs on my frontend request, I am not sure, but could be there request is not being sent through Lambda service? I am not even able to see the invocation of the request on CloudWatch.