SDKs

Programmatic interaction with the PichaFlow API via our SDK.

The @pichaflow/sdk provides a programmatic way to interact with the PichaFlow API.

Initialization

import { PichaFlowClient } from '@pichaflow/sdk';

const client = new PichaFlowClient({
  apiKey: 'sk_live_your_secret_key',
  baseUrl: 'https://api.pichaflow.com' // Optional
});

Uploading Images

const file = // ... from a file input
const response = await client.upload(file, {
  tags: ['ecommerce', 'boots'],
  onProgress: (p) => console.log(`Upload progress: ${p}%`)
});

console.log('Asset ID:', response.id);

Delivery URLs

Generate optimized CDN URLs on the fly.

const url = client.getDeliveryUrl('path/to/image.jpg', {
  w: 800,
  q: 80,
  f: 'webp'
});