The video uses a specific AI coding tool to demonstrate the setup, but the configuration works 1:1 with Cursor, Claude Code, or any other tool. Despia is web framework and tooling agnostic, so the only thing that matters is passing the file’s HTTPS URL into the SDK call and serving the file with the right headers.
despia() and the runtime fetches the file, then opens the native share sheet with the bytes already attached. The user picks a destination (Messages, Mail, AirDrop, WhatsApp, Drive, Files, anything that registered a share extension) and the OS handles the rest. Works for any file type the OS recognizes, including PDFs, images, video, audio, archives, and Office formats.
Installation
- Bundle
- CDN
How it works
Pass the file URL directly intodespia(). There is no scheme prefix, the runtime detects an HTTPS URL and routes it through the share-sheet handler.
Server requirements
The endpoint serving the file has to send two response headers correctly. The OS uses these to decide how to render the preview, what filename to suggest, and which apps to show as share targets.Share a file from a button
The natural pattern is a “Share” button next to a file or piece of content. Tap, share sheet opens, user picks a destination, done.File types
Any file type the OS recognizes will share. The OS infers behavior from theContent-Type header, so as long as that is correct, the right share targets show up automatically.
For unusual types, set
Content-Type to application/octet-stream as a fallback. The share sheet still works, the user just gets a generic file icon and a smaller set of compatible destinations.
Resources
NPM Package
despia-native