@starklabs/backend-core 1.1.0 → 1.1.1

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 CHANGED
@@ -23,7 +23,7 @@ npm install @starklabs/backend-core
23
23
  The following environment variables are required:
24
24
 
25
25
  ```env
26
- MONGO_URI=mongodb://localhost:27017
26
+ MONGODB_URI=mongodb://localhost:27017
27
27
  DB_NAME=your_database_name
28
28
  MASTER_KEY=your_base64_encoded_32_byte_key
29
29
  JWT_SECRET=your_jwt_secret_string
@@ -62,7 +62,7 @@ import starkAuth, { crypto, AppError, AppLog, asyncHandler } from '@starklabs/ba
62
62
 
63
63
  // Initialize
64
64
  const auth = await starkAuth.create({
65
- MONGO_URI: process.env.MONGO_URI,
65
+ MONGODB_URI: process.env.MONGODB_URI,
66
66
  DB_NAME: process.env.DB_NAME,
67
67
  MASTER_KEY: process.env.MASTER_KEY,
68
68
  JWT_SECRET: process.env.JWT_SECRET,
@@ -97,7 +97,7 @@ const starkAuth = require('@starklabs/backend-core');
97
97
 
98
98
  // Initialize
99
99
  const auth = await starkAuth.create({
100
- MONGO_URI: process.env.MONGO_URI,
100
+ MONGODB_URI: process.env.MONGODB_URI,
101
101
  DB_NAME: process.env.DB_NAME,
102
102
  MASTER_KEY: process.env.MASTER_KEY,
103
103
  JWT_SECRET: process.env.JWT_SECRET,
@@ -118,7 +118,7 @@ const payload = auth.verifyJWT(token);
118
118
  Initializes database connection and returns a new StarkAuth instance.
119
119
 
120
120
  **Parameters:**
121
- - `config.MONGO_URI` (string): MongoDB connection URI
121
+ - `config.MONGODB_URI` (string): MongoDB connection URI
122
122
  - `config.DB_NAME` (string): Database name
123
123
  - `config.MASTER_KEY` (string): Base64-encoded 32-byte encryption key
124
124
  - `config.JWT_SECRET` (string): Secret for JWT signing
@@ -128,7 +128,7 @@ Initializes database connection and returns a new StarkAuth instance.
128
128
 
129
129
  ```javascript
130
130
  const auth = await starkAuth.create({
131
- MONGO_URI: 'mongodb://localhost:27017',
131
+ MONGODB_URI: 'mongodb://localhost:27017',
132
132
  DB_NAME: 'myapp',
133
133
  MASTER_KEY: 'eZkZDoy2s+DvGe44QGa7AdU41nKhglEaIjFsxfQCKao=',
134
134
  JWT_SECRET: 'your-secret-key',
@@ -335,7 +335,7 @@ let auth;
335
335
  app.use(async (req, res, next) => {
336
336
  if (!auth) {
337
337
  auth = await starkAuth.create({
338
- MONGO_URI: process.env.MONGO_URI,
338
+ MONGODB_URI: process.env.MONGODB_URI,
339
339
  DB_NAME: process.env.DB_NAME,
340
340
  MASTER_KEY: process.env.MASTER_KEY,
341
341
  JWT_SECRET: process.env.JWT_SECRET,
@@ -456,7 +456,7 @@ Ensure `JWT_EXPIRY` is one of the supported values: `"2m"`, `"10m"`, `"1h"`, `"6
456
456
  ### "Error while connecting!"
457
457
  Check that:
458
458
  - MongoDB is running and accessible
459
- - `MONGO_URI` is correct
459
+ - `MONGODB_URI` is correct
460
460
  - Network/firewall allows connection
461
461
 
462
462
  ### "Invalid or expired token"
@@ -14,7 +14,7 @@ class StarkAuth {
14
14
  }
15
15
 
16
16
  static async create(config) {
17
- await connectDB(config.MONGO_URI, config.DB_NAME);
17
+ await connectDB(config.MONGODB_URI, config.DB_NAME);
18
18
  return new StarkAuth(config);
19
19
  }
20
20
 
package/dist/js/index.js CHANGED
@@ -19,7 +19,7 @@ class StarkAuth {
19
19
 
20
20
  // create - initializes DB and auth instance
21
21
  static async create(config) {
22
- await connectDB(config.MONGO_URI, config.DB_NAME);
22
+ await connectDB(config.MONGODB_URI, config.DB_NAME);
23
23
  return new StarkAuth(config);
24
24
  }
25
25
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@starklabs/backend-core",
3
- "version": "1.1.0",
4
- "description": "A comprehensive backend authentication library featuring MongoDB integration, JWT-based authentication, encryption/decryption using libsodium, and utilities for error handling and logging. Supports both ES modules and CommonJS. Requires MONGO_URI, DB_NAME, MASTER_KEY, and JWT_SECRET environment variables.",
3
+ "version": "1.1.1",
4
+ "description": "A comprehensive backend authentication library featuring MongoDB integration, JWT-based authentication, encryption/decryption using libsodium, and utilities for error handling and logging. Supports both ES modules and CommonJS. Requires MONGODB_URI, DB_NAME, MASTER_KEY, and JWT_SECRET environment variables.",
5
5
  "keywords": [
6
6
  "auth-mongo",
7
7
  "backend-core"