Pactvera Hosted UI
Create and send a Pactvera inside ChainIT-managed screens, under your brand. A signed-in operator opens the wizard from your page. They name the agreement, add parties, upload documents, review, and send. The SDK runs those screens and returns the result to your page.
Do not pass a Pactvera id. The operator always starts at Pactvera Details and completes every step before send is available.
Step 1 of 5
Details
Name the agreement. The folder you passed when opening the UI is shown and locked, so the operator starts the wizard at the first step.
The tour follows the create wizard in order. Click a step or press play. Provider setup, the session route, and branding stay on the Hosted UI integration.
What you integrate
| Piece | What it does |
|---|---|
HostedUiProvider | Mounts the hosted session and the Pactvera wizard on your page. |
openPactveraHostedUi | Opens the full-screen create wizard. Omit any Pactvera id. |
hosted-pactvera:sent | Fires after the SDK sends. Your page reads the Pactvera id and status. |
hosted-pactvera:cancelled | Fires if the operator closes before send. A draft that was already created is deleted. |
The operator stays in your product. Your backend still holds clientSecret and issues the client session. See Hosted UI integration.
Implementation checklist
- Hosted UI application in the Developer Portal — branding and allowed origins. Keep
clientIdandclientSecreton your server. See Create the application. - Server-side session — the browser calls your route for
client-session. Never sendclientSecretto the browser. - Mount
HostedUiProvideron the page where a signed-in operator creates a Pactvera. Pass that session route assession.getSession. - Open the create wizard with
openPactveraHostedUi. PasscreatedByOrg,type: "ORGANIZATION", an existingfolderName, and at least oneproductLinesentry. Do not pass a Pactvera id, so the operator starts at Pactvera Details. - Listen for the result.
hosted-pactvera:sentmeans the SDK sent the agreement.hosted-pactvera:cancelledmeans the operator closed the wizard before send. - Let the operator finish every step — Details, Parties, Documents, and Review. Send stays off until each external signer has an email and a signature field, and the browser has a device id, location, and app name.
The React shape is in Open the wizard.
The wizard
openPactveraHostedUi opens a full-screen overlay. Send stays disabled until every step below is complete.
1. Pactvera Details
The operator names the agreement. The folder from folderName is shown and cannot be changed in the wizard. That folder must already exist.
2. Parties
The operator adds the signing parties. At least one external signer is required. They can also:
- Mark the host organization as a party.
- Mark the agreement as a corporate document, so the finished record is filed in the organization's Corporate Documents Ledger.
- Add CC recipients. CC recipients are notice-only and do not sign.
3. Documents
The operator uploads each PDF, chooses its signers, and sets signing order to parallel or sequential. They place fields on the document. Every external signer needs an email and at least one signature field before that document can be configured.
4. Review
The operator confirms parties and documents. Send stays off until the browser session has a device id, a location, and an app name. If location access is missing, the wizard tells the operator to allow it.
5. Send
The SDK sends the Pactvera and dispatches hosted-pactvera:sent. Closing before send dispatches hosted-pactvera:cancelled.
Open the wizard
Call openPactveraHostedUi from a page that already mounts HostedUiProvider. The signed-in session is the one your client-session route created.
| Field | Required | Description |
|---|---|---|
createdByOrg | Yes | Organization id that owns the Pactvera. |
type | Yes | "ORGANIZATION". That is the only type the wizard accepts. |
folderName | Yes | Name of an existing folder. The wizard locks it. |
productLines | Yes | One or more non-empty product line names. |
organizationName | No | White-label organization name. Falls back to the signed-in session. |
documentFile | No | PDF to attach, as a File or { name, base64 }. |
documentTitle | No | Title used with documentFile. |
suggestedParty | No | A party to offer in the Parties step. entityType is "INDIVIDUAL" or "ORGANIZATION", plus name and optional email, label, and entityId. |
import { useEffect } from "react";
import {
HostedUiProvider,
openPactveraHostedUi,
HOSTED_PACTVERA_CANCELLED_EVENT,
HOSTED_PACTVERA_SENT_EVENT,
type HostedPactveraCancelledDetail,
type HostedPactveraSentDetail,
type HostedUiConfiguration,
} from "@chainitservices/hosted-ui";
const config: HostedUiConfiguration = {
clientId: "<<your_client_id>>",
session: {
getSession: async () => {
const response = await fetch("/api/hosted-auth/client-session", {
method: "POST",
});
if (!response.ok) throw new Error("Session fetch failed");
return response.json();
},
},
};
export function CreatePactvera() {
useEffect(() => {
const onSent = (event: Event) => {
const detail = (event as CustomEvent<HostedPactveraSentDetail>).detail;
// detail.id, detail.status, detail.documentRequestIds, detail.signingParty
};
const onCancelled = (event: Event) => {
const detail = (event as CustomEvent<HostedPactveraCancelledDetail>).detail;
// The operator closed the wizard. detail.id is set when a draft was created.
};
window.addEventListener(HOSTED_PACTVERA_SENT_EVENT, onSent);
window.addEventListener(HOSTED_PACTVERA_CANCELLED_EVENT, onCancelled);
return () => {
window.removeEventListener(HOSTED_PACTVERA_SENT_EVENT, onSent);
window.removeEventListener(HOSTED_PACTVERA_CANCELLED_EVENT, onCancelled);
};
}, []);
return (
<HostedUiProvider config={config}>
<button
type="button"
onClick={() =>
openPactveraHostedUi({
createdByOrg: "<<organization_id>>",
type: "ORGANIZATION",
folderName: "Agreements",
productLines: ["Lending"],
organizationName: "Northwind",
})
}
>
Create a Pactvera
</button>
</HostedUiProvider>
);
}
Events your page receives
| Event | When | Payload |
|---|---|---|
hosted-pactvera:sent | The SDK finished sending. | id, status (IN_PROGRESS or UNASSIGNED), documentRequestIds, and signingParty (name, email, entityType, entityId). |
hosted-pactvera:cancelled | The operator closed the wizard before send. | Optional id when a draft already existed. That draft is deleted. |
UNASSIGNED is used when an external signing party is an organization. IN_PROGRESS is used for an individual signer.
Before send succeeds
The wizard blocks send until all of the following are true:
- The title, folder, organization, and at least one product line are set.
- There is at least one external signer, and every external signer has an action on a document.
- Every document is configured and has a signature field for each of its external signers.
- The browser session includes a device id, latitude, longitude, and app name. A location of
0, 0is treated as missing.
Related
- Hosted UI integration — provider, session route, and branding
- What is Pactvera? — the agreement product
- Pactvera API integration flow — folders, create, attach, and send on the API