Signed AI image generation and auth tokens in File Uploader and the JavaScript SDKs
Signed AI image generation is a new project setting, next to Signed Uploads in the uploading settings. It’s on by default for every project, so AI Image Editor requests now need an auth token issued by your backend, even when uploads are unsigned. AI image requests accept tokens only, not signatures.
- File Uploader 1.35.1 supports
authToken, cached and refreshed before it expires. - AI Image Editor 0.2.6 supports
authToken. Inside File Uploader it uses the uploader’s token. @uploadcare/signed-uploads6.23.0 supportsgenerateAuthTokenfor minting tokens on your server, with a lifetime or expiry,scope,operations, andsubject/tokenIdfor thesub/jticlaims. Its/cliententry includesAuthTokenCache, which holds the token in the browser, refreshes it before it expires and shares one fetch across uploads that start together.- Upload Client 6.23.0 supports
authToken: a token, a function that returns one, or anAuthTokenCacheinstance. A function is called for each request and, onAccessTokenExpiredErrororOperationsLimitExceededError, once more to retry with a fresh token. When it throws or returns nothing, the upload rejects withAuthTokenResolverError, with the original error oncause. - Tokens can be scoped to the AI image endpoints, where each generation or edit spends one operation. See the scope table.
See Signed uploads for setup and the AI Image Editor guide for the editor.