@fiberplane/hono-otel
Version:
Hono middleware to forward OpenTelemetry traces to a local instance of @fiberplane/studio
21 lines (20 loc) • 1.07 kB
TypeScript
export type FpHonoEnv = Record<string, string | null> | null | undefined;
/**
* In Hono-node environments, env vars are not available on the `env` object that's passed to `app.fetch`.
* This helper will also check process.env and Deno.env.toObject() and fallback to that if the env var is not present on the `env` object.
*
* If multiple keys are provided, the first key that exists will be returned.
*/
export declare function getFromEnv(honoEnv: unknown, key: string | string[]): string | null;
/**
* Return `process.env` if we're in Node.js, `Deno.env.toObject()` if we're in Deno, otherwise `honoEnv`
*
* In the case of Deno, we merge the `Deno.env.toObject()` with the `honoEnv` object.
*
* Used to get the env object for accessing and recording env vars.
* This exists because environment variables are accessed differently across runtimes.
*
* @param honoEnv - The env object from the `app.fetch` method.
* @returns - Environment variables from the appropriate runtime source
*/
export declare function getPlatformSafeEnv(honoEnv: unknown): unknown;