TypeScript API / contentia/storage/github-cdn / GithubCdnDataSourceOptions
Type Alias: GithubCdnDataSourceOptions
type GithubCdnDataSourceOptions = object;Read-only I/O against a public GitHub repository, served entirely from CDNs — no GitHub App, no OAuth, no API token, and no @octokit/* dependency.
- Content comes from jsDelivr's file CDN (
cdn.jsdelivr.net/gh). - Directory listings come from jsDelivr's metadata API (
data.jsdelivr.com), which returns the repo's full file tree as JSON.
The trade-off versus "contentia/storage-github".GithubDataSource is metadata: a CDN carries no git history, so commit timestamps are always epoch(0). See GithubCdnDataSourceOptions.fetchMeta for the sha/revision behavior.
Freshness note: CDN responses are cached (jsDelivr caches a ref for hours), so this is best suited to serving mostly-static public content, not live editing.
Properties
branch?
branch?: string;Branch, tag, or commit sha jsDelivr can resolve. Defaults to the repo's default branch.
cdnBaseUrl?
cdnBaseUrl?: string;Override the content CDN base. Default: https://cdn.jsdelivr.net/gh.
dataApiBaseUrl?
dataApiBaseUrl?: string;Override the metadata/tree API base. Default: https://data.jsdelivr.com/v1/packages/gh.
fetch?
fetch?: typeof fetch;Injectable fetch (tests, custom agents). Defaults to the global fetch.
fetchMeta?
fetchMeta?: boolean;Controls how much work GithubCdnDataSource.getFileMeta does to produce a revisionId (sha). Timestamps are epoch(0) either way — the CDN has no history.
false(default): no extra request. Theshais jsDelivr's content hash from the already-loaded file tree (empty string if the tree omits it).true: downloads the file to compute a canonical git blob sha, matching theshathat GithubCdnDataSource.getFileContents returns. Costs one fetch per metadata lookup.
owner
owner: string;repo
repo: string;userAgent?
userAgent?: string;User-Agent sent on all requests.