Faster websocket connection? Or skip websocket connection?
I am building a chrome extension that saves the given page to a convex DB.
When I press the browser action button it takes a second to load before it saves the page. The issue is the time it takes to connected the websocket for me here in Western Australia.
If I use the HTTP client its lightning quick.
Is there a way I can either speed up the websocket connection or perhaps access the auth token after the initial sign-in then use that for subsequent http calls?
6 Replies
The other way I have thought of doing it is introducing a new table "ApiKeys". When the extension authenticates for the first time it also allocates an API key for the user. This is then stored locally and used in future http client calls.
Ill probably go with this if there is no better solution
Is there a way I can either speed up the websocket connection or perhaps access the auth token after the initial sign-in then use that for subsequent http calls?Which auth solution are you using?
ah I just saw I can set the TokenStorage. https://labs.convex.dev/auth/api_reference/react#convexauthprovider perhaps I should intercept that? can I use that token for the http client?
react - Convex Auth
Authentication library for your Convex backend
You're probably looking for: https://labs.convex.dev/auth/authz#authenticate-http-actions
Authorization - Convex Auth
Authentication library for your Convex backend
ooo yes this does look like it should do what I need, thanks!