Files
accountkit/test/client-declaration.test.js
T
CatoandClaude 25a3471087 fix(client): Lightning's client plugin no longer breaks createAuthClient (#78)
0.26.0's lightningClient() named better-auth's own fetch type, which went into
the published declaration. In BiasLens, whose better-auth resolved another
@better-fetch/fetch, authClientPlugins() was no longer assignable to
createAuthClient's plugins and the typecheck failed. The plugin types its one
call by shape; a test keeps better-fetch names out of the declaration and a
type test compiles a product's own wiring.


Claude-Session: https://claude.ai/code/session_019MDtmuJhiHPASaR5k8raL9

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-03 00:08:31 +01:00

16 lines
653 B
JavaScript

import { test } from "node:test";
import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
// 0.26.0 wrote better-auth's own BetterFetch type into this declaration. A
// product whose better-auth resolved another @better-fetch/fetch then could
// not pass authClientPlugins() to createAuthClient (BiasLens's typecheck
// failed). The published types name no better-fetch internals.
test("the client declaration names no better-fetch type", () => {
const declaration = readFileSync(
new URL("../dist/auth/client.d.ts", import.meta.url),
"utf8",
);
assert.doesNotMatch(declaration, /BetterFetch|@better-fetch/);
});