samira.baroutiS
Convex Community3y ago
15 replies
samira.barouti

Authorization header in HTTP endpoints

We are using Convex for the backend, and we are exposing a couple of http endpoints. We need to be able to support sending the Authorization header (in the format of
Authorization: Bearer <api token>
) to our backend. We did not have any success with sending/extracting the
<api token>
header in our backend. Please see the below code snippet; the
authHeader
is
null
.
const myEndpoint = httpEndpoint(async ({ runAction, runQuery }, request) => {
  const authHeader = request.headers.get("Authorization"); //authHeader is null
...
}

Is there any way to enable sending the auth header in a request?
Was this page helpful?