The pipeline you were about to build.
01
Start with a photo upload
At some point your app needs a photo upload. A user picks a photo from their camera roll and you show it in their profile.
runQueuerunPipeline
import { TransformKit } from '@transform-kit/sdk';const tk = new TransformKit({ apiKey: process.env.API_KEY! });
export async function onProfilePhotoUpload(formData: FormData) {
const file = formData.get('photo') as File;
const bytes = Buffer.from(await file.arrayBuffer());
const [result] = await tk.runQueue(
[{ bytes, filename: file.name }],
'image',
);
return result.outputs[0]!.media.url;
}