Embed post requests / embed messaging system (launched)

Elliot Park · Friday Demos · April 19, 2024 · 4:20

A new framework for post requests in the embedded app, allowing for more dynamic experiences - here we show an order form modal

Try it yourselfThe full week on docsadministrationembed

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. I can do a quick one just share my screen cool so yeah I went ahead and added a modal that when you click on one of these images on gleam creates a little order now form that doesn't seem particularly exciting at face value but the one thing you might not is that when you do click on one of these um images in the uh in this markdown tile these inputs are pre-populated and you might be wondering where are we getting where are we getting these values pre-populate um these inputs on my little embed demo website well thanks to the power of Richard's message component and as soon as I click the right stuff you can see that these uh pieces of data are these these

  2. values actually coming straight from the query and are getting sent through via post message um to the parent website so something like this jacket has product name carart men's heavyweight hooded pullover sweatshirt and retail price 68 skew 73d you can actually see that these same values are popping up right from the query so yeah I know a couple customers uh uh have been asking about sending data Through the Wire like from a child page over to an embed parent page uh so it works and uh it's really exciting so all credit to Richard for um developing the Omni message component and really making it really seamless like it didn't take it didn't take me like really more than half a day to get this thing

  3. up and running so yeah that's amazing just a huge shout out to both of you for that too I know that was an additional ask and on top of everything else going on so thank you both to Elliot and Richard for putting that together and the demo for it Elliot it might be interesting to just show the mark down um so you can see how it's actually used yeah good call uh so if we dive in to the actual chart you'll see that um pretty simple uh the omn message component is a special markdown component that we now have that you can use within your markdown tiles uh in this case I'm wrapping an omni message component around the div that uh encapsulates the image

  4. so you'll see Omni message and then if you scroll down om message and a couple thing key things to note is that um you can specify the event name so that you know you can filter down um in this case by this specific click event and make sure that The Listener on your embed um application or the application that that's embedding Omni uh can listen for this specific event and perform actions obviously you can layer with multiple actions and create different listeners and or different uh event names and different listeners to handle multiple different parts of uh the embed app and translate them over to your um erent app and one thing to know here is that the event data parameter right here or property

  5. here uh so by default we my understanding Richard and Richard correct me if I'm wrong is that we pass through just whatever is in here as a raw string and so um in this case I'm passing over multiple values as a comma separated list which is probably like the most elegant way to do this um for now in you know in the long term we might want to find a way to support like creating Json objects within um the actual markdown but for now it's a little bit um it's a little bit more work than just creating comma separated list which is really simple to uh send over and also parse out on the parent app side so yeah Richard you want to call anything

  6. out yeah I think you covered it nice cool