@autorender/angular SDK provides standalone components — <ar-image> and <ar-video> — that render optimized media from an Autorender delivery URL, an injectable AutoRenderService for workspace config, and an uploader for browser uploads.
Prerequisites
- An Autorender account with a workspace ID — create one in the dashboard
- An Angular project using standalone components
Guide
1
Install the package.
2
Set up the service.
Provide
AutoRenderService and its config at your root component:app.component.ts
3
Render your first image.
product.component.ts
<img> resized to 400×400 px, cropped to fill, with a responsive srcset and lazy loading.Examples
Complete transform example
hero.component.ts
Video component
product-video.component.ts
Upload widget
The uploader runs in the browser, so read the API key from your Angularenvironment rather than hardcoding it.
upload.component.ts
API reference
bootstrapAutorenderUploader(target, options)
Mounts the uploader widget into a DOM element. Returns a UploaderInstance.
Params:
target: HTMLElement— container element to mount intooptions: CreateUploaderOptions— uploader configuration (same as the JavaScript SDK)
AUTORENDER_CONFIG
Angular InjectionToken<CreateARConfig>. Provide at root component level to configure the AR instance workspace and base URL.
AutoRenderService
Injectable service. Call initialize(config) once at app root, then getInstance() anywhere to access the ARInstance.
<ar-image> (ARImageComponent)
Inputs:
src: string— image source path (required)[width]?: number— image width in pixels[height]?: number— image height in pixels[transformations]?: TransformOptions— transformation options[responsive]?: boolean— responsive images (defaulttrue)[lazy]?: boolean— lazy loading (defaulttrue)sizes?: string—sizesattribute for responsive imagesalt?: string— alt text[ngClass]?: any— Angular class binding[ngStyle]?: any— Angular style binding
<ar-video> (ARVideoComponent)
Video.js-based player. Inputs: 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
<ar-video>.All SDKs
Front-end and backend SDKs for every stack.