This library was created to allow external vendors to integrate custom delivery options for documents created within Templafy. This will allow Templafy users to authenticate with, choose a save location in, and save created documents directly to an external system.
A delivery connector always consists of two parts.
-
Delivery Controller A page hosted within an iframe on the delivery step of a Templafy document creation flow. This can be used to ask the user for additional input and to execute logic to save the document to a custom location.
-
Authentication popup A pop-up that points to a custom sign-in URL. This can be used to ask the user to login and is able to pass some arbitrary state to the Delivery Controller.
All content must be served over HTTPS.
- The popup must start on a URL from the same origin as the Controller.
- The
SendAuthenticationComplete
call must come from the same origin as the popup was opened at.
- The Delivery Controller will be hosted in an iframe with sandbox attribute value
allow-scripts allow-forms allow-same-origin
. - The Controller will be hosted on a page with the
CSP
directiveframe-src
set to the origin of theBaseURL
specified in your Custom Delivery Connector settings. This means that the controller cannot navigate outside of the original origin.
This project includes two examples, one for Typescript and one for React.
To run these examples:
- Run
yarn install
- for the React example run
yarn run-react-example
or for the Typescript examples runyarn run-typescript-example
Examples can be found under Examples