{"id":36987887,"url":"https://github.com/daun/statamic-embed-fieldtype","last_synced_at":"2026-02-13T12:02:17.852Z","repository":{"id":327623612,"uuid":"1107259627","full_name":"daun/statamic-embed-fieldtype","owner":"daun","description":"Fieldtype for embedding and previewing external content in Statamic","archived":false,"fork":false,"pushed_at":"2025-12-05T08:52:04.000Z","size":1700,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-08T01:53:45.443Z","etag":null,"topics":["embed","statamic","statamic-addon"],"latest_commit_sha":null,"homepage":"https://statamic.com/addons/daun/embed-fieldtype","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daun.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-30T21:49:03.000Z","updated_at":"2025-12-05T10:44:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/daun/statamic-embed-fieldtype","commit_stats":null,"previous_names":["daun/statamic-embed-fieldtype"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/daun/statamic-embed-fieldtype","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-embed-fieldtype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-embed-fieldtype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-embed-fieldtype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-embed-fieldtype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daun","download_url":"https://codeload.github.com/daun/statamic-embed-fieldtype/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daun%2Fstatamic-embed-fieldtype/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28403971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embed","statamic","statamic-addon"],"created_at":"2026-01-13T23:14:00.065Z","updated_at":"2026-01-13T23:14:00.704Z","avatar_url":"https://github.com/daun.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Statamic Embed Fieldtype\n\nFieldtype for embedding and previewing external content.\n\n\u003cimg src=\"art/field-podcast.png\" alt=\"Example embed field\" width=\"600\"\u003e\n\n## Features\n\n- Augment URLs with embed data: iframe, thumbnail, title, description\n- Live preview of embedded content in the control panel\n- Powered by the [Embed](https://github.com/php-embed/Embed) library and extensible with custom adapters\n- Supports any provider with oEmbed endpoint or Open Graph meta tags\n\n## Vs. the Built-In Video Fieldtype\n\nIf you need to embed videos from YouTube and Vimeo, you should probably stick with Statamic's\nbuilt-in [video fieldtype](https://statamic.dev/fieldtypes/video). It comes with less complexity\nas it doesn't need to fetch the metadata or embed codes.\n\nThe fieldtype of this addon becomes useful if you need:\n\n- Other providers and content types like audio players, social media posts, etc\n- Ready-to-render html for embedding the content in an iframe\n- Additional metadata like title, description, thumbnail, etc\n\n## Installation\n\nInstall the addon via Composer:\n\n```bash\ncomposer require daun/statamic-embed-fieldtype\n```\n\n## Fieldtype\n\nThe addon ships with an `embed` fieldtype that accepts a url and shows a preview in the editor.\n\n```yaml\nfields:\n  -\n    handle: embed\n    field:\n      type: embed\n      display: Embed\n```\n\n## Frontend\n\nThe fieldtype augments the url to an array of embed data. The following example\nwill render a simple embed card with either an iframe (if available) or a preview\nimage.\n\n```html\n{{ if embed:url }}\n  \u003carticle class=\"border rounded-lg overflow-hidden\"\u003e\n    {{ if embed:code }}\n      \u003cdiv\n        class=\"relative aspect-(--embed-ratio) overflow-hidden [\u0026_iframe]:w-full [\u0026_iframe]:h-full [\u0026_iframe]:border-0\"\n        style=\"--embed-ratio: {{ embed:code:ratio }}\"\n      \u003e\n        {{ embed:code:html }}\n      \u003c/div\u003e\n    {{ elseif embed:image }}\n      \u003cimg\n        src=\"{{ embed:image:url }}\"\n        class=\"w-full h-auto\"\n      /\u003e\n    {{ /if }}\n    {{ if embed:title }}\n      \u003cdiv class=\"p-4\"\u003e\n        \u003cp class=\"line-clamp-1 font-semibold\"\u003e\n            \u003ca href=\"{{ embed:url }}\"\u003e{{ embed:title }}\u003c/a\u003e\n        \u003c/p\u003e\n        {{ if embed:description || embed:author:name }}\n          \u003cp class=\"line-clamp-1\"\u003e{{ embed:description ?? embed:author:name }}\u003c/p\u003e\n        {{ /if }}\n        {{ if embed:provider:url }}\n          \u003cp class=\"text-gray-500\"\u003e{{ embed:provider:url | replace('https://', '') }}\u003c/p\u003e\n        {{ /if }}\n      \u003c/div\u003e\n    {{ /if }}\n  \u003c/article\u003e\n{{ /if }}\n```\n\n### Unaugmented URL\n\nIf you want to use the raw url without augmentation, you can access it via `embed:url`. To turn off\naugmentation completely, you can set the field config `augment_to_embed_data` to `false`. This will\nreturn the url as-is in all frontend contexts.\n\n```diff\nfields:\n  -\n    handle: embed\n    field:\n      type: embed\n      display: Embed\n+     augment_to_embed_data: false\n```\n\n## Extending the Embed Library\n\nThe addon uses the [Embed](https://github.com/php-embed/Embed) library under the hood, which supports\na variety of providers out of the box: YouTube, Vimeo, Instagram, Flickr, etc. You can customize the\nlibrary instance and settings and also create custom adapters for unsupported providers by registering\na resolving callback in your service provider. See [Extending Embed](https://github.com/php-embed/Embed?tab=readme-ov-file#extending-embed)\nfor details and examples.\n\n```php\nnamespace App\\Providers;\n\nuse Embed\\Embed;\n\nclass AppServiceProvider extends ServiceProvider\n{\n    public function register()\n    {\n        $this-\u003eapp-\u003eafterResolving(Embed::class, function (Embed $embed) {\n            $embed-\u003egetExtractorFactory()-\u003eaddAdapter('mysite.com', MySite::class);\n            $embed-\u003esetSettings([\n                'instagram:token' =\u003e '12345678',\n                'twitter:token' =\u003e 'abcdefgh',\n            ]);\n        });\n    }\n}\n```\n\n## License\n\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Fstatamic-embed-fieldtype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaun%2Fstatamic-embed-fieldtype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaun%2Fstatamic-embed-fieldtype/lists"}