DEVELOPER CENTER

JavaScript

7min

Learn how to build and manage your integrations using Pathfix client library. Get documentation, example code, tutorials, and more.

Common Concepts

The pathfix oauth library is loaded by including the helper.js in the following manner.

HTML




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







Pathfix, OnLoad

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...



HTML








Event Handlers

Events to all Pathfix libraries are attached using a standard syntax.

JS


Arguments

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.

Example

JS


Method Calls

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.

Updated 03 Mar 2023
Doc contributor
Doc contributor
Did this page help you?