Upload state machine and transport adapters for Tchomb video uploads.
npm install @tchomb/uploadimport { createUploader } from '@tchomb/upload';
const uploader = createUploader({
baseUrl: 'https://api.tchomb.com',
getAuthHeaders: async () => ({
Authorization: `Bearer ${token}`,
}),
});
const result = await uploader.upload(fileUri, {
caption: 'Ma nouvelle vidéo',
hashtags: ['cameroun', 'musique'],
language: 'fr',
onProgress: (pct) => console.log(`${pct}%`),
});import { useUpload } from '@tchomb/upload';
function UploadScreen() {
const { state, progress, error, videoId, start } = useUpload(uploadFn);
return (
<Button onPress={() => start(fileUri, metadata)}>
{state === 'uploading' ? `${progress}%` : 'Publier'}
</Button>
);
}idle → uploading → done | error
| Package | Description |
|---|---|
| @tchomb/shared-types | Shared TypeScript types |
| @tchomb/ui | Design system |
| @tchomb/api-client | Typed HTTP client |
| @tchomb/upload | Upload state machine |
| @tchomb/player | Vertical video player |
MIT