cloudfire-auth 0.1.0 → 0.2.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.
Files changed (2) hide show
  1. package/README.md +12 -11
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -19,17 +19,20 @@ npm install cloudfire-auth
19
19
  ## Quick Start
20
20
 
21
21
  ```typescript
22
- import { CloudFireAuth, ServiceAccountKey } from "cloudfire-auth";
22
+ import { CloudFireAuth } from "cloudfire-auth";
23
+
24
+ // It is best practice to store your service account key separately and
25
+ // load it from a secure source.
26
+ const serviceAccountKey = {
27
+ // Your Firebase service account key
28
+ private_key: "-----BEGIN PRIVATE KEY-----\n...",
29
+ client_email: "firebase-adminsdk-...@your-project.iam.gserviceaccount.com",
30
+ // ... other service account fields
31
+ };
23
32
 
24
33
  // Initialize with your Firebase project credentials
25
34
  const auth = new CloudFireAuth(
26
- "your-firebase-project-id",
27
- {
28
- // Your Firebase service account key
29
- private_key: "-----BEGIN PRIVATE KEY-----\n...",
30
- client_email: "firebase-adminsdk-...@your-project.iam.gserviceaccount.com",
31
- // ... other service account fields
32
- },
35
+ serviceAccountKey,
33
36
  env.YOUR_KV_NAMESPACE // Optional: KV namespace for token caching
34
37
  );
35
38
 
@@ -51,10 +54,9 @@ console.log("User email:", user.email);
51
54
  ### Constructor
52
55
 
53
56
  ```typescript
54
- new CloudFireAuth(projectId: string, serviceAccountKey: ServiceAccountKey, kvNamespace?: KVNamespace)
57
+ new CloudFireAuth(serviceAccountKey: ServiceAccountKey, kvNamespace?: KVNamespace)
55
58
  ```
56
59
 
57
- - `projectId`: Your Firebase project ID
58
60
  - `serviceAccountKey`: Firebase service account credentials
59
61
  - `kvNamespace`: Optional KV namespace for OAuth2 token caching
60
62
 
@@ -81,7 +83,6 @@ new CloudFireAuth(projectId: string, serviceAccountKey: ServiceAccountKey, kvNam
81
83
 
82
84
  Your Cloudflare Worker needs these environment variables:
83
85
 
84
- - `FIREBASE_PROJECT_ID`: Your Firebase project ID
85
86
  - `FIREBASE_SERVICE_ACCOUNT_KEY`: JSON string of your service account key
86
87
  - `AUTH_KV_NAMESPACE`: (Optional) KV namespace for token caching
87
88
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudfire-auth",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "author": "Connor Skelland",
5
5
  "license": "MIT",
6
6
  "engines": {