Setting `credentials: include` for FetchHttpClient in Effect Typescript

I have this in my frontend

export class ApiClient extends Effect.Service<ApiClient>()(
  'frontend/runtime/ApiClient',
  {
    dependencies: [
      FetchHttpClient.layer.pipe(
        Layer.provide(
          Layer.succeed(FetchHttpClient.RequestInit, {
            credentials: 'include',
          }),
        ),
      ),
    ],
    effect: HttpApiClient.make(MyApi, {
      baseUrl: 'http://localhost:3001',
    }),
  },
) {}

export const MyRuntime = ManagedRuntime.make(
  ApiClient.Default.pipe(
    Layer.merge(FetchHttpClient.layer),
    Layer.provide(Logger.minimumLogLevel(LogLevel.All)),
  ),
)


Notice I both provide FetchHttpClient.layer in the service default and merged on the layer (so I can make http requests in functions etc). Doing this overrides credentials: include I set in the client on the Service tho. How can I fix this while still ending up with seperate configs for the client inside the service/outside? There's a transformClient on HttpApiClient but not sure how I can set credentials there as it's specific to fetch.
Was this page helpful?