@stratum-hq/hono 1.3.1 → 1.3.2
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 +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,10 +18,17 @@ Read the tenant from a claim of a verified JWT:
|
|
|
18
18
|
import { Hono } from "hono";
|
|
19
19
|
import { jwt } from "hono/jwt";
|
|
20
20
|
import { stratumMiddleware } from "@stratum-hq/hono";
|
|
21
|
-
import { getTenantContext } from "@stratum-hq/sdk";
|
|
21
|
+
import { StratumClient, getTenantContext } from "@stratum-hq/sdk";
|
|
22
22
|
|
|
23
23
|
const app = new Hono();
|
|
24
24
|
|
|
25
|
+
// A client for the control plane, used by `resolve` below. A `read` key is
|
|
26
|
+
// enough to resolve tenant contexts.
|
|
27
|
+
const sdkClient = new StratumClient({
|
|
28
|
+
controlPlaneUrl: process.env.STRATUM_URL ?? "http://localhost:3001",
|
|
29
|
+
apiKey: process.env.STRATUM_API_KEY!,
|
|
30
|
+
});
|
|
31
|
+
|
|
25
32
|
const jwtSecret = process.env.JWT_SECRET;
|
|
26
33
|
if (!jwtSecret) {
|
|
27
34
|
throw new Error("JWT_SECRET is required to verify bearer tokens.");
|