use of minio library in notebook

I would like to access some data served by MinIO (I have access/private keys).

I have been trying to require minio in Observable notebooks, but it is really a stubborn library (and I am probably not knowledgeable enough)!

I have tried:

  1. require("minio") which fails (if you use require.resolve("minio") it gives "https://cdn.observableusercontent.com/npm/minio@8.0.1/dist/main/minio.js")
  2. then I used the notebook “Module require debugger” which gave as a suggestion require('minio@8.0.1/dist/main/minio.js').catch(() => window["_exportNames"]) which fails too
  3. then from How to require stubborn modules I’ve also given a try to require('https://bundle.run/minio@8.0.1') which fails too

I am out of alternative resources to try…
Anybody with suggestions?

esm.sh usually does a decent job of bundling browser shims for Node APIs:

import("https://esm.sh/minio")

If the API is truly S3 compatible then you could alternatively take a look at aws4fetch:

I see there is an open issue requesting a version that can be used in a browser.

For S3 access you may want to look at this template: AWS S3 API Starter / Observable | Observable

I would be curious if the esm.sh solution works for you. I tried it but get this error:

But I was able to access the bucket using the template I shared above.

No success with your template for MinIO…unfortunately

yeah, esm.sh didn’t work for me too

Sorta related but sorta not, I have a half finished observable notebook connecting with Backblaze, R2 and minio here mps3 - Offline-first DB over S3-compatible storage / Tom Larkworthy | Observable but it uses my own home rolled library. minio works with any S3 client, so I would go the route cobus suggested, just consider it an S3 client, the AWS S3 browser client can connect to it fine. I have done the aws4fetch route before and its awesome for perf and bundle size but you have to decode S3’s baroque and broken XML so its only for niche use, not general purpose IMHO