@zpg6-test-pkgs/better-auth
Version:
The most comprehensive authentication library for TypeScript.
34 lines (31 loc) • 779 B
JavaScript
import { g as getClientConfig, c as createDynamicPathProxy } from './better-auth.CGGao4aY.mjs';
import { c as capitalizeFirstLetter } from './better-auth.D-2CmEwz.mjs';
function createAuthClient(options) {
const {
pluginPathMethods,
pluginsActions,
pluginsAtoms,
$fetch,
atomListeners,
$store
} = getClientConfig(options);
let resolvedHooks = {};
for (const [key, value] of Object.entries(pluginsAtoms)) {
resolvedHooks[`use${capitalizeFirstLetter(key)}`] = value;
}
const routes = {
...pluginsActions,
...resolvedHooks,
$fetch,
$store
};
const proxy = createDynamicPathProxy(
routes,
$fetch,
pluginPathMethods,
pluginsAtoms,
atomListeners
);
return proxy;
}
export { createAuthClient as c };