Framework Components
Svelte
Integrate PichaFlow into your Svelte and SvelteKit applications with ease.
The @pichaflow/svelte package provides a reactive upload component built specifically for Svelte.
Usage
<script>
import { PichaUpload } from '@pichaflow/svelte';
function handleSuccess(event) {
const response = event.detail;
console.log('Upload successful:', response.url);
}
</script>
<PichaUpload
apiKey="sk_live_your_secret_key"
tags={['ecommerce', 'svelte']}
on:success={handleSuccess}
/>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
apiKey | string | Required | Your PichaFlow Secret Key. |
baseUrl | string | https://api.pichaflow.com | Optional API base URL. |
tags | string[] | [] | Tags to apply to the upload. |
Events
Svelte events are emitted using the dispatch system.
| Event | Payload | Description |
|---|---|---|
success | UploadResponse | Fired when upload completes successfully. |
error | any | Fired on network or server errors. |
progress | number | Fired during upload progress updates. |