When you're developing against the PactSafe platform, more than likely you won't want to test against the production system that you'll be deploying to. Makes sense! We've built our platform to support your development needs as you embed Contracts into your own apps, websites, and more. Using Sites, you can configure multiple PactSafe environments that allow you to share assets as you promote your configuration through to production.
One Site per environment
Within PactSafe, you can create different Sites to manage the different environments that you use in your development workflow, such as dev, staging, preview, and production. As part of PactSafe Professional, you can create as many Sites as you need to map to your own environments.
Use these steps to get to the Sites screen:
-
Click the Profile & Settings button at the bottom of the left navigation bar. It probably contains either your own photo or your initials. A pop-up menu appears.
-
Choose Settings from the menu. The Account Settings screen appears.
-
Click the Sites option from the navigation menu on the left. The Sites configuration appears.
The image below shows an example Site configuration:
Want to create more Sites? Just click Create Site button in the lower right to add a new one.
Managing records across multiple Sites
You can navigate to each of your respective Sites to manage Signers, Contracts, and Groups by using the Site Switcher in the lower left hand corner of your screen:
Things of note for Sites that you're managing:
-
In development, you may be interested in using PactSafe's "Test Mode" when sending calls to our system. More on this later in this document.
-
You can set your Contracts as Shared in the Contract Properties, which shares your Contracts across all of your Sites. That way, Contracts you're testing in Dev can immediately be available in Staging or Production.
-
Currently, Groups cannot be shared across Sites. We're working on this.
Getting started with testing using the JavaScript Library
When developing, you may want to debug the calls you're making and see when calls are sending to PactSafe. If you're using our JavaScript library, there are two things you'll definitely want to start out using so you can see
-
when PactSafe events are firing and what callback info is being passed, and
-
what parameters are being passed when events are being sent to and being pulled from PactSafe.
Listen to all PactSafe events firing on your page
To start listening to all events being fired by PactSafe, you can add the following code after your snippet to start listening to events:
<script type="text/javascript">
(function(w,d,s,c,n,a,b){w['PactSafeObject']=n;w[n]=w[n]||function(){(w[n].q=w[n].q||[]).push(arguments)}, w[n].on=function(){(w[n].e=w[n].e||[]).push(arguments)},w[n].once=function(){(w[n].eo=w[n].eo||[]).push(arguments)},w[n].off=function(){(w[n].o=w[n].o||[]).push(arguments)},w[n].t=1*new Date(); a=d.createElement(s),b=d.getElementsByTagName(s)[0];a.async=1;a.src=c;b.parentNode.insertBefore(a,b) })(window,document,'script','//vault.pactsafe.io/ps.min.js','_ps');
// get your ACCESS ID at https://app.pactsafe.com/settings/account
// ACCESS ID is unique to each site
_ps('create', 'ACCESS_ID');
_ps.debug = true;
// OR
_ps.enableDebug();
</script>
This code will start pushing all of the events that are happening in the JavaScript library to your console including callback parameters, objects, and more for when your Group is loaded on the page, when the Signer ID is set, etc. Learn more about what events you can listen to.
Test Mode: Track what parameters are being sent
You can use "Test Mode" to send test data to PactSafe. To enable test mode, add an additional parameter to your _ps('create')
call like so:
_ps('create', 'ACCESS_ID', { test_mode: true });
You can read more about test mode and how to clear test data at our JavaScript Library Overview or our PS.js Reference Docs.