Installation
Install
Section titled “Install”<o-embed> is available on npm. You can install it locally or use a CDN like unpkg.com.
Local Installation
Section titled “Local Installation”npm i @social-embed/wcyarn add @social-embed/wcpnpm add @social-embed/wcServices like unpkg.com can serve published npm packages directly as ES modules. For unpkg.com, you’ll need to append ?module so that bare import specifiers are automatically rewritten.
<script type="module" src="https://unpkg.com/@social-embed/wc?module"></script>
<o-embed url="https://youtu.be/Bd8_vO5zrjo" allowfullscreen></o-embed><o-embed url="https://www.youtube.com/watch?v=NB5hH3ksvKE" allowfullscreen></o-embed>Try it on CodePen, or check the Playground from the top menu for more demos.
JavaScript
Section titled “JavaScript”import { OEmbedElement } from "https://unpkg.com/@social-embed/wc?module";