Tagging
Tags are key-value pairs that provide metadata about your uploaded data on Arweave. They enable discoverability, proper content serving, and integration with various protocols.
Essential Tags
Every upload should include these tags:
- Content-Type: Required - tells gateways how to serve your data
- App-Name: Best practice - identifies your application for discoverability
const result = await turbo.upload({
data: fileData,
dataItemOpts: {
tags: [
{ name: "Content-Type", value: "image/jpeg" },
{ name: "App-Name", value: "MyApp-v1.0" },
{ name: "Title", value: "My Image" },
],
},
});
Common Tag Types
Content Types
image/jpeg
,image/png
- Imagesapplication/json
- JSON datatext/html
- HTML pagesvideo/mp4
- Videosapplication/pdf
- Documents
App-Specific Tags
App-Name
- Your application identifier (e.g., "MyApp-v1.0", "PhotoGallery-2024")Title
- Human-readable titleDescription
- Content descriptionAuthor
- Content creatorVersion
- Application version
Protocol Tags
License
- Universal Data License (UDL) transaction IDLicense-Fee
- Fee for UDL licensing
UDL Integration: Learn about the Universal Data License for monetizing your data.
Advanced Tagging
Folder Uploads
const folderResult = await turbo.uploadFolder({
folderPath: "./my-website",
dataItemOpts: {
tags: [
{ name: "Bundle-Format", value: "binary" },
{ name: "Bundle-Version", value: "2.0.0" },
{ name: "App-Name", value: "MyWebsite-v2.1" },
{ name: "Version", value: "2.1.0" },
],
},
});
Licensed Content
const licensedTags = [
{ name: "Content-Type", value: "image/jpeg" },
{ name: "App-Name", value: "ArtGallery-v3.2" },
{ name: "Version", value: "3.2.1" },
{ name: "License", value: "udl-tx-id-here" },
{ name: "License-Fee", value: "1000000" }, // Fee in Winston
];
App-Name Best Practices
Naming Convention
Use descriptive, versioned App-Name values for better organization:
- Include version:
MyApp-v1.0
,PhotoGallery-2024
- Be specific:
EcommerceStore-v2.1
instead of justStore
- Use consistent format:
ProjectName-vMajor.Minor
- Include year for time-based apps:
YearlyReport-2024
Tag Limitations
- 4KB total for bundled data items (Turbo)
- 2KB total for direct L1 uploads
- No maximum number of tags (limited by total size)
- Tag names are case-sensitive
- No duplicate tag names allowed
Important: Total tag size is limited to 4KB (bundled) or 2KB (L1). For larger metadata, store it in the data payload instead.
Querying Data by Tags
Once you've tagged your data, you can use GraphQL to search and filter based on those tags. This enables powerful discovery and retrieval of your stored content.
Next Steps
Understanding Manifests
Organize files with manifests for better structure.
Data Encryption
Secure your sensitive data with encryption.
ArFS File System
Advanced file organization with ArFS.
How is this guide?