import { ScribaseClient } from 'scribase'; import { resolveScribaseAuth } from './auth.mjs'; /** Builds a `ScribaseClient` using the same token-resolution rule as `scribase` itself. */ export function scribaseClient(env = process.env) { const { apiUrl, token, source } = resolveScribaseAuth(env); const client = new ScribaseClient({ baseUrl: apiUrl, token }); return { client, apiUrl, tokenSource: source }; }