Capxul Docs
How-to guides

Choose Account readiness

Select none, counterfactual, or deployed readiness when creating an SDK client.

Set requirement once when you create the client:

const created = await createCapxulClient({
  publishableKey,
  requirement: "counterfactual",
});

Choose the smallest state your workflow needs:

RequirementUse it when
"none"You need authentication or profile reads but no Account setup. This is the default.
"counterfactual"The user needs a receivable Account without immediate deployed activation.
"deployed"The workflow requires full on-chain activation. Node callers must supply a signer.

After sign-in, inspect the product lifecycle:

const lifecycle = await client.account.getLifecycle();
if (!lifecycle.ok) throw lifecycle.error;

if (lifecycle.value.status === "failed") {
  const retried = await client.account.retrySetup();
  if (!retried.ok) throw retried.error;
}

Do not call private provision/deploy arms directly. The client owns the readiness lane and bootstrap-supplied chain configuration.

For deployed readiness in Node, create a signer from the packed Node entry:

import { localPrivateKeySigner } from "@capxul/sdk/node";

const signer = localPrivateKeySigner({
  privateKey: process.env.CAPXUL_SIGNER_PRIVATE_KEY! as `0x${string}`,
});

const created = await createCapxulClient({
  publishableKey,
  requirement: "deployed",
  signer,
});

Keep private keys out of source, logs, and client-side bundles.