@domino-sdk/relay 0.9.1 → 0.10.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.
package/dist/index.js CHANGED
@@ -51,7 +51,7 @@ import {
51
51
  walletChallengeSchema,
52
52
  walletConnectionSchema,
53
53
  walletProofSchema
54
- } from "./chunk-Y6H4HDQT.js";
54
+ } from "./chunk-ATLYA27Y.js";
55
55
  import {
56
56
  defineLeaderboard,
57
57
  defineReferral,
@@ -1,13 +1,17 @@
1
1
  /**
2
2
  * Server-only proxy: browser cookies stay on the participant origin.
3
- * Point upstream at a participant deployment with trusted server scope configured.
4
- * Browser Authorization and organization/project/environment selectors are discarded.
5
- * Set hosted: true for the shared API to resolve a registered preview/staging origin.
6
- * This does not provide backend identity exchange.
3
+ * The shared API resolves the app's origin to its registered preview or staging
4
+ * project. Browser Authorization and organization/project/environment
5
+ * selectors are discarded. This does not provide backend identity exchange.
7
6
  */
8
7
  declare function proxyParticipant(request: Request, upstream: {
9
8
  baseUrl: string;
10
9
  fetch: typeof fetch;
10
+ /**
11
+ * Send the app origin for the API to resolve. Defaults to true; the API
12
+ * refuses participant requests that no registered app addresses. Only an
13
+ * upstream that already applies a project scope passes false.
14
+ */
11
15
  hosted?: boolean;
12
16
  }): Promise<Response>;
13
17
  /** Use only in an app server route. authenticate must verify the app's own session. */
@@ -35,7 +35,8 @@ async function proxyParticipant(request, upstream) {
35
35
  const value = request.headers.get(name);
36
36
  if (value) headers.set(name, value);
37
37
  }
38
- if (upstream.hosted) headers.set("X-Relay-App-Origin", incoming.origin);
38
+ if (upstream.hosted ?? true)
39
+ headers.set("X-Relay-App-Origin", incoming.origin);
39
40
  const send = upstream.fetch;
40
41
  const response = await send(target, {
41
42
  method: request.method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domino-sdk/relay",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {