Skip to content
Download Beeper

Serve a file

client.assets.serve(AssetServeParams { url } query, RequestOptionsoptions?): Response
GET/v1/assets/serve

Stream a file given an mxc://, localmxc://, or file:// URL. Downloads first if not cached. Supports Range requests for seeking in large files.

ParametersExpand Collapse
query: AssetServeParams { url }
url: string

File URL to serve. Accepts mxc://, localmxc://, or file:// URLs.

minLength1
ReturnsExpand Collapse
unnamed_schema_1 = Response

Serve a file

import BeeperDesktop from '@beeper/desktop-api';

const client = new BeeperDesktop({
  accessToken: process.env['BEEPER_ACCESS_TOKEN'], // This is the default and can be omitted
});

const response = await client.assets.serve({ url: 'x' });

console.log(response);

const content = await response.blob();
console.log(content);
Returns Examples