API reference › @evolu/common › local‑first/Owner › RelayUrl
type RelayUrl = string &
import("../Brand.ts").Brand<"Url"> &
import("../Brand.ts").Brand<"WebSocketUrl"> &
import("../Brand.ts").Brand<"RelayUrl">;
Defined in: packages/common/src/local-first/Owner.ts:583
WebSocketUrl of a relay, which has no query, such as
wss://free.evoluhq.com/.
createOwnerWebSocketTransport adds the OwnerId as the query. A relay that admits a connection by a credential beyond the OwnerId, such as a token that a reverse proxy checks, takes it in the path. Like WebSocketUrl, RelayUrl does not normalize; use RelayUrlFromString to convert other spellings, such as user input.
Example
import { assertErr, assertOk, RelayUrl } from "@evolu/common";
assertOk(
RelayUrl.fromUnknown("wss://free.evoluhq.com/"),
"wss://free.evoluhq.com/",
);
assertErr(RelayUrl.fromUnknown("wss://free.evoluhq.com/?token=1"), {
type: "RelayUrl",
value: "wss://free.evoluhq.com/?token=1",
});