1.0.1 • Published 6 years ago

publitio_jquery_plugin v1.0.1

Weekly downloads
10
License
-
Repository
-
Last release
6 years ago

Publitio jQuery SDK


Description

Simple jQuery Plugin for Publitio API


Requirements

This Plugin is dependent on jQuery and CryptoJS. For obvious reasons it needs to be loaded after jQuery and CryptoJS, otherwise it won't work.


Instalation

Using npm:
$ npm install publitio_jquery_plugin --save
Using yarn:
$ yarn add publitio_jquery_plugin

Usage

<!-- Your jQuery script-->
<script src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
<!-- Your CryptoJS CDN script -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js"></script>
<!-- Or if you use the npm package for CryptoJS
<script src="./node_modules/crypto-js/crypto-js.js"></script> -->
<!-- Include Publitio jQuery Plugin script-->
<script src="node_modules/publitio_jquery_sdk/dist/publitio.js"></script>
$(document).ready(() => {

	// xxxx => YOUR API_KEY
	// yyyy => YOUR API_SECRET
	$.publitio.init('xxxx', 'yyyy')

})

Sample api call to list files:

// list files
$.publitio.call('/files/list', 'GET', { offset: '0', limit: '10' })
	.then((data) => { console.log(data) })
    .catch((error) => { console.log(error) })

See examples.js file for full list of available classes, methods and options, or check the official docs on Publitio Docs