@autorender/vue SDK provides Vue 3 components — <ARImage> and <ARVideo> — that render optimized media from an Autorender delivery URL, a useAutoRenderProvider composable for workspace config, and an uploader for browser uploads.
Prerequisites
- An Autorender account with a workspace ID — create one in the dashboard
- Vue 3.0 or later, with Vite
^4/^5/^6/^7
Guide
1
Install the package.
<ARVideo> (Video.js / HLS / DASH), add the autorenderVue() Vite plugin to your vite.config.ts:vite.config.ts
<ARVideo>, skip the video CJS shims with videoShims: false:vite.config.ts
2
Set up the provider.
App.vue
3
Render your first image.
ProductImage.vue
<img> resized to 400×400 px, cropped to fill, with a responsive srcset and lazy loading.Examples
Complete transform example
HeroImage.vue
Video component
ProductVideo.vue
Upload widget
The uploader runs in the browser, so pass the API key fromimport.meta.env. Never hardcode the key.
Uploader.vue
API reference
autorenderVue(options?)
Vite plugin for @autorender/vue. Import from @autorender/vue/vite.
Options:
videoShims?: boolean— CJS interop shims for Video.js sub-modules (defaulttrue). Setfalseif you don’t use<ARVideo>.
<ARImage />
Vue component that wraps <img> with Autorender transformations.
Props:
src: string— image source path (required)width?: number— image width in pixelsheight?: number— image height in pixelsalt?: string— alt texttransformations?: TransformOptions— transformation optionsresponsive?: boolean— responsive images (defaulttrue)lazy?: boolean— lazy loading (defaulttrue)sizes?: string—sizesattribute for responsive images
<ARVideo />
Vue component that renders a Video.js player with Autorender transformations. Requires the autorenderVue() Vite plugin.
Props: src, width, height, controls, preload, transformations
Next steps
Image transformations
Every parameter you can pass to
transformations.Direct upload API
The upload endpoint behind the widget.
Video transformations
Resize, trim, and thumbnail video for
<ARVideo>.All SDKs
Front-end and backend SDKs for every stack.