-
Notifications
You must be signed in to change notification settings - Fork 4
Local Development
b3hr4d edited this page Mar 11, 2026
·
1 revision
For Vite apps, the preferred local workflow is:
- start the local network with
icp-cli - deploy canisters with
icp deploy - let
@ic-reactor/vite-plugininject theic_envcookie - configure
ClientManagerwithwithCanisterEnv: true
Example:
export const clientManager = new ClientManager({
queryClient,
withCanisterEnv: true,
})icp network start -d
icp deploy backend
pnpm devIf your project still uses dfx, use withProcessEnv: true and point the app
at declarations generated by that workflow.
export const clientManager = new ClientManager({
queryClient,
withProcessEnv: true,
})Common environment value:
DFX_NETWORK=localFor local replicas, make sure the client manager is initialized so the local root key is fetched:
await clientManager.initialize()Usually means the local root key was not fetched yet.
-
icp-cli:icp network status -e local --json -
dfx:dfx info webserver-port
Then set port explicitly if needed.
If you use a manual dfx project, deploy a local Internet Identity canister
and let useAuth() auto-detect the correct provider from the network settings.