@edgedev/firebase 1.2.0 → 1.2.3
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/README.md +62 -5
- package/package.json +10 -8
package/README.md
CHANGED
|
@@ -16,23 +16,80 @@ pnpm install @edgedev/firebase
|
|
|
16
16
|
```bash
|
|
17
17
|
pnpm install @edgedev/firebase
|
|
18
18
|
```
|
|
19
|
-
|
|
19
|
+
### Installing with Nuxt 3 global composables
|
|
20
|
+
|
|
21
|
+
Add a file (whatever.ts) to your "composables" folder with this code:
|
|
20
22
|
|
|
21
23
|
```typescript
|
|
22
|
-
import
|
|
24
|
+
import { EdgeFirebase } from "@edgedev/firebase";
|
|
25
|
+
const config = {
|
|
26
|
+
apiKey: "your-apiKey",
|
|
27
|
+
authDomain: "your-authDomain",
|
|
28
|
+
projectId: "your-projectId",
|
|
29
|
+
storageBucket: "your-storageBucket",
|
|
30
|
+
messagingSenderId: "your-messagingSenderId",
|
|
31
|
+
appId: "your-appId"
|
|
32
|
+
};
|
|
33
|
+
const edgeFirebase = new EdgeFirebase(config);
|
|
23
34
|
export { edgeFirebase };
|
|
24
35
|
```
|
|
25
36
|
|
|
26
|
-
|
|
37
|
+
##### *Nuxt must be configured with SSR disabled, update the nuxt.config.ts file (if other parts of your project SSR, see Nuxt 3 plugin instuctions):
|
|
38
|
+
```javascript
|
|
39
|
+
export default defineNuxtConfig({ ssr: false });
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Installing as a plugin
|
|
43
|
+
|
|
44
|
+
#### Vue 3 plugin, main.js example:
|
|
45
|
+
```javascript
|
|
46
|
+
import { createApp } from "vue";
|
|
47
|
+
import App from "./App.vue";
|
|
48
|
+
|
|
49
|
+
//edgeFirebase Plugin
|
|
50
|
+
import eFb from "@edgedev/firebase";
|
|
51
|
+
app.use(eFb, {
|
|
52
|
+
apiKey: "your-apiKey",
|
|
53
|
+
authDomain: "your-authDomain",
|
|
54
|
+
projectId: "your-projectId",
|
|
55
|
+
storageBucket: "your-storageBucket",
|
|
56
|
+
messagingSenderId: "your-messagingSenderId",
|
|
57
|
+
appId: "your-appId"
|
|
58
|
+
})
|
|
59
|
+
//end edgeFirebase
|
|
60
|
+
|
|
61
|
+
app.mount("#app");
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Nuxt 3 example using the plugins folder:
|
|
65
|
+
Add a file (whatever.client.ts) to your "plugins" folder with the following code:
|
|
66
|
+
|
|
67
|
+
***-Note the ".client" in the file name. If the file doesn't have that in the name you must disabled SSR in the nuxt config.***
|
|
68
|
+
```javascript
|
|
69
|
+
import eFb from "@edgedev/firebase";
|
|
70
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
71
|
+
nuxtApp.vueApp.use(eFb, {
|
|
72
|
+
apiKey: "your-apiKey",
|
|
73
|
+
authDomain: "your-authDomain",
|
|
74
|
+
projectId: "your-projectId",
|
|
75
|
+
storageBucket: "your-storageBucket",
|
|
76
|
+
messagingSenderId: "your-messagingSenderId",
|
|
77
|
+
appId: "your-appId"
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
```
|
|
81
|
+
***-Alternatively you can disable SSR for your entire Nuxt project instead of naming the plugin with ".client", update the nuxt.config.ts file:***
|
|
82
|
+
|
|
27
83
|
```javascript
|
|
28
84
|
export default defineNuxtConfig({ ssr: false });
|
|
29
85
|
```
|
|
30
86
|
|
|
31
|
-
If not in Nuxt 3 or there is no need for it to be global, put this in your components <script setup>
|
|
32
87
|
|
|
88
|
+
#### After installing as a plugin you will need to include this in <script setup> in any component you want to use EdgeFirebase in:
|
|
33
89
|
```javascript
|
|
34
90
|
<script setup>
|
|
35
|
-
import
|
|
91
|
+
import { inject } from "vue";
|
|
92
|
+
const edgeFirebase = inject("edgeFirebase");
|
|
36
93
|
</script>
|
|
37
94
|
```
|
|
38
95
|
# Firebase Authentication
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgedev/firebase",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"description": "Vue 3 / Nuxt 3 Plugin or Nuxt 3 global composable for firebase authenication and firestore",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"author": "Seth Fischer",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"firebase",
|
|
9
|
+
"nuxt 3",
|
|
10
|
+
"vue 3"
|
|
11
|
+
],
|
|
7
12
|
"license": "ISC",
|
|
8
13
|
"publishConfig": {
|
|
9
14
|
"access": "public"
|
|
@@ -14,17 +19,14 @@
|
|
|
14
19
|
"@typescript-eslint/parser": "^5.40.0",
|
|
15
20
|
"eslint": "^8.25.0",
|
|
16
21
|
"eslint-config-prettier": "^8.5.0",
|
|
22
|
+
"firebase": "^9.12.1",
|
|
17
23
|
"prettier": "^2.7.1",
|
|
18
24
|
"typescript": "^4.8.4",
|
|
19
|
-
"
|
|
20
|
-
"vue": "^3.2.41",
|
|
21
|
-
"firebase": "^9.12.1"
|
|
25
|
+
"vue": "^3.2.41"
|
|
22
26
|
},
|
|
23
|
-
"dependencies": {},
|
|
24
27
|
"peerDependencies": {
|
|
25
28
|
"firebase": "^9.12.1",
|
|
26
|
-
"vue": "^3.0.0"
|
|
27
|
-
"vite": "^3.1.8"
|
|
29
|
+
"vue": "^3.0.0"
|
|
28
30
|
},
|
|
29
31
|
"scripts": {
|
|
30
32
|
"test": "echo \"Error: no test specified\" && exit 1"
|