# embedo

> Embeds third party content to DOM with perks

Latest version **1.14.0** (published 2020-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install embedo
pnpm add embedo
yarn add embedo
bun add embedo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.14.0 |
| Published | 2020-10-30 |
| First published | 2016-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 252.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 344 |
| Author | Shobhit Sharma |
| Maintainers | shobhitsharma |
| Keywords | embed, embedo, social-media-plugin, content-embed, iframe, oembed |

## Links

- npm: https://www.npmjs.com/package/embedo
- Repository: https://github.com/shobhitsharma/embedo
- Issues: https://github.com/shobhitsharma/embedo/issues
- npm.io page: https://npm.io/package/embedo

## Recent versions

- 1.14.0 (latest) — 2020-10-30
- 1.13.0 — 2019-11-20
- 1.12.1 — 2019-11-20
- 1.12.0 — 2019-01-08
- 1.10.2 — 2019-01-08
- 1.10.0 — 2019-01-06
- 1.9.0 — 2019-01-05
- 1.8.0 — 2018-11-26
- 1.7.5 — 2018-11-01
- 1.7.4 — 2018-08-15
- 1.7.3 — 2017-11-16
- 1.7.2 — 2017-10-21
- 1.7.1 — 2017-10-21
- 1.7.0 — 2017-10-15
- 1.6.8 — 2017-10-13
- … 33 more at https://npm.io/package/embedo/versions

## README

# embedo [![npm](https://img.shields.io/npm/v/embedo.svg)](https://npmjs.org/package/embedo)

<img src="https://cdn01.onzu.com/2017/3/5/14/embedo.png" height="200" align="right">

> **Embedo** adds a layer on top of third party embed APIs while ensuring best practices and native guidelines for each component. It takes cares of resizing the container, emitting necessary events and with support for native and external options to be pass along.

### Docs: [Options](https://github.com/shobhitsharma/embedo/wiki/Options) / [API](https://github.com/shobhitsharma/embedo/wiki/API) / [Events](https://github.com/shobhitsharma/embedo/wiki/Events) / [Usage](https://github.com/shobhitsharma/embedo/wiki/Usage) / [Changelog](https://github.com/shobhitsharma/embedo/releases)

### What's currently supported?

- Facebook URLs containing page, post, photos, videos or comments
- Twitter URLs containing user timeline and tweets
- YouTube and Vimeo videos URLs
- Instagram URLs containing posts and videos
- Pinterest URLs containing board, profile and pins
- Google Maps URLs containing cordinates to a location
- Embeds other urls like Github Gists, Soundcloud, Spotify or PDF, MP4, Webm, ... as `iframe`
- Embeds any URL that fulfils HTTP access control (CORS) policy
- Extended plugin support for additonal oembed services
- Supports IE10+ and all modern browsers

---

## Installation

#### NPM / Yarn

```sh
$ npm install embedo --save
$ yarn add embedo
```

#### Bower

```sh
$ bower install embedo
```

#### CDN

Alternatively, import using CDN while updating `version` as per requirements from any script below:

```html
<script type="text/javascript" src="https://unpkg.com/embedo/embedo.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/embedo[@VERSION]/embedo.min.js"></script>
<script type="text/javascript" src="https://unpkg.com/embedo[@VERSION]/plugins/[@PLUGIN_NAME]/[@PLUGIN_NAME].embedo.min.js"></script>
```

## Setup

#### CommonJS / AMD

```js
import Embedo from '/path/to/vendor';

// Initialize Embedo class object
const embedo = new Embedo({
 facebook: {
    appId: 'my_app_id', // Enable facebook SDK
    version: 'v2.10'
  },
  twitter: true,  // Enable twitter SDK
  instagram: true,  // Enable instagram SDK
  pinterest: true  // Enable pinterest SDK,
  googlemaps: {
    key: 'my_api_key' // Enables google maps API
  }
});

// Then call .load() method from anywhere
embedo.load(<HTMLElement[object]>, <URL[string]>, <options[object]*optional>);

// OR Chaining methods and callback
embedo
  .load(HTMLElement, URL, options)
  .done(Function)
  .fail(Function)

// OR storing in a variable
let my_embedo = embedo.load(HTMLElement, URL)
my_embedo.done(Function);
my_embedo.fail(Function);
```

Also, an example can be [found here](https://codepen.io/shobhitsharma/pen/yojJZp).

#### HTML

```html
...

<body>
  <div data-embedo-url="[@URL_TO_EMBED]"></div>
  <div data-embedo-url="[@URL_TO_EMBED]" data-embedo-[@OPTION_KEY]]="[@OPTION_VALUE]"></div>
</body>

...

<script>
  new Embedo({
    facebook: {
      appId: 'my_app_id', // Enable facebook SDK
      version: 'v2.10'
    },
    twitter: true,  // Enable twitter SDK
    instagram: true,  // Enable instagram SDK
    pinterest: true  // Enable pinterest SDK,
    googlemaps: {
      key: 'my_api_key' // Enables google maps API
    }
  });
</script>
```

Also, an example can be [found here](https://github.com/shobhitsharma/embedo/blob/master/test/index.dom.html).

---
_Source: https://npm.io/package/embedo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
