JavaScript
Learn how to build and manage your integrations using Pathfix client library. Get documentation, example code, tutorials, and more.
The pathfix oauth library is loaded by including the helper.js in the following manner.
Although the oauth.js can be loaded from the same location it will not work independently. It needs a few dependencies that are loaded by the helper.js
When the Pathfix helper library is ready it calls back a global function on the page. This is the place you should be attaching handlers to monitor the loading of other libraries. See example below...
Events to all Pathfix libraries are attached using a standard syntax.
library | required | Name of the library that you'd want to attach to. For oauth library use "$pinc.oauth" as a string. |
---|---|---|
eventName | required | Eventname to be sent across as string eg. "ready" |
callback | required | Event handler reference. |
forceInvoke | optional | If true, it forces your callback to be invoked if the event was fired before you attached your handler. |
Most method calls in Pathfix need callback as the final argument. Method calls are made to the library using their object reference. Below is the list of libraries available.
$pinc | All global functions are accessible using this object. |
---|---|
$pinc.oauth | Pathfix Oauth library. |