Allow injection of an HTTP client

Open
#65 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
nodejs, typescript
Domain
api

Research direction

Start at the DockerClient construction API and trace how the current undici-based network client is selected. Define the injection and fallback behavior described in the issue, make undici optional, and verify that DockerClient still uses its default client when none is supplied.

Written by the indexing model from the issue text.

Description

Using undici is a great choice, but bundling it with the app could be offputting for anyone who's currently using e.g. axios, got, or pure Node HTTP calls (or even just a different version of undici). For those folks, it'd be better if:

  • undici is an optional peer dependency
  • when creating a DockerClient, we can provide our own network client implementation; otherwise it defaults to your undici-based implementation
Dominant language
TypeScript
Stars
107
Forks
12
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docker/node-sdk

All issues in docker/node-sdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.