The NPM packages ipfs-http-client
and ipfs-core
both have TypeScript typings now, but because they're still not ESM capable and only ship Node code by default, modern toolchains like Snowpack or Vite try to import it directly into the browser which fails because of all sorts of dependency related complications.
The developers seem to have their Webpack based workflow settled, and that's pretty much the easiest way to go about it. But for those of us who would rather not, thank you, this is a modern JavaScript module that reexports the browser dist bundles from within the ipfs-http-client
package as well as its type for convenience.
Install it from GitHub directly: npm i ipfs-http-client
Use it with a standard import IPFS from 'ipfs-http-client
in a modern ESM or TypeScript project. I use it with Snowpack and Vite.