Accessing Raw HTTP Response in HttpApiClient for Custom JWT Parsing

Is there way to "read" the raw response of a Request made by the HttpApiClient?

I would like to parse the response-headers for my custom JWT-token.

export const MasonClient = Effect.runSync(
  HttpApiClient.make(MasonApi, {
    baseUrl: "http://localhost:8002",
  }).pipe(
    Effect.provide(MasonHttpClient),
    Effect.map((client) => ({
      ...client,
      OAuth: {
        ...client.OAuth,
        SignInWithGoogle: () =>
          client.OAuth.SignInWithGoogle({
            payload: { platform: PLATFORM.platform },
          }).pipe(
            Effect.flatMap(({ url }) =>
              Match.value(PLATFORM).pipe(
                Match.when({ platform: "desktop" }, (platform) =>
                  Effect.promise(() => platform.openUrl(url))
                ),
                Match.orElse(() =>
                  Effect.sync(() => {
                    window.location.href = url;
                  })
                )
              )
            )
          ),
      },
    }))
  )
);


This is my current setup for the HTTP client
Was this page helpful?