feat: everything

This commit is contained in:
2026-03-13 15:00:22 +00:00
commit bffd6f3262
44 changed files with 5149 additions and 0 deletions

19
src/auth/index.ts Normal file
View File

@@ -0,0 +1,19 @@
import type { X3Config } from "../types/index.js";
import { generateJWT } from "./jwt.js";
export async function getAuthHeaders(
config: X3Config,
): Promise<Record<string, string>> {
const headers: Record<string, string> = {
"Content-Type": "application/json",
};
if (config.mode === "authenticated") {
headers["Authorization"] = `Bearer ${await generateJWT(config)}`;
headers["x-xtrem-endpoint"] = config.endpoint ?? "";
}
return headers;
}
export { generateJWT } from "./jwt.js";