
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThe short answer is that custom asset sources don't receive onChange or PatchEvent props - they work differently than custom input components.
According to the Asset Source API documentation, custom asset sources are designed specifically for selecting and uploading assets. They receive a different set of props focused on asset selection:
Asset source selection component props:
onSelect(Asset[]) - Called when assets are selected. The Studio automatically handles uploading the asset(s)onClose() - Called when the selection dialog is closedselectionType - Either 'single' or 'multiple'selectedAssets - Array of currently selected Sanity asset documentsassetType - Either 'file' or 'image'dialogHeaderTitle - Optional header componentCustom asset sources are scoped to asset selection only. They don't have access to the document's form context or onChange handlers because they operate at a different level - they're specifically for browsing and selecting assets from external sources, not for modifying document fields.
If you need to capture additional metadata (like a caption) when selecting an asset, you have a few options:
Use the asset's built-in metadata fields - Sanity assets support fields like title, description, source, originalFilename, and custom metadata that can be set on the asset document itself.
Custom input component instead - If you need to update multiple fields simultaneously, you should create a custom input component rather than a custom asset source. Custom input components do receive onChange and can use PatchEvent to update multiple fields, including using real-time safe patches with absolute paths.
Post-selection handling - Handle the additional data collection after the asset is selected, perhaps through document actions or a custom form component that wraps the image field.
The community thread you found mentioned looking at the OG Image creator plugin as a reference. While this plugin shows asset source patterns, it's also limited to the onSelect interface for returning assets.
If you need to modify other parts of the document when an asset is selected, you'll likely need to rethink your approach - either by using custom input components that have full form access, or by handling the additional data separately from the asset selection flow.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store