katanakit-js / useGetChannelVideos
Function: useGetChannelVideos()
ts
function useGetChannelVideos(params?): Promise<FetchResult<{
nextPageToken?: string;
prevPageToken?: string;
totalResults?: number;
videos: {
channelTitle?: string;
description: string;
durationSeconds?: number;
embedUrl: string;
id: string;
publishedAt: string;
thumbnail: string;
thumbnails: {
default: string;
high: string;
medium: string;
};
title: string;
url: string;
viewCount?: number;
}[];
}>>;Defined in: src/core/services/youtube.service.ts:244
Lists channel videos via the quota-cheap path (channels → playlistItems, never search.list which costs 100 units). Call server/build-time and cache the response (1h) to share quota across every repo using the same GCP project.
Parameters
| Parameter | Type | Description |
|---|---|---|
params | { channelId?: string; maxResults?: number; pageToken?: string; playlistId?: string; } | Channel/playlist, page size (1–50) and page token. |
params.channelId? | string | Channel id (defaults to the one from useInitYoutube). |
params.maxResults? | number | Items per page (1–50, defaults to 12). |
params.pageToken? | string | Opaque page token from a previous response. |
params.playlistId? | string | Skip the channels lookup when the uploads playlist id is known. |
Returns
Promise<FetchResult<{ nextPageToken?: string; prevPageToken?: string; totalResults?: number; videos: { channelTitle?: string; description: string; durationSeconds?: number; embedUrl: string; id: string; publishedAt: string; thumbnail: string; thumbnails: { default: string; high: string; medium: string; }; title: string; url: string; viewCount?: number; }[]; }>>
Safe Result with normalized videos + pagination.