DEVELOPER CENTER
...
JavaScript
Libraries
$pinc
4min
The $pinc library gives you access to some common functions used across Pathfix. Below are the list of common scenarios where you might use the library.
Syntax
$pinc.getPathfixUrl(providerName, publicKey, userId)
$pinc.getPathfixRevokeUrl(providerName, publicKey, userId)
Remarks
Arguments | Description |
---|---|
providerName | Internal provider name. See Provider reference |
publicKey | optional: Defaults to the public key specified in the data-public-key attribute of the script tag |
userId | optional: Defaults to the data-user-id attribute of the script tag |
Example
Syntax
$pinc.fileRead(FileReader, callback)
Returns
{"type": "HTTP_MIME_TYPE","content": "file_content", uploadObject:{}}
Remarks
Method Call
- FileReader - required, Javascript FileReader Object
- callback- callback function reference
Return
- content - The raw file content.
- uploadObject - Pass as a parameter to the payload when uploading the file using Pathfix passthrough Endpoints
Example
Extended code from developer.mozilla.org