feat(media-use): usage telemetry for HeyGen conversion (#2130)

This commit is contained in:
Miguel Ángel
2026-07-10 20:07:03 -04:00
committed by GitHub
parent b1f1c0571e
commit 521f2c9ba7
9 changed files with 639 additions and 10 deletions
@@ -69,6 +69,17 @@ export function heygenCredential() {
return null;
}
// → "oauth" | "api_key" | null. Same oauth-vs-api-key check heygenAuthHeaders()
// makes internally, exposed on its own so callers that only need to *tag* the
// auth path (telemetry) don't have to parse headers back apart. Never throws:
// no credential (or an expired one) is just `null`, same as a fresh resolve
// with nothing to tag.
export function heygenAuthMethod() {
const cred = heygenCredential();
if (!cred?.headers) return null;
return "Authorization" in cred.headers ? "oauth" : "api_key";
}
// → auth headers object, or throw with a fix hint.
export function heygenAuthHeaders() {
const cred = heygenCredential();