@bionicjs/better-auth 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 bionicjs contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # @bionicjs/better-auth
2
+
3
+ [Better Auth](https://better-auth.com) integration plugin for BionicJS.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ npm i @bionicjs/better-auth
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ // bionicjs.config.ts
15
+ import { defineConfig } from "@bionicjs/core";
16
+ import { betterAuth } from "@bionicjs/better-auth";
17
+
18
+ export default defineConfig({
19
+ auth: betterAuth({
20
+ emailAndPassword: { enabled: true },
21
+ // socialProviders: { github: { clientId: "", clientSecret: "" } },
22
+ }),
23
+ });
24
+ ```
25
+
26
+ Compose under the `auth` key. At runtime the wired client is generated into
27
+ `@bionicjs/core/server` and available as `auth`:
28
+
29
+ ```ts
30
+ import { auth } from "@bionicjs/core/server";
31
+ const session = await auth.getSession();
32
+ ```
33
+
34
+ ## Options
35
+
36
+ - `emailAndPassword.enabled` — enable email + password sign-in
37
+ - `socialProviders` — `{ [provider]: { clientId, clientSecret } }`
@@ -0,0 +1,15 @@
1
+ import * as _bionicjs_core from '@bionicjs/core';
2
+
3
+ interface BetterAuthConfig {
4
+ emailAndPassword?: {
5
+ enabled: boolean;
6
+ };
7
+ socialProviders?: Record<string, {
8
+ clientId: string;
9
+ clientSecret: string;
10
+ }>;
11
+ [key: string]: any;
12
+ }
13
+ declare function betterAuth(options: BetterAuthConfig): _bionicjs_core.BionicJSPlugin<string, any>;
14
+
15
+ export { type BetterAuthConfig, betterAuth };
package/dist/index.js ADDED
@@ -0,0 +1,16 @@
1
+ // src/index.ts
2
+ import { createAuthPlugin } from "@bionicjs/core";
3
+ function betterAuth(options) {
4
+ return createAuthPlugin({
5
+ name: "better-auth",
6
+ options,
7
+ path: "/api/auth/[...auth]",
8
+ generateExports: () => `export const auth = {
9
+ getSession: async () => null,
10
+ requireAuth: async () => null,
11
+ };`
12
+ });
13
+ }
14
+ export {
15
+ betterAuth
16
+ };
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@bionicjs/better-auth",
3
+ "version": "0.1.0",
4
+ "description": "Better Auth authentication plugin for BionicJS",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "license": "MIT",
8
+ "keywords": [
9
+ "bionicjs",
10
+ "plugin",
11
+ "auth"
12
+ ],
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/bionicjs/bionicjs.git",
16
+ "directory": "packages/bionicjs-better-auth"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/bionicjs/bionicjs/issues"
20
+ },
21
+ "homepage": "https://github.com/bionicjs/bionicjs#readme",
22
+ "engines": {
23
+ "node": ">=20"
24
+ },
25
+ "dependencies": {
26
+ "@bionicjs/core": "0.1.0"
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js",
32
+ "default": "./dist/index.js"
33
+ }
34
+ },
35
+ "types": "./dist/index.d.ts",
36
+ "files": [
37
+ "dist",
38
+ "README.md"
39
+ ],
40
+ "devDependencies": {
41
+ "tsup": "^8.5.1",
42
+ "typescript": "^5.9.3",
43
+ "@types/node": "^22"
44
+ },
45
+ "scripts": {
46
+ "build": "tsup src/index.ts --format esm --target node20 --dts",
47
+ "typecheck": "tsc --noEmit"
48
+ }
49
+ }