Embeddable Meteor Clients?

Has anyone tried to build something embeddable inside other applications?

Are there any front end DDP client libraries? Something I could stitch to something like Angular to make a portable widget/app?

2 Likes

Check this project: https://github.com/mondora/asteroid

I’ve not used it personally. But this should help you.

1 Like

Are iframes considered completely uncool these days? I’ve put a meteor app in an iframe embedded in another app and it worked fine for my purposes. Of course, they can’t interact with each other directly in client side js, but can via database changes or DDP.

Actually they can interact with each other, try window.postMessage

2 Likes

Well, there’s of course iframes. But if you want to really seperate the client-side from the server side there are 2 approaches:

  1. Use a lightweight library like asteroid to build your application
  2. Set up a custom build system (e.g. using Gulp) to package the client side as a normal web application. You would need to create your own index.html and make sure DDP connects to the correct host/port.

This last approach is what I’ve done for my angular application, because I wanted to use angular-meteor instead of asteroid and I have many sub-applications (for different audiences) that connect to the same backend, but are completely different. I could have made this in one application with a router, but my sub-applications don’t share anything on the front-end so that didn’t seem to be a good way.

Its not a function of being “uncool” so much as it is a very inelegant solution to a wide range of desired outcomes.

How much time and effort did you end up putting into the second options? Any key learnings you don’t mind sharing?

Very nice as usual Arunoda, thank you. I will investigate this thoroughly.

1 Like

Well, how about that?

window.postMessage – I learnt something new today.

2 Likes

@babrahams Is there a SO answer / resource you used to guide you through embedding a Meteor web-app into an iFrame? Or, if you could share the general steps you took, that would be awesome!