Appearance
ExternalImageLibrary
Core class for integrating external image libraries with the Stripo Email Editor.
typescript
class ExternalImageLibraryDescription
ExternalImageLibrary enables integration of third-party image storage and management services (like Cloudinary, Unsplash, or custom DAM systems) into the Stripo Email Editor. This interface allows users to browse, search, and select images from external sources directly within the editor, streamlining the workflow for adding images to email templates.
Import
typescript
import { ExternalImageLibrary } from '@stripoinc/ui-editor-extensions';Methods
openImageLibrary()
Opens the external image library interface for image selection.
typescript
openImageLibrary(
currentImageUrl: string,
onImageSelectCallback: ExternalGalleryImageSelectCallback,
onCancelCallback: ExternalGalleryImageCancelCallback
): voidParameters
| Name | Type | Description |
|---|---|---|
| currentImageUrl | string | URL of the currently selected image (if any) |
| onImageSelectCallback | ExternalGalleryImageSelectCallback | Called when user selects an image |
| onCancelCallback | ExternalGalleryImageCancelCallback | Called when user cancels |
Type Definitions
Callback Types
typescript
type ExternalGalleryImageSelectCallback = (image: ExternalGalleryImage) => void;
type ExternalGalleryImageCancelCallback = () => void;ExternalGalleryImage
Represents an image from the external gallery.
typescript
interface ExternalGalleryImage {
originalName: string; // Original filename (e.g., 'product-photo.png')
width: number; // Width in pixels
height: number; // Height in pixels
sizeBytes: number; // File size in bytes
url: string; // Full URL to the image
altText: string; // Alt text for accessibility
labels?: Record<string, string>; // Optional metadata (v3.2.0+)
}