npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@playcode/embed

v0.1.1

Published

Embed a live Playcode project (an AI-built, Cloud-hosted website or app) into any web page. Zero dependencies, framework-agnostic, responsive, lazy-loaded.

Readme

@playcode/embed

Embed a live Playcode Cloud project - an AI-built, full-stack website or app - into any web page. Zero dependencies, framework-agnostic, responsive, and lazy-loaded.

Playcode is an AI app builder for non-technical teams: describe the software you want in plain English, Playcode AI builds it, and Playcode Cloud runs it with a real backend, database, HTTPS, and custom domains. Every Cloud project is served at https://{slug}.playcode.ai, so this package wraps it in a clean, responsive iframe for your portfolio, docs, blog, or landing page.

npm install @playcode/embed

Cloud and browser projects are both embeddable. Cloud projects (https://{slug}.playcode.ai) are the default. Browser projects (https://{slug}.playcode.site) also work - pass host: "playcode.site". See Embeddability for the one caveat (an app that sets its own X-Frame-Options / CSP frame-ancestors).

Quick start

Web component (recommended)

<script type="module">
  import { definePlaycodeEmbed } from '@playcode/embed/web-component'
  definePlaycodeEmbed()
</script>

<playcode-embed project="ianberdin" aspect-ratio="16/9"></playcode-embed>

From a CDN, no build step

<script src="https://unpkg.com/@playcode/embed"></script>

<!-- Auto-embedded on load: -->
<div data-playcode="ianberdin" data-aspect-ratio="16/9"></div>

Programmatic API

import { playcodeEmbed } from '@playcode/embed'

playcodeEmbed('#preview', {
  project: 'ianberdin', // slug, numeric id, or uid from the Cloud project URL
  aspectRatio: '16/9',
  lazy: true,
  attribution: true,
})

Build a URL only (SSR / frameworks)

import { buildEmbedUrl } from '@playcode/embed'

buildEmbedUrl({ project: 'ianberdin' })
// "https://ianberdin.playcode.ai"

buildEmbedUrl({ project: 'ianberdin', port: 5432 })
// "https://5432--ianberdin.playcode.ai"  (non-default Cloud port)

buildEmbedUrl({ url: 'https://app.acme.com', params: { theme: 'dark' } })
// "https://app.acme.com/?theme=dark"  (custom domain)

Embeddability

| Project type | URL | Embeddable cross-origin? | |---|---|---| | Cloud (full-stack app) | https://{slug}.playcode.ai | Yes (default) | | Browser (client-only) | https://{slug}.playcode.site | Yes - pass host: "playcode.site" | | Custom domain | your domain | Depends on the app's own headers |

If your own app sets X-Frame-Options or a CSP frame-ancestors directive, those win - the embed will be blocked regardless of this library.

Options

| Option | Type | Default | Description | |---|---|---|---| | project | string | - | Project slug, numeric id, or uid (e.g. "my-app" or "1374"). | | url | string | - | Full URL to embed (custom domains, hand-built preview URLs). Overrides project. | | host | string | "playcode.ai" | Host serving the project. Cloud (playcode.ai) and browser (playcode.site) are both frameable. | | port | number | - | Expose a non-default Cloud port ({port}--{slug}.{host}). | | aspectRatio | string | "16/10" | Responsive CSS aspect ratio, e.g. "16/9". | | height | string | - | Fixed CSS height. Overrides aspectRatio. | | lazy | boolean | true | Load the iframe when it scrolls into view. | | attribution | boolean | true | Show a "Built with Playcode" link below the frame. | | title | string | "Playcode project" | Accessible iframe title. | | params | Record<string,string> | - | Extra query params appended to the embed URL. | | allow | string | sensible default | iframe permissions-policy allow attribute. | | sandbox | string \| null | sensible default | iframe sandbox; pass null to omit. |

Web-component attributes are the kebab-case equivalents (aspect-ratio, data-playcode, ...).

Exports

  • @playcode/embed - buildEmbedUrl, playcodeEmbed, autoEmbed.
  • @playcode/embed/web-component - definePlaycodeEmbed, PlaycodeEmbedElement.
  • @playcode/embed/auto - everything, plus auto-registration on load (the CDN build).

Ships ESM, CommonJS, TypeScript types, and a minified IIFE for <script> tags.

Links

License

MIT (c) Playcode