Key type: use your workspace public key here. This code ships to the browser, where
anyone can read the key, so it must be one that can only upload — which is exactly what the
public key is. Copy it from API Keys in the dashboard; it is always visible there.A private key would also upload, but never put one in client-side code: it can read, rename,
and delete everything in your workspace. See Create an API key.
@autorender/js SDK is the core package: an Upload SDK for browser file uploads and a ViewTag SDK for building transformation and responsive-image URLs. Every framework adapter (React, Vue, Angular, Svelte) builds on it.
Prerequisites
- An Autorender account with a workspace ID — create one in the dashboard
Guide
1
Install the package.
2
Initialize the client.
3
Generate your first URL.
w_400,h_400), crops to fill (c_fill), and applies f_auto,q_auto defaults.Examples
Transform string only
Video URLs
Upload widget
The widget runs in the browser, so read the API key from an environment variable rather than hardcoding it.API reference
createAR(config: CreateARConfig): ARInstance
Creates an Autorender client instance for image transformations.
Config options:
baseUrl?: string— base URL (default'https://assets.autorender.io')workspace: string— your workspace IDdefaults?: { f?: string, q?: string | number }— default transformationsdeviceBreakpoints?: number[]— device breakpoints for responsive imagesimageBreakpoints?: number[]— image breakpoints for responsive images
Next steps
Image transformations
Every parameter
AR.url() accepts.Direct upload API
The upload endpoint behind the widget.
Video transformations
Build resize, trim, and thumbnail URLs for video.
All SDKs
Framework adapters built on this package.