Menu

Shopify App Audio API: Store S3 URLs, Not Base64
📰

Shopify App Audio API: Store S3 URLs, Not Base64

DEV Community: api·4 days ago
#XW71vdIO
#devtoapi#devto#dev#shopify#metafield
Reading 0:00
15s threshold

If you are building a Shopify app that handles user-generated audio—whether it's pitch notes, product demos, or customer reviews—stop trying to store base64 strings in metafields. You will hit the 100KB metafield value limit immediately, bloat your database, and create a nightmare for future migrations.

The correct architecture for any media-heavy Shopify app is simple: store the file in an external object store (AWS S3, GCS, or R2) and store the resulting URL in a Shopify metafield. This post explains how to implement this pattern using GraphQL Admin API, S3, and a secure upload flow.

The Problem: Why Base64 Fails

Developers often reach for base64 encoding because it feels "self-contained." You encode the audio file, pass it to the metafieldsSet mutation, and you're done.

This fails for three reasons:

Size Limits: Shopify metafields have a strict 100,000 character limit. A 10-second MP3 file at 128kbps is roughly 160KB in binary. Base64 encoding increases size by ~33%, pushing it to ~213KB.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.