
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@remark-embedder/transformer-oembed
Advanced tools
@remark-embedder transformer for oEmbed supported links
@remark-embedder transformer for oEmbed supported links
You're using @remark-embedder/core to automatically
convert URLs in your markdown to the embedded version of those URLs and want to
have a transform for providers that support an oEmbed API. Learn more about
oEmbed from oembed.com
This is a @remark-embedder transform for supported
oembed API providers. Find the list of supported providers on
oembed.com.
This module is distributed via npm which is bundled with node and
should be installed as one of your project's dependencies:
npm install @remark-embedder/transformer-oembed
import remarkEmbedder from '@remark-embedder/core'
import oembedTransformer from '@remark-embedder/transformer-oembed'
// or, if you're using CommonJS require:
// const {default: oembedTransformer} = require('@remark-embedder/transformer-oembed')
import remark from 'remark'
import html from 'remark-html'
const exampleMarkdown = `
# My favorite YouTube video
[This](https://www.youtube.com/watch?v=dQw4w9WgXcQ) is a great YouTube video.
Watch it here:
https://www.youtube.com/watch?v=dQw4w9WgXcQ
Isn't it great!?
`
async function go() {
const result = await remark()
.use(remarkEmbedder, {
transformers: [oembedTransformer],
})
.use(html)
.process(exampleMarkdown)
console.log(result.toString())
}
go()
This will result in:
<h1>My favorite YouTube video</h1>
<p>
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">This</a> is a great
YouTube video. Watch it here:
</p>
<iframe
width="200"
height="113"
src="https://www.youtube.com/embed/dQw4w9WgXcQ?feature=oembed"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
<p>Isn't it great!?</p>
Some oembed providers offer special configuration via query parameters. You can provide those via config:
// ...
import type {Config} from '@remark-embedder/transformer-oembed'
// ...
async function go() {
const result = await remark()
.use(remarkEmbedder, {
transformers: [
[
oembedTransformer,
{params: {theme: 'dark', dnt: true, omit_script: true}} as Config,
],
],
})
.use(html)
.process(`https://twitter.com/kentcdodds/status/783161196945944580`)
console.log(result.toString())
}
// ...
That results in (notice the data- attributes which are specific to twitter's
oEmbed API):
<blockquote class="twitter-tweet" data-dnt="true" data-theme="dark">
<p lang="en" dir="ltr">
I spent a few minutes working on this, just for you all. I promise, it wont
disappoint. Though it may surprise 🎉<br /><br />🙏
<a href="https://t.co/wgTJYYHOzD">https://t.co/wgTJYYHOzD</a>
</p>
— Kent C. Dodds (@kentcdodds)
<a
href="https://twitter.com/kentcdodds/status/783161196945944580?ref_src=twsrc%5Etfw"
>October 4, 2016</a
>
</blockquote>
This could also be used to provide an access token for providers that require this (like Instagram).
You can also provide configuration as a function so you can determine what configuration to give based on the provider and/or the URL. Like so:
const oembedConfig: Config = ({url, provider}) => {
if (provider.provider_name === 'Instagram') {
return {
params: {access_token: '{app-id}|{client-token}'},
}
}
}
const remarkEmbedderConfig = {
transformers: [[oembedTransformer, oembedConfig]],
}
// ... etc...
It's a long story... Check out the inspiration on
@remark-embedder/core
remark-oembed: This one requires client-side JS to work
which was unacceptable for our use cases.Looking to contribute? Look for the Good First Issue label.
Please file an issue for bugs, missing documentation, or unexpected behavior.
Please file an issue to suggest new features. Vote on feature requests by adding a 👍. This helps maintainers prioritize what to work on.
Thanks goes to these people (emoji key):
Kent C. Dodds 💻 📖 🚇 ⚠️ | Michaël De Boey 💻 📖 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT
FAQs
@remark-embedder transformer for oEmbed supported links
We found that @remark-embedder/transformer-oembed demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.