Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions example/convex/_generated/server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ import {
} from "convex/server";
import type { DataModel } from "./dataModel.js";

/**
* Typesafe environment variables.
*
* This includes platform-provided env vars and any variables declared in
* `convex.config.ts`.
*/
type Env = {
readonly CONVEX_CLOUD_URL: string;
readonly CONVEX_SITE_URL: string;
};

/**
* Define a query in this Convex app's public API.
*
Expand Down Expand Up @@ -95,6 +106,14 @@ export declare const internalAction: ActionBuilder<DataModel, "internal">;
*/
export declare const httpAction: HttpActionBuilder;

/**
* Typesafe environment variables.
*
* This includes platform-provided env vars and any variables declared in
* `convex.config.ts`.
*/
export declare const env: Env;

/**
* A set of services for use within Convex query functions.
*
Expand Down
8 changes: 8 additions & 0 deletions example/convex/_generated/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,11 @@ export const internalAction = internalActionGeneric;
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
*/
export const httpAction = httpActionGeneric;

/**
* Typesafe environment variables.
*
* This includes platform-provided env vars and any variables declared in
* `convex.config.ts`.
*/
export const env = process.env;
13 changes: 13 additions & 0 deletions example/convex/localComponent/_generated/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ import {
} from "convex/server";
import type { DataModel } from "./dataModel.js";

/**
* Typesafe environment variables.
*
* This includes platform-provided env vars and any variables declared in
* `convex.config.ts`.
*/
type Env = {
readonly CONVEX_CLOUD_URL: string;
readonly CONVEX_SITE_URL: string;
};

/**
* Define a query in this Convex app's public API.
*
Expand Down Expand Up @@ -106,6 +117,8 @@ export const internalAction: ActionBuilder<DataModel, "internal"> =
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
*/
export const httpAction: HttpActionBuilder = httpActionGeneric;
export const env: Env = (globalThis as unknown as { process: { env: Env } })
.process.env;

/**
* A set of services for use within Convex query functions.
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"@vitejs/plugin-react": "6.0.2",
"chokidar-cli": "3.0.0",
"convex": "1.46.0",
"convex-helpers": "0.1.118",
"convex-helpers": "0.1.128",
"convex-test": "0.0.61",
"eslint": "9.39.4",
"eslint-plugin-react": "7.37.5",
Expand Down
13 changes: 13 additions & 0 deletions src/component/_generated/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ import {
} from "convex/server";
import type { DataModel } from "./dataModel.js";

/**
* Typesafe environment variables.
*
* This includes platform-provided env vars and any variables declared in
* `convex.config.ts`.
*/
type Env = {
readonly CONVEX_CLOUD_URL: string;
readonly CONVEX_SITE_URL: string;
};

/**
* Define a query in this Convex app's public API.
*
Expand Down Expand Up @@ -106,6 +117,8 @@ export const internalAction: ActionBuilder<DataModel, "internal"> =
* @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
*/
export const httpAction: HttpActionBuilder = httpActionGeneric;
export const env: Env = (globalThis as unknown as { process: { env: Env } })
.process.env;

/**
* A set of services for use within Convex query functions.
Expand Down
Loading