So I spent a weekend on building a TypeScript SDK, that unifies how to interact with different iMessage providers (as there is no official way to use iMessage), so you can play around with them, without having to commit to one, nor with a need to rewrite half of the codebase to change the integration.
It's open-source, you can check the repo here: https://imessage-sdk.dev/