useImageUpload
The useImageUpload hook provides image upload functionality, handling the complete upload pipeline. It returns basic image metadata (ID, URL, resource URL) with uploads automatically attached to the current user. This hook is the foundation for direct image storage scenarios like profile pictures, attachments, or cases where you manage image relationships and metadata yourself. For user-generated content requiring visibility controls, sharing capabilities, or content discovery features, useCreateImageContent builds on this hook to provide those higher-level abstractions.
Anchor to useImageUploaduse Image Upload()
use Image Upload()
UseImageUploadReturnsUseImageUploadReturns
UseImageUploadReturns
- uploadImage
Upload an image which will be attached to the current user.
(image: File) => Promise<UploadedImage[]>
UploadedImage
- id
The ID of the uploaded image.
string - imageUrl
The URL of the uploaded image.
string - resourceUrl
The resource URL of the uploaded image.
string
Was this page helpful?