Skip to content

Commit e9b4478

Browse files
ldanilekConvex, Inc.
authored andcommitted
new system-udf to query process.env.CONVEX_CLOUD_URL (#34464)
create a new system-udf that's a query returning `process.env.CONVEX_CLOUD_URL`. this is currently redundant but will be used once we add canonical custom domains. It'll be used by the dashboard, which displays the canonical domain and lets you pick a new one. It will also be used by the CLI, which will set it to `VITE_CONVEX_URL` during deployment. Put it in a file in `_system/cli/` which indicates it has a higher standard of backwards-compatibility, but also re-export it from `_system/frontend/` to indicate it's used in the dashboard too. (for review to @jordanhunt22 for canonical urls and @atrakh for system udf placement and naming) GitOrigin-RevId: a7c278a18e941dac8a6ede9cdeb2936667606bec
1 parent e2d1930 commit e9b4478

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

npm-packages/system-udfs/convex/_generated/api.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type {
1313
FilterApi,
1414
FunctionReference,
1515
} from "convex/server";
16+
import type * as _system_cli_convexUrl from "../_system/cli/convexUrl.js";
1617
import type * as _system_cli_exports from "../_system/cli/exports.js";
1718
import type * as _system_cli_modules from "../_system/cli/modules.js";
1819
import type * as _system_cli_queryEnvironmentVariables from "../_system/cli/queryEnvironmentVariables.js";
@@ -24,6 +25,7 @@ import type * as _system_frontend_addDocument from "../_system/frontend/addDocum
2425
import type * as _system_frontend_clearTablePage from "../_system/frontend/clearTablePage.js";
2526
import type * as _system_frontend_common from "../_system/frontend/common.js";
2627
import type * as _system_frontend_components from "../_system/frontend/components.js";
28+
import type * as _system_frontend_convexCloudUrl from "../_system/frontend/convexCloudUrl.js";
2729
import type * as _system_frontend_convexSiteUrl from "../_system/frontend/convexSiteUrl.js";
2830
import type * as _system_frontend_createTable from "../_system/frontend/createTable.js";
2931
import type * as _system_frontend_deleteDocuments from "../_system/frontend/deleteDocuments.js";
@@ -69,6 +71,7 @@ import type * as tableDefs_snapshotImport from "../tableDefs/snapshotImport.js";
6971
* ```
7072
*/
7173
declare const fullApi: ApiFromModules<{
74+
"_system/cli/convexUrl": typeof _system_cli_convexUrl;
7275
"_system/cli/exports": typeof _system_cli_exports;
7376
"_system/cli/modules": typeof _system_cli_modules;
7477
"_system/cli/queryEnvironmentVariables": typeof _system_cli_queryEnvironmentVariables;
@@ -80,6 +83,7 @@ declare const fullApi: ApiFromModules<{
8083
"_system/frontend/clearTablePage": typeof _system_frontend_clearTablePage;
8184
"_system/frontend/common": typeof _system_frontend_common;
8285
"_system/frontend/components": typeof _system_frontend_components;
86+
"_system/frontend/convexCloudUrl": typeof _system_frontend_convexCloudUrl;
8387
"_system/frontend/convexSiteUrl": typeof _system_frontend_convexSiteUrl;
8488
"_system/frontend/createTable": typeof _system_frontend_createTable;
8589
"_system/frontend/deleteDocuments": typeof _system_frontend_deleteDocuments;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { queryPrivateSystem } from "../secretSystemTables";
2+
3+
declare const process: { env: { CONVEX_CLOUD_URL: string } };
4+
5+
export const cloudUrl = queryPrivateSystem({
6+
args: {},
7+
handler: async function () {
8+
return process.env.CONVEX_CLOUD_URL;
9+
},
10+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { cloudUrl } from "../cli/convexUrl";
2+
3+
export default cloudUrl;

0 commit comments

Comments
 (0)