UNPKG

@nekofar/warpcast

Version:

TypeScript client for interacting with Warpcast APIs

19 lines (17 loc) 375 B
// src/client/core/auth.ts var getAuthToken = async (auth, callback) => { const token = typeof callback === "function" ? await callback(auth) : callback; if (!token) { return; } if (auth.scheme === "bearer") { return `Bearer ${token}`; } if (auth.scheme === "basic") { return `Basic ${btoa(token)}`; } return token; }; export { getAuthToken };