
Product
Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.
@templatical/media-library
Advanced tools
Media library for Templatical — composable, Vue components, and a standalone visual SDK.
Browse, upload, organize, crop, and replace media assets. Used by @templatical/editor's Cloud build, and available as a standalone SDK for any app that needs a media manager.
npm install @templatical/media-library
Peer deps: vue@^3.5, tailwindcss@^4.
Authentication. The media library connects to Templatical Cloud and authenticates against your backend. Your server exposes a token endpoint (returning a short-lived JWT for the current user/project), and you pass that endpoint URL as
auth.url. See the authentication guide for the full setup.
import { init } from '@templatical/media-library';
import '@templatical/media-library/style.css';
const media = await init({
container: '#media',
auth: {
url: 'https://your-app.com/api/templatical/token',
},
onSelect(item) {
console.log('Picked:', item.url);
},
});
// Later
media.unmount();
Use MediaLibraryModal inside a Vue 3 app. See docs for the full prop reference.
import { MediaLibraryModal } from '@templatical/media-library';
import '@templatical/media-library/style.css';
import { AuthManager } from '@templatical/core/cloud';
import { useMediaLibrary } from '@templatical/media-library';
const authManager = new AuthManager({
url: 'https://your-app.com/api/templatical/token',
});
await authManager.initialize();
const lib = useMediaLibrary({
projectId: authManager.projectId,
authManager,
});
import { AuthManager } from '@templatical/core/cloud';
import { MediaApiClient } from '@templatical/media-library';
const api = new MediaApiClient(authManager);
const response = await api.browseMedia({ folder_id: null });
init(), unmount()MediaLibraryModal + 12 sub-components (grid, upload zone, folder tree, preview panel, edit/replace/import modals)useMediaLibrary, useMediaCategories, useMediaPicker, useI18nMediaApiClientMediaItem, MediaFolder, MediaCategory, MediaConversion, MediaBrowseParams/Response, MediaUsageInfo/Response, MediaConfig, etc.When the editor mounts in its default shadow-DOM mode (shadowDom: true), the media library invocation teleports into the editor's shadow-aware popover root rather than document.body. The MediaLibraryModal accepts an optional popoverTarget?: HTMLElement | null prop and provides it to its three nested sub-modals (replace, edit, import-url) so the entire media UI lives inside the editor's shadow root. Standalone-SDK consumers (init({ container })) keep the previous body-level mount.
If you embed MediaLibraryModal manually inside another shadow-DOM-mounted UI, pass popoverTarget to keep its sub-modals scoped to your shadow root.
Full reference at docs.templatical.com.
FSL-1.1-MIT — free for any non-competing commercial use, automatically converts to MIT after 2 years per release.
FAQs
Media library management for Templatical email editor
We found that @templatical/media-library demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.

Research
More than 140 Mastra npm packages were compromised in a supply chain attack that used a typosquatted dependency to deliver a cross-platform infostealer during installation.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.