Framework Components
React
Integrate PichaFlow into your React and Next.js applications.
The @pichaflow/react package provides a functional upload component.
Usage
import { PichaUpload } from '@pichaflow/react';
export default function MyPage() {
const handleSuccess = (res) => {
console.log('Upload complete:', res.id);
};
return (
<PichaUpload
apiKey="pk_live_..."
useSecure={true}
signatureUrl="/api/media/v1/upload/sign"
onSuccess={handleSuccess}
className="my-custom-dropzone"
/>
);
}
Props
| Prop | Type | Default | Description |
|---|---|---|---|
apiKey | string | Required | Your PichaFlow Public Key (pk_live_...). |
useSecure | boolean | false | Enable the HMAC-SHA256 handshake flow for secure browser uploads. |
signatureUrl | string | - | Your backend endpoint for signing the upload request (Required if useSecure is true). |
onSuccess | function | - | Callback for successful uploads. |
onError | function | - | Callback for failed uploads. |
onProgress | function | - | Callback for progress updates. |