Get the ID of an embedded Tweet on render


#1

Hi,

I’m trying to wrap a twttr.widgets.load() event with some promises, and would like to fulfill the promise when the Tweet is fully rendered. When handling the “rendered” callback, however, all I receive is an Object with two properties: type = "rendered" and target = HTMLElement.

The documentation suggests I get an ID via event.target.id, but that gives me the element ID, which doesn’t fit my use-case. Is there a way for me to get the actual ID of the Tweet that has been embedded?

Thanks!


#2

I’m afraid that’s not something we presently include in the event payload, but that feels useful and obvious. We can’t add it for you instantly, but I’ll put something on the backlog for when we next have a chance to work on the events code.

Thanks!


#3