Embed Anvil app - Beta Editor

What I’m trying to do:
I’m trying to embed an anvil app into my webflow site to gain access to some backend features.
I love anvil for its simplicity but I need webflow for the rest of my site.

What I’ve tried and what’s not working:
I’ve managed to get this working using an iFrame embed with the OLD EDITOR (which is documented here: Anvil Docs | Embedding Your App)

However, this flag for ‘enable embed’ is nowhere to be found in the Beta Editor, and the embed feature is not mentioned at all in the Beta Editor documentation.

Is this a flag that I can manually change by cloning the repo? Or is this feature of embedding an app no longer supported (if so, then why not?)

Would appreciate some guidance :slight_smile:

All the best,
Pat

It’s not available yet in the new IDE, though this posts suggests it will be later :

3 Likes

It might be interested to diff an app’s source files, before and after, to see what changes when this switch is flipped.

1 Like

I just created a test app and only made this change by creating it first in the beta editor, then switching to the classic, enabling this and then switching back to the beta editor.

Here is the only difference found in the .yaml file. (I just downloaded it, instead of using git)

allow_embedding: false
or
allow_embedding: true

1 Like

This is actually very good. Nothing was lost in translation from one IDE to the other! (A regular worry of mine, put to bed.)

I’m not fond of hacks. But if one is in a real hurry, has a local copy of their source code already (via Git), and does not want to deal with switching editors…

1 Like

This is great news yeah! Let me try it and see if it works.
I tried yesterday by ‘enabling’ the embed in the old editor for an app built in the Beta editor - but the link generated in the embed didn’t work.

I will try enable it in the classic editor and switch back to the Beta editor before generating the publish link to see if this works.

Will report back shortly!

The tags it created for me looked like this:

(The app was unpublished so just had a generic unpublished url)

<script src="https://anvil.works/embed.js" async></script>
<iframe style="width:100%;" data-anvil-embed src="https://IAMMWNHMVREA57IW.anvil.app/null"></iframe>

The app is also deleted now, so this link will no longer work.

The link generated for the embed when switching back to the classic editor is broken with a /null endpoint on the publish link

when I try to embed straight from here I see the following error in the embedded page:
We could not find an app that matched your request

However, switching back to the Beta editor and using the published link from there in the same embed code seems to work fine!:


I guess if its that easy and its just one line in the config file - why isn’t this implemented yet? Seems like a very simple thing to do with an annoying workaround. I suppose embeds aren’t commonly used in the anvil community?

Yep! I got the same. The /null at the end seems to point to an empty resource. However switching back to the beta editor and just switching this link out for the published link from the Beta editor did the trick.

1 Like

Our friends at Anvil might have something entirely new up their sleeve, for when the feature reaches the Beta IDE. Hacks and workarounds could stop working at any time.

This could still be useful, though, in some sort of query tool. E.g., in which of my apps have I enabled embedding? Read my own .yaml files and find out!