@bella-baxter/express 0.1.1-preview.14 → 0.1.1-preview.140
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 +68 -0
- package/package.json +13 -3
package/README.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @bella-baxter/express
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@bella-baxter/express)
|
|
4
|
+
[](LICENSE)
|
|
5
|
+
|
|
6
|
+
[Bella Baxter](https://github.com/Cosmic-Chimps/bella-baxter) middleware for Express.js — injects live-reloading secrets onto `req.bella`.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @bella-baxter/express express
|
|
12
|
+
# or
|
|
13
|
+
pnpm add @bella-baxter/express express
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import express from 'express';
|
|
20
|
+
import { createBellaMiddleware } from '@bella-baxter/express';
|
|
21
|
+
|
|
22
|
+
const app = express();
|
|
23
|
+
|
|
24
|
+
app.use(await createBellaMiddleware({
|
|
25
|
+
baxterUrl: process.env.BELLA_BAXTER_URL!,
|
|
26
|
+
apiKey: process.env.BELLA_BAXTER_API_KEY!,
|
|
27
|
+
projectSlug: 'my-app', // or BELLA_BAXTER_PROJECT env var
|
|
28
|
+
environmentSlug: 'production', // or BELLA_BAXTER_ENV env var
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
app.get('/health', (req, res) => {
|
|
32
|
+
const dbUrl = req.bella.getOrThrow('DATABASE_URL');
|
|
33
|
+
res.json({ ok: true });
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
app.listen(3000);
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## TypeScript — extend `req.bella`
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
// express.d.ts
|
|
43
|
+
import type { BellaConfig } from '@bella-baxter/express';
|
|
44
|
+
|
|
45
|
+
declare global {
|
|
46
|
+
namespace Express {
|
|
47
|
+
interface Request {
|
|
48
|
+
bella: BellaConfig;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Environment variables
|
|
55
|
+
|
|
56
|
+
| Variable | Description |
|
|
57
|
+
|----------|-------------|
|
|
58
|
+
| `BELLA_BAXTER_URL` | Base URL of the Bella Baxter API |
|
|
59
|
+
| `BELLA_BAXTER_API_KEY` | API key (`bax-...`) |
|
|
60
|
+
| `BELLA_BAXTER_PROJECT` | Project slug |
|
|
61
|
+
| `BELLA_BAXTER_ENV` | Environment slug |
|
|
62
|
+
| `BELLA_BAXTER_PRIVATE_KEY` | Private key for ZKE (optional) |
|
|
63
|
+
|
|
64
|
+
## Links
|
|
65
|
+
|
|
66
|
+
- [GitHub](https://github.com/Cosmic-Chimps/bella-baxter)
|
|
67
|
+
- [Issues](https://github.com/Cosmic-Chimps/bella-baxter/issues)
|
|
68
|
+
- [Core SDK](https://www.npmjs.com/package/@bella-baxter/sdk)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bella-baxter/express",
|
|
3
|
-
"version": "0.1.1-preview.
|
|
3
|
+
"version": "0.1.1-preview.140",
|
|
4
4
|
"description": "Bella Baxter Express.js middleware — injects live-reloading secrets onto req.bella",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -12,16 +12,17 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
+
"README.md",
|
|
15
16
|
"dist"
|
|
16
17
|
],
|
|
17
18
|
"dependencies": {
|
|
18
|
-
"@bella-baxter/sdk": "0.1.1-preview.
|
|
19
|
+
"@bella-baxter/sdk": "0.1.1-preview.140"
|
|
19
20
|
},
|
|
20
21
|
"peerDependencies": {
|
|
21
22
|
"express": ">=4"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
|
24
|
-
"typescript": "^
|
|
25
|
+
"typescript": "^6.0.2",
|
|
25
26
|
"@types/node": "^25.5.0",
|
|
26
27
|
"@types/express": "^5.0.6"
|
|
27
28
|
},
|
|
@@ -32,6 +33,15 @@
|
|
|
32
33
|
"middleware"
|
|
33
34
|
],
|
|
34
35
|
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "https://github.com/Cosmic-Chimps/bella-baxter-js.git",
|
|
39
|
+
"directory": "apps/sdk/js/packages/express"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/Cosmic-Chimps/bella-baxter-js/tree/main/packages/express#readme",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/Cosmic-Chimps/bella-baxter-js/issues"
|
|
44
|
+
},
|
|
35
45
|
"scripts": {
|
|
36
46
|
"build": "tsc",
|
|
37
47
|
"typecheck": "tsc --noEmit"
|