
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI can see the issue! When you use client.assets.upload(), you're creating an asset document in Sanity, but that asset isn't automatically connected to any of your content documents - it's just sitting in your asset library. This is why you're getting a CDN link back but not seeing it appear in your Studio's main content views.
The asset upload method creates standalone asset documents in your Content Lake. These assets exist, but they're not referenced by any of your content documents, so they won't show up in your regular document views in Studio.
Option 1: Create a Document that References the Asset
After uploading the asset, create or update a document that references it:
try {
const asset = await client.assets.upload("image", thumbnailBuffer, {
contentType: metaData.contentType,
filename: 'your-filename.jpg' // Adding filename helps with identification
});
logger.log("Returned asset", asset);
// Now create a document that uses this asset
await client.create({
_type: 'yourDocumentType',
title: 'Firebase uploaded image',
image: {
_type: 'image',
asset: {
_type: 'reference',
_ref: asset._id
}
}
});
logger.log("Document created with image reference!");
} catch (error) {
logger.error(error);
}Option 2: View Assets Directly
If you want to see all uploaded assets (even orphaned ones), you can:
*[_type == "sanity.imageAsset"] to see all image assetsOption 3: Update an Existing Document
If you want to attach the uploaded image to an existing document:
const asset = await client.assets.upload("image", thumbnailBuffer, {
contentType: metaData.contentType
});
await client.patch('document-id-here')
.set({
image: {
_type: 'image',
asset: {
_type: 'reference',
_ref: asset._id
}
}
})
.commit();filename option to your upload to make assets easier to identifysource metadata to track that these came from FirebaseThe key takeaway: assets are separate entities from your content documents. You need to create that connection explicitly for them to show up in your Studio's document views.
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