PHPackages                             sylvainjule/embed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sylvainjule/embed

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

sylvainjule/embed
=================

Embed field for Kirby

1.2.0(9mo ago)7812.8k↓50%5[1 issues](https://github.com/sylvainjule/kirby-embed/issues)MITPHP

Since Sep 5Pushed 9mo ago6 watchersCompare

[ Source](https://github.com/sylvainjule/kirby-embed)[ Packagist](https://packagist.org/packages/sylvainjule/embed)[ RSS](/packages/sylvainjule-embed/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (16)Used By (0)

Kirby Embed
===========

[](#kirby-embed)

Embed field for Kirby 3, 4 and 5. Display embeds from various media sites (Youtube, Vimeo, Souncloud, Instagram, etc.) by only providing the url to the medium. Built on top of [oscarotero/Embed](https://github.com/oscarotero/Embed).

[![embed-screenshot](https://private-user-images.githubusercontent.com/14079751/475274447-65bc878e-d20d-4f4d-aec7-2f20e9b0aa71.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ0MDMxMDcsIm5iZiI6MTc3NDQwMjgwNywicGF0aCI6Ii8xNDA3OTc1MS80NzUyNzQ0NDctNjViYzg3OGUtZDIwZC00ZjRkLWFlYzctMmYyMGU5YjBhYTcxLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzI1VDAxNDAwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmMjlkOGY1ZjBmNGI0OGEwNDc0NThmOTNkZjRkMjdjZmIxMjQyOGJlOGJlODAxNDZmZmM1ZjU0MDY3NDZlM2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.109f9sl4EJrWP_Eaqdws8gX6OIsXv-95xJjVozrOPeE)](https://private-user-images.githubusercontent.com/14079751/475274447-65bc878e-d20d-4f4d-aec7-2f20e9b0aa71.jpg?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ0MDMxMDcsIm5iZiI6MTc3NDQwMjgwNywicGF0aCI6Ii8xNDA3OTc1MS80NzUyNzQ0NDctNjViYzg3OGUtZDIwZC00ZjRkLWFlYzctMmYyMGU5YjBhYTcxLmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzI1VDAxNDAwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmMjlkOGY1ZjBmNGI0OGEwNDc0NThmOTNkZjRkMjdjZmIxMjQyOGJlOGJlODAxNDZmZmM1ZjU0MDY3NDZlM2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.109f9sl4EJrWP_Eaqdws8gX6OIsXv-95xJjVozrOPeE)

Overview
--------

[](#overview)

> This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, you can consider [making a donation of your choice](https://www.paypal.me/sylvainjl).

- [1. Installation](#1-installation)
- [2. Blueprint usage](#2-blueprint-usage)
- [3. Options](#3-options)
- [4. Front-end usage](#4-front-end-usage)
- [5. License](#5-license)
- [6. Credits](#6-credits)

1. Installation
---------------

[](#1-installation)

> K3: up to 1.1.0, K4: up to 1.1.2, K5: 1.2.0+

Download and copy this repository to `/site/plugins/embed`

Alternatively, you can install it with composer: `composer require sylvainjule/embed`

2. Blueprint usage
------------------

[](#2-blueprint-usage)

The plugin provides a `embed` field that you can include in any blueprint:

```
fields:
  embed:
    label: Embed
    type: embed
```

You have access to all providers supported by [oscarotero/Embed](https://github.com/oscarotero/Embed). Please note that I won't include any provider unsupported by this library.

You can optionally limit the allowed provider to one within this list : `youtube`, `vimeo`, `flickr`, `instagram`, `twitter`, `soundcloud`. If any other link is pasted, the field won't request the embed.

```
embed:
  type: embed
  provider: youtube
```

If you are using this field in a structure field, it comes with a built-in preview. You can optionally set `icons: true` (default is `false`) to display some providers logos in this preview.

```
embed:
  type: embed
  icons: true
```

[![embed-icons](https://private-user-images.githubusercontent.com/14079751/311266324-ea26df07-005b-4f70-816d-f0e068da4ba4.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ0MDMxMDcsIm5iZiI6MTc3NDQwMjgwNywicGF0aCI6Ii8xNDA3OTc1MS8zMTEyNjYzMjQtZWEyNmRmMDctMDA1Yi00ZjcwLTgxNmQtZjBlMDY4ZGE0YmE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzI1VDAxNDAwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQzMDYzZGVjZDc3NDY3MWUyZTY2NzQwM2Y1MDJkN2ZkNzc5ZTdkOTkzZjBmODMzNjU0M2E4NGNmMDQxNTgxNzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.CU5zl_JzwSVLx3W0wH0BwJ6vEmLtkWae0T_44KGMqAQ)](https://private-user-images.githubusercontent.com/14079751/311266324-ea26df07-005b-4f70-816d-f0e068da4ba4.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ0MDMxMDcsIm5iZiI6MTc3NDQwMjgwNywicGF0aCI6Ii8xNDA3OTc1MS8zMTEyNjYzMjQtZWEyNmRmMDctMDA1Yi00ZjcwLTgxNmQtZjBlMDY4ZGE0YmE0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAzMjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMzI1VDAxNDAwN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQzMDYzZGVjZDc3NDY3MWUyZTY2NzQwM2Y1MDJkN2ZkNzc5ZTdkOTkzZjBmODMzNjU0M2E4NGNmMDQxNTgxNzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.CU5zl_JzwSVLx3W0wH0BwJ6vEmLtkWae0T_44KGMqAQ)

The field also has all the `url` field's options, except those which wouldn't make much sense for such a plugin (`default` for example), won't fetch anything in the backstage.

3. Options
----------

[](#3-options)

### 3.1. `nocookie`

[](#31-nocookie)

Use privacy-enhanced URLs whenever possible (default: `false`). If set to `true`:

- `youtube.com` domain will be replaced by `youtube-nocookie.com` in the saved embed code
- `vimeo.com` iframes will have a `dnt=1`parameter added in the saved embed code

In your `config.php` file:

```
'sylvainjule.embed.nocookie' => true

```

4. Front-end usage
------------------

[](#4-front-end-usage)

The plugin provides a `->toEmbed()` method, which is useful to get all the stored data of the embed (its html code, and a few other informations detailed below).

It also allows you to make sure your embed is successfully synced before trying to access the data:

```
if($embed = $page->myfield()->toEmbed()) {
    echo $embed->code()
}
```

Once you have access to the structured embed, here are the options you will have access to as if they were fields (this comes handy because depending on the provider, some informations might be empty. You can therefore check them with the usual Kirby field methods, like `$embed->license()->isEmpty()`).

```
$embed->title();        // The page title
$embed->description();  // The page description
$embed->url();          // The canonical url
$embed->type();         // The page type (link, video, image, rich)
$embed->tags();         // The page keywords (tags)

$embed->image();         // The main image found in the page

$embed->code();          // The code to embed the image, video, etc
$embed->width();         // The width of the embed code
$embed->height();        // The height of the embed code
$embed->aspectRatio();   // The aspect ratio (width / height)

$embed->authorName();    // The resource author
$embed->authorUrl();     // The author url

$embed->providerName();  // The provider name of the page (Youtube, Twitter, Instagram, etc)
$embed->providerUrl();   // The provider url
$embed->providerIcon();  // The main icon found in the page

$embed->publishedDate(); // The published date of the resource
$embed->license();       // The license url of the resource
$embed->feeds();         // The RSS/Atom feeds
```

A global site method is available to request embed data `$site->getEmbedData($url)`).

```
$url = 'https://www.youtube.com/watch?v=XXX';
$site->getEmbedData($url);
```

5. License
----------

[](#5-license)

MIT

6. Credits
----------

[](#6-credits)

Built on top of [oscarotero/Embed](https://github.com/oscarotero/Embed).

With the help of [@tristantbg](https://github.com/tristantbg). 👨‍💻

Kirby 2 field by [@distantnative](https://github.com/distantnative/embed), from which I've copy-pasted some bits of this readme. 👀

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance57

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 82% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~166 days

Recently: every ~157 days

Total

14

Last Release

287d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14079751?v=4)[Sylvain Julé](/maintainers/sylvainjule)[@sylvainjule](https://github.com/sylvainjule)

---

Top Contributors

[![sylvainjule](https://avatars.githubusercontent.com/u/14079751?v=4)](https://github.com/sylvainjule "sylvainjule (50 commits)")[![tristantbg](https://avatars.githubusercontent.com/u/4832038?v=4)](https://github.com/tristantbg "tristantbg (11 commits)")

---

Tags

embediframekirbykirby-pluginoembedsoundcloudspotifyvimeoyoutube

### Embed Badge

![Health badge](/badges/sylvainjule-embed/health.svg)

```
[![Health](https://phpackages.com/badges/sylvainjule-embed/health.svg)](https://phpackages.com/packages/sylvainjule-embed)
```

###  Alternatives

[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

343121.4M79](/packages/google-cloud-core)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[distantnative/retour-for-kirby

Manage redirects and track 404s right from the Kirby CMS Panel

14689.4k1](/packages/distantnative-retour-for-kirby)[craftcms/ckeditor

Edit rich text content in Craft CMS using CKEditor.

48359.1k52](/packages/craftcms-ckeditor)[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[verbb/hyper

A user-friendly links field for Craft.

24130.9k9](/packages/verbb-hyper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
