What’s new in Typeform Embed SDK — 2025 update

Matej Lednicky
4 min readJan 14, 2025

--

Welcome to my 4th and latest article in this series. As the year of 2024 comes to an end, it is time for our yearly recap of Embed SDK features delivered to you by my team and I. This time, the article is available earlier, already in December of 2024.

Past year did not bring many updates to the Embed SDK, however the team was busy delivering other exciting features such as the long-awaited reCAPTCHA support, support for Multi-Question Pages or duplicate response prevention.

But there are some new features — so let’s dive in 👇

🕵️ Detecting duplicate responses

In August we added new for onDuplicateDetected callback. To use it, first enable the “Duplicate response prevention” in your form:

Form settings ⚙️

Then a onDuplicateDetected callback will be fired every time your typeform detects a duplicate submission (via cookies or IP address, depending in your settings). This gives you more control over your embedded form — maybe you don’t want to display the “Looks like you’ve already submitted this form” screen, right? You can make better use of the screen real estate on your page — maybe embed a different form? Or display another call to action, the choice is yours.

<div id="form" style="width:100%;height:600px;"></div>
<script src="//embed.typeform.com/next/embed.js"></script>
<script>
const formId = '' // TODO: your form ID
const container = document.querySelector('#form')
const onDuplicateDetected = () => {
container.style.display = 'none'; // you can hide the embed if the form was already submitted
}
window.tf.createWidget(formId, {
container,
onDuplicateDetected
})
</script>

🚪 Handle closed typeforms

Recently we updated the payload in onReady callback and added new isClosed prop. This indicates if your typeform is closed.

Closed forms can not be submitted ❌

Forms can be closed:

  • manually,
  • based on timestamp, or
  • when a response limit of the form is reached (set manually per form), or
  • when a response limit of your account plan is reached

This way, if the form is unable to collect responses, you will know. You can handle such use-cases by eg. hiding the form from your page, or embedding a different form.

<div id="wrapper"></div>
<script src="//embed.typeform.com/next/embed.js"></script>
<script>
const formIds = ['one', 'two', 'three'] // TODO: your form IDs
const wrapper = document.querySelector('#wrapper')

const onReady = ({ isClosed }) => {
if (isClosed) {
embedForm() // try with next ID if previous form is closed
}
}

const embedForm = () => {
wrapper.innerHTML = '' // reset any previous HTML in the wrapper (from previous embeds)
const container = document.createElement('div')
container.style.width = '100%'
container.style.height = '600px'
wrapper.append(container)

const id = formIds.shift() // take first ID from the array
window.tf.createWidget(id, {
container,
onReady
})
}

embedForm() // embed first form from the array
</script>

⚙️ Improved compatibility with 3rd party libs

In July we improved the SDK to better work with 3rd party libraries such as Cookiebot for user consent management. Such libraries often dispatch events on iframes in the page. Embed SDK is now listening to trusted events only, ignoring events from 3rd party libraries.

And that is all from me, at least from now. As my time at Typeform sadly came to an end, I am no longer maintaining the Typeform Embed SDK. I am leaving it with my team. I also have high hopes someone from the team will take over also here on the blog and keep you posted about the SDK.

You can still find me in the Typeform Community. Also feel free to ping me on Github or Twitter / X if you’d like to discuss Embed SDK or anything else.

Cheers to my team with some fresh craft beer 🍻

This is a bittersweet situation for me. I love my work and my team, however I am heading towards new challenges (stay tuned 😉).

So long and thanks for all the fish! 👋

--

--

Matej Lednicky
Matej Lednicky

Written by Matej Lednicky

I do javascript @ Lingo.dev // work on things that matter

No responses yet