Twitter Native Embed

btw, i don’t know how busy your forum is or how often x/twitter oneboxes are posted, but the basic free twitter plan does work for default oneboxes - it just rate limits to about 1 onebox request per 15 minutes. i have it running on a relatively busy forum and it only seems to limit when people try to post more than one onebox link in a post.

3 Likes

Unfortunately, i just discovered this stops a lot of YouTube (ie https://youtu.be/) from being embedded because the links redirect to YouTube.

People post far more YouTube links than they ever post X posts. So I’ve disabled for now and will simply edit x.com → twitter.com for now.

2 Likes

We very rarely have any x/twitter posts mentioned. And Twitter.com oneboxes do work, but X.com do not.

are you sure? i don’t mean this component, i mean the native onebox using a twitter developer free plan api token and with this component disabled. you say you are being hosted - they should be able to set up the default oneboxing like that exists here on Meta.

i have the rich x/twitter embedding for free on 2 different self hosted sites. i use this component when the x/twitter api breaks for whatever reason and just toggle it on and off as needed then.

5 Likes

I set up a developer free account for X. I am wondering how you get a Twitter one box for embedding?

I have the Native Twitter Embed component working fine, but I am wanting to post in dark mode.

It seems that on some recent Discourse versions, disabling Twitter/X oneboxes does not work well.
Also, this theme component does not work correctly on already existing oneboxes.

I have added some functionality that, in addition to replacing the bare links with a native embed, also looks for Twitter oneboxes, and then does the same thing.

That means there is no need to disable oneboxing or rebuild old posts any more.

PR here Feature: support existing oneboxes by communiteq · Pull Request #1 · Lhcfl/discourse-twitter-native-embed · GitHub

3 Likes

Thank you! Sorry for the one-month delay. I was hospitalized and confined to bed at that time, and I have just been discharged and seen this PR. Merged!

5 Likes

Hi All… anyone having issues with this plug-in? It appears something broke and it is not showing embeds again either with x.com or twitter.com. Was there a new Discourse version that broke it?

1 Like

Confirming this is still broken as of today (Sept 26, 2026).

On my instance the component now actively throws an error rather than just failing silently — Discourse shows the admin-only banner:

:warning: Posts may not be rendering correctly because one of the post decorators on your site threw an error. Caused by “Twitter/X Einbindung” [Twitter/X embed].

This keeps happening repeatedly and is triggering Safe Mode-style warnings site-wide, not just a missing embed. Discourse version: 2026.10.0.

Anyone found a fix or workaround beyond disabling the component entirely?

I will move to Nitter embeds after resolving some ipv6 issues on my provider and opt out completely from Twitter.

1 Like

Ever since Musk drastically restricted API access due to ongoing bot spam, every form of external access to the platform has been suffering.

I can understand the business and security decisions, but not the lack of official options for external embedding.

I know Nitter, but it isn’t as convenient as copy & paste of original X links.

It might make sense for the Discourse project team itself to approach X Corp and offer an official plugin.

Otherwise, I honestly don’t see a future for interoperability here. And X is, without question, the most important news platform in the western world

Note that Nitter got a cease and desist letter last month and might not be around for much longer: X sends cease-and-desist to open source project Nitter over alleged scraping | TechCrunch

2 Likes

Seems legit. They erased tons of their data with no explanation or recovery, the interests behind are really dark.

The community project I linked is more alive than every. Codeberg, community driven.

Until X changes something and Zed is not there anymore to do the actual hard scraping work.

Well, the resistance resists until it is possible to resist. Autistic (Inventati) was working for humanity for decades until it was no longer possible to continue.

I think Nitter would be maintained for at least a year without further issues. They only push to massive services, and self-hosting does not have that impact.

1 Like

(post deleted by author)

Made a small fork of this component that fixes the safe-mode crash (unguarded null on a missing attribute) plus a couple of smaller issues: GitHub - terraboss/discourse-x-native-embed: X embedding · GitHub — working well so far, feedback appreciated.

1 Like

this component is not broken and works as expected on my site.

1 Like

Thanks for the feedback. For me, a fork with a guarded decorator (try/catch plus a null check on data-onebox-src) has fixed the safe-mode banner so far, but it’s too early to say whether that’s permanent or whether I’ve found the real cause. I’ll keep watching it.