The PactSafe Developer Hub

Welcome to the PactSafe developer hub. You'll find comprehensive guides and documentation to help you start working with PactSafe as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started

Virtual Groups (and how to use them)

Please note: PactSafe Virtual Groups are only available with PactSafe Scale Enterprise.

Virtual Groups in PactSafe are a powerful way to integrate PactSafe into your site and to—not only dynamically render information inside a contract—dynamically configure clickwrap presentation, filtering of contracts to show your Signer, and more.

Please note: Loading a group of Contracts in this manner will affect load times on the page and is not subject to normal PactSafe SLAs. If you'd like to optimize how your Contracts are loaded on the page, check out how using Groups works.

Here are some use cases where this can be used:

  • Dynamically rendering an Order Form based on the product being purchased
  • Changing the contract presented on checkout based on the products in the cart
  • Loading in contracts that need to be accepted based upon Contract Tags
  • You have a Group already but want to change what Contracts are presented for acceptance

Covered in this Guide

  • How to present multiple Contracts for acceptance in various forms
  • How to render Contracts as a clickwrap on your page with or without creating a Group in PactSafe's UI
  • Optional parameters that define how a Virtual Contract Group is configured

Sample code used in this Guide

Sample code referenced in this article is available at this Gist.

Getting started: Loading Contracts onto your page

When loading Contracts on your page, you'll need two things:

  1. A Published Contract
  2. A "style" in which your Contract should be presented to your user. See more on styles here.

Note on Render Data

If render data is being passed into the Virtual Group, the Style for the Group must be set to Scroll or Full so that the render data is stored as part of the record. Checkbox and Combined styles are not supported.

To load a published Contract onto your page, you can use the same _ps('load') method you would use with your traditional JavaScript library:

<!-- JavaScript goes before </head> -->
_ps('create', '<SITE ACCESS ID>');

_ps('load', {
  // ID can be found in the URL for your Contract's properties page
  filter: "id==12345 and tags==tag1,tag2",
  // STYLE OPTIONS: full, scroll, checkbox, combined, embedded
  style: "scroll",
  display_all: true,
  acceptance_language: "I do declare that {{contracts}} are enforceable",
  container_selector: "contracts",
  signer_id_selector: "email-address"
<!-- Page HTML -->
<!-- ... -->
<div id="contracts"></div>
<input id="email-address" type="email" name="email_address" />

This should render a Contract on your page if you used the correct ID or referenced the proper case-sensitive Contract tags:

You can also reference an existing Group and augment specific parameters to customize the rendering of a Group of Contracts on your page. So if you have a group with a Group key of 'example-clickwrap', you can overwrite parameters of that Group.

Updated about a month ago

Virtual Groups (and how to use them)

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.