Comment

Comment by AlexTDiaconu

As with REST APIs, you'd want to be able to authenticate to a websocket-based API using either basic auth, or a bearer token-based auth scheme. Unfortunately, the browser websocket API doesn't allow you to specify arbitrary headers in the websocket request, so it's typical instead to have credentials supplied via a query param (such as "accessToken" for a bearer token) in the wss request.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton