How to export structured notes (image + text) from a Next.js app to Apple Notes?

I’m developing a Next.js application where users can take notes on pictures, and I’m looking for a way to allow users to export these notes (structured as image + text pairs) directly to Apple Notes. So far, I’ve tried several approaches, but none seem ideal. I’m hoping someone can suggest better solutions or improvements.

Question:

Has anyone encountered a similar situation or found a better way to export structured data (like image + text) to Apple Notes from a web app? Are there any workarounds or other APIs that might support this kind of integration?

Any guidance or suggestions would be greatly appreciated!

Here are the options I’ve tried so far:

Copy and Paste:

I copy the information (text + image) to the user’s clipboard. They can manually paste this into Apple Notes.

Issue: This solution is not very user-friendly and requires manual intervention.

URL Scheme (Only works for text):

iPhone: mobilenotes://add?title=My%20Note%20Title&content=This%20is%20the%20body%20of%20the%20note%20on%20iOS

Mac: notes://add?title=My%20Mac%20Note%20Title&content=This%20is%20the%20body%20of%20the%20note%20on%20macOS

Issue: This only allows text export; images cannot be included using this approach.

Using the Share API:

This allows the user to select Apple Notes as the app where the content will be saved. It works well but has limitations.

Issue: The Share API can only handle a structure like: one title, one text block and then the images in a combination (but not text – image, text – image blocks … etc.