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

PropTypeDefaultDescription
apiKeystringRequiredYour PichaFlow Public Key (pk_live_...).
useSecurebooleanfalseEnable the HMAC-SHA256 handshake flow for secure browser uploads.
signatureUrlstring-Your backend endpoint for signing the upload request (Required if useSecure is true).
onSuccessfunction-Callback for successful uploads.
onErrorfunction-Callback for failed uploads.
onProgressfunction-Callback for progress updates.