BugdrLog in
All problems
EasyJavaScriptBackend Engineer · auth · client-library · http-headers · javascript · typescript

Client Initialization with Custom Headers

★ 0.0 (0 ratings)20 min0 engineers solved this

Your assignment

This is an isomorphic JavaScript client library for a hosted Postgres backend with auth, row-level data access, realtime channels, file storage and edge functions. Applications call createClient(url, key, options) once and use the returned object for auth, from(table) queries, rpc calls, storage, functions and channels. The constructor builds one sub-client per area: an auth client, a PostgREST data client, a realtime client, a storage client and a functions client. Options such as global headers are passed to these sub-clients. The auth client also receives a flag that tells it whether the caller supplied its own Authorization header, which changes how getUser behaves when no session exists. Headers are plain key-value objects supplied by the caller.

What the team is seeing

incident log
Some developers say that when they pass their own authorization header in the client settings, the library still behaves as if no such header was given. Their user lookups fail with a missing-session complaint even though their header is set. Other developers using the same header with a different capitalization see no problem.

Acceptance checks 1

  • Check 1

Discussion is locked — log in and complete this problem to join the discussion and rate your experience.