create-zuplo-api 6.70.57 → 6.70.59
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.
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { RuntimeExtensions } from "@zuplo/runtime";
|
|
2
|
+
import { McpGatewayPlugin } from "@zuplo/runtime/mcp-gateway";
|
|
3
|
+
|
|
4
|
+
// To enable the optional examples below, install the relevant package(s) and
|
|
5
|
+
// uncomment the matching import:
|
|
6
|
+
// import { OpenTelemetryPlugin } from "@zuplo/otel";
|
|
7
|
+
// import { DataDogLoggingPlugin, environment } from "@zuplo/runtime";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* `runtimeInit` runs once when your gateway boots. Use it to register plugins
|
|
11
|
+
* and lifecycle hooks. Docs:
|
|
12
|
+
* https://zuplo.com/docs/programmable-api/runtime-extensions
|
|
13
|
+
*/
|
|
14
|
+
export function runtimeInit(runtime: RuntimeExtensions) {
|
|
15
|
+
// --- MCP Gateway ---------------------------------------------------------
|
|
16
|
+
// Registers the MCP Gateway, which adds the OAuth and upstream-connection
|
|
17
|
+
// routes used to expose and secure MCP servers through your gateway. It is a
|
|
18
|
+
// no-op until you add an MCP route/policy, so it is safe to leave enabled.
|
|
19
|
+
// Docs: https://zuplo.com/docs/mcp-server/introduction
|
|
20
|
+
//
|
|
21
|
+
// Remove this plugin if you are not using the MCP Gateway features.
|
|
22
|
+
runtime.addPlugin(
|
|
23
|
+
new McpGatewayPlugin({
|
|
24
|
+
// basePath: "/", // defaults to /__zuplo
|
|
25
|
+
})
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// --- OpenTelemetry tracing (optional) ------------------------------------
|
|
29
|
+
// Export traces and logs to any OpenTelemetry-compatible backend (Honeycomb,
|
|
30
|
+
// Grafana, Dynatrace, and others). Requires the `@zuplo/otel` package and the
|
|
31
|
+
// import above.
|
|
32
|
+
// Docs: https://zuplo.com/docs/articles/opentelemetry
|
|
33
|
+
//
|
|
34
|
+
// runtime.addPlugin(
|
|
35
|
+
// new OpenTelemetryPlugin({
|
|
36
|
+
// exporter: {
|
|
37
|
+
// url: "https://otel-collector.example.com/v1/traces",
|
|
38
|
+
// headers: { "api-key": environment.OTEL_API_KEY },
|
|
39
|
+
// },
|
|
40
|
+
// service: { name: "my-api", version: "1.0.0" },
|
|
41
|
+
// }),
|
|
42
|
+
// );
|
|
43
|
+
|
|
44
|
+
// --- Datadog logging (optional) ------------------------------------------
|
|
45
|
+
// Ship request logs to Datadog. Other log integrations (New Relic, Splunk,
|
|
46
|
+
// Loki, Dynatrace, and others) follow the same pattern — see the logging
|
|
47
|
+
// overview at https://zuplo.com/docs/articles/logging.
|
|
48
|
+
// Docs: https://zuplo.com/docs/articles/log-plugin-datadog
|
|
49
|
+
//
|
|
50
|
+
// runtime.addPlugin(
|
|
51
|
+
// new DataDogLoggingPlugin({
|
|
52
|
+
// apiKey: environment.DATADOG_API_KEY,
|
|
53
|
+
// source: "my-api",
|
|
54
|
+
// }),
|
|
55
|
+
// );
|
|
56
|
+
}
|