@zpg6-test-pkgs/better-auth
Version:
The most comprehensive authentication library for TypeScript.
41 lines (38 loc) • 1.09 kB
JavaScript
import { g as getClientConfig, c as createDynamicPathProxy } from '../../shared/better-auth.CGGao4aY.mjs';
import { c as capitalizeFirstLetter } from '../../shared/better-auth.D-2CmEwz.mjs';
import '@better-fetch/fetch';
import '../../shared/better-auth.CuS_eDdK.mjs';
import '../../shared/better-auth.CMQ3rA-I.mjs';
import '../../shared/better-auth.DdzSJf-n.mjs';
import 'nanostores';
import '../../shared/better-auth.Buni1mmI.mjs';
import '../../shared/better-auth.ffWeg50w.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 };