oscklmO
Convex Community2y ago
18 replies
oscklm

[ConvexAuth] getting jwtToken to pass to auth headers in fetch on client

Is there a way to get the jwtToken client side when authenticated, when using convex auth? i'd like to pass it in the auth headers of a fetch request from my client

fetch("https://<deployment name>.convex.site/uploadImage", {
  headers: {
    Authorization: `Bearer ${jwtToken}`,
  },
});


Like for example with clerk you could do something like:
auth().getToken({ template: "convex" })
Was this page helpful?