Skip to main content

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​

PieceWhat it does
HostedUiProviderMounts the hosted session and the Pactvera wizard on your page.
openPactveraHostedUiOpens the full-screen create wizard. Omit any Pactvera id.
hosted-pactvera:sentFires after the SDK sends. Your page reads the Pactvera id and status.
hosted-pactvera:cancelledFires 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​

  1. Hosted UI application in the Developer Portal — branding and allowed origins. Keep clientId and clientSecret on your server. See Create the application.
  2. Server-side session — the browser calls your route for client-session. Never send clientSecret to the browser.
  3. Mount HostedUiProvider on the page where a signed-in operator creates a Pactvera. Pass that session route as session.getSession.
  4. Open the create wizard with openPactveraHostedUi. Pass createdByOrg, type: "ORGANIZATION", an existing folderName, and at least one productLines entry. Do not pass a Pactvera id, so the operator starts at Pactvera Details.
  5. Listen for the result. hosted-pactvera:sent means the SDK sent the agreement. hosted-pactvera:cancelled means the operator closed the wizard before send.
  6. 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.

FieldRequiredDescription
createdByOrgYesOrganization id that owns the Pactvera.
typeYes"ORGANIZATION". That is the only type the wizard accepts.
folderNameYesName of an existing folder. The wizard locks it.
productLinesYesOne or more non-empty product line names.
organizationNameNoWhite-label organization name. Falls back to the signed-in session.
documentFileNoPDF to attach, as a File or { name, base64 }.
documentTitleNoTitle used with documentFile.
suggestedPartyNoA 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​

EventWhenPayload
hosted-pactvera:sentThe SDK finished sending.id, status (IN_PROGRESS or UNASSIGNED), documentRequestIds, and signingParty (name, email, entityType, entityId).
hosted-pactvera:cancelledThe 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, 0 is treated as missing.