Hey Shlomo!
To connect your front end to MotherDuck, you can't use a direct fetch API or HTTP connection, as MotherDuck does not expose a REST API for direct browser access. Instead, you must use a supported client API (such as DuckDB in Python, Node.js, Go, or JDBC) on your backend, or leverage DuckDB-Wasm for in-browser analytics if your data and use case fit the constraints. For most web apps, the recommended approach is to have your backend connect to MotherDuck using the DuckDB client, then expose your own API to the frontend for data access and updates. Direct browser connections to MotherDuck are not supported due to authentication and security limitations.
If your use case is read-heavy and each user needs <1GB of data, you can use DuckDB-Wasm in the browser and sync data from MotherDuck, but this requires additional setup and is not suitable for all scenarios.