Skip to main content

clientConfig.js

This code is generated

These exports are not directly available in the convex package!

Instead you must run npx convex codegen to create convex/_generated/clientConfig.js and convex/_generated/clientConfig.d.ts.

Generated client configuration.

This configuration is used to determine which deployment the ConvexReactClient connects to.

Variables

clientConfig

Const clientConfig: ClientConfiguration

The Convex client configuration.

There are two versions of this:

  1. The dev version generated by npx convex dev and npx convex codegen. This configures the client to connect to your personal dev deployment.
  2. The production version, generated by npx convex deploy. This configures the client to connect to production.

We recommend checking the dev version into git and only generating the production version when deploying.

Usage

import { ConvexReactClient } from "convex/react";
import clientConfig from "../convex/_generated/clientConfig";

const convex = new ConvexReactClient(clientConfig);

Properties

address

address: string

The URL of the Convex deployment.