@bionicjs/firebase 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,40 @@
1
+ # @bionicjs/firebase
2
+
3
+ [Firebase Authentication](https://firebase.google.com/docs/auth) integration
4
+ plugin for BionicJS.
5
+
6
+ ## Install
7
+
8
+ ```sh
9
+ npm i @bionicjs/firebase
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ ```ts
15
+ // bionicjs.config.ts
16
+ import { defineConfig } from "@bionicjs/core";
17
+ import { firebase } from "@bionicjs/firebase";
18
+
19
+ export default defineConfig({
20
+ auth: firebase({
21
+ projectId: process.env.FIREBASE_PROJECT_ID!,
22
+ clientEmail: process.env.FIREBASE_CLIENT_EMAIL!,
23
+ privateKey: process.env.FIREBASE_PRIVATE_KEY!,
24
+ }),
25
+ });
26
+ ```
27
+
28
+ Compose under the `auth` key. At runtime the wired client is generated into
29
+ `@bionicjs/core/server` and available as `auth`:
30
+
31
+ ```ts
32
+ import { auth } from "@bionicjs/core/server";
33
+ const session = await auth.getSession();
34
+ ```
35
+
36
+ ## Options
37
+
38
+ - `projectId` — Firebase project ID
39
+ - `clientEmail` — service account client email
40
+ - `privateKey` — service account private key
@@ -0,0 +1,10 @@
1
+ import * as _bionicjs_core from '@bionicjs/core';
2
+
3
+ interface FirebaseConfig {
4
+ projectId: string;
5
+ clientEmail: string;
6
+ privateKey: string;
7
+ }
8
+ declare function firebase(options: FirebaseConfig): _bionicjs_core.BionicJSPlugin<string, any>;
9
+
10
+ export { type FirebaseConfig, firebase };
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ // src/index.ts
2
+ import { createAuthPlugin } from "@bionicjs/core";
3
+ function firebase(options) {
4
+ return createAuthPlugin({
5
+ name: "firebase",
6
+ options,
7
+ generateExports: () => `export const auth = {
8
+ getSession: async () => null,
9
+ requireAuth: async () => null,
10
+ };`
11
+ });
12
+ }
13
+ export {
14
+ firebase
15
+ };
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@bionicjs/firebase",
3
+ "version": "0.1.0",
4
+ "description": "Firebase auth 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-firebase"
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
+ }