mikeysee
mikeysee5mo ago

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
mikeysee
mikeyseeOP5mo ago
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
Michal Srb
Michal Srb5mo ago
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?
mikeysee
mikeyseeOP5mo ago
Convex Auth (https://labs.convex.dev/auth). Just passwords for now
mikeysee
mikeyseeOP5mo ago
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
Michal Srb
Michal Srb5mo ago
Authorization - Convex Auth
Authentication library for your Convex backend
mikeysee
mikeyseeOP5mo ago
ooo yes this does look like it should do what I need, thanks!