2.9.9 • Published 3 years ago

puresdk v2.9.9

Weekly downloads
144
License
MIT
Repository
-
Last release
3 years ago

Purpose

The purpose of this library is to aim developers create applications for the PureProfile Business Platform. The library provides:

  • authentication / authorization layer
  • navigation through apps and accounts
  • other help tools and features such as a notifications' mechanism are included

Distribution / Installation

The library is available through npm, bower and cdn.

versions x.x.x-alpha.x are not stable and are used only for development. For production purposes please always use "*" (for latest), x.x.x, >x.x.x, ^x.x.x etc semantic version. For development, in order to always have the latest version (either alpha or stable) please use ">x.y.z-alpha" semantic version. The npm repository is "puresdk". If you are working with npm you just need to require / import the library into your code. If you're loading the library in a script tag from CDN the library is exposed to window.PURESDK namespace.

The CDN version of the library is available on the urls:

Latest version:

http://purecdn.pureprofile.com/ppba.latest.minified.js

Specific version minified:

http://purecdn.pureprofile.com/ppba.<= version number >.minified.js

Specific version not-minified:

http://purecdn.pureprofile.com/ppba.<= version number >.js

Example: http://purecdn.pureprofile.com/ppba.2.1.14.minified.js http://purecdn.pureprofile.com/ppba.2.1.14.js

Warning:

CDN versions are available only from version 2.3.11 and up

Features

Initialize the library

First thing you should do is to initialize the library. This step is mandatory when using the library. In order to initialize the library use the "init" function exposed by it.

Commonjs version example:

CDN version example:

As noticed, init method takes one argument of type object which holds the initial configuration you want to pass to it. The supported params / keys of the configuration object are:

Authenticate / authorize the user

Second step (which is also absolutely mandatory) is to authenticate and authorize the current user. The library will automatically check if the user is logged in and also if the logged in user has access to the application. The flow goes as follows:

Commonjs version example:

CDN version example:

Mention the two ways of authentication provided by the library. You can either use the authenticatePromise method which returns a promise or the authenticate method which takes as parameter a success callback. Failure should not concern you as in such case the library automatically redirects the user to the login page.

getUserData

This function returns the full data of the user in an object.

Alert message boxes

The library provides a method for displaying message boxes on top of the page. The supported types are:

In order to show a message box just use the "setInfo" method exposed by the sdk. Here are a couple of examples:

Cloudinary image picker

A Cloudinary image picker is included out of the box. All images used among the various apps of an account are stored on a Cloudinary repository and can be reused at any time by either the same or any other app. In order to browse and pick an already existing image from Cloudinary you should use the openCloudinaryPicker method exposed by puresdk. This method will pop up an image picker modal allowing the user to browse, search and pick the image they want. The method accepts just one argument of type object. For now the only thing to set is the success callback function that will be executed once the user picks an image. Here is an example of how to use the Cloudinary image picker:

Loader

A loader is included on the sdk's top bar. It's positioned right next to the apps button and can be shown and hidden at any time. The methods that show/hide the loader are:

goToLoginPage

This method redirects the browser window to the login page. The method should be used in cases a 401 error code comes back from the backend (meaning the user is not logged in).

Development mode

Only for development reasons, in order to have puresdk running on any url (including localhost or any other) init method of puresdk supports the following configuration options:

the devKeys (key & secret) are unique for each organisation and should be acquired directly from the PureProfile Development Team.

2.9.9

3 years ago

2.9.8

4 years ago

2.9.8-rc.1

4 years ago

2.9.7

4 years ago

2.9.7-rc.3

4 years ago

2.9.7-rc.4

4 years ago

2.9.7-rc.2

4 years ago

2.9.7-rc.1

4 years ago

2.9.6

4 years ago

2.9.5

4 years ago

2.9.5-rc2

4 years ago

2.9.5-rc1

4 years ago

2.9.4

4 years ago

2.9.3

5 years ago

2.9.2

5 years ago

2.9.1

5 years ago

2.9.0

5 years ago

2.8.0

5 years ago

2.7.4

5 years ago

2.7.3

5 years ago

2.7.2

5 years ago

2.7.1

5 years ago

2.7.0

5 years ago

2.6.23

5 years ago

2.6.22

5 years ago

2.6.21

5 years ago

2.6.20

5 years ago

2.6.18

6 years ago

2.6.17

6 years ago

2.6.17-rc.4

6 years ago

2.6.17-rc.3

6 years ago

2.6.17-rc.2

6 years ago

2.6.16

6 years ago

2.6.15

6 years ago

2.6.14

6 years ago

2.6.13

6 years ago

2.6.12

6 years ago

2.6.11

6 years ago

2.6.10

6 years ago

2.6.9

6 years ago

2.6.8

7 years ago

2.6.7

7 years ago

2.6.6

7 years ago

2.6.4

7 years ago

0.9.0

7 years ago

2.6.3

7 years ago

2.6.2

7 years ago

2.6.1

7 years ago

2.6.0

7 years ago

2.5.7

7 years ago

2.5.6

7 years ago

2.5.5

7 years ago

2.5.4

7 years ago

2.5.3

7 years ago

2.5.2

7 years ago

2.5.1

7 years ago

2.5.0

7 years ago

2.4.0

7 years ago

2.3.15

7 years ago

2.3.14

7 years ago

2.3.13

7 years ago

2.3.12

7 years ago

2.3.11

7 years ago

2.3.10

7 years ago

2.3.9

7 years ago

2.3.8

7 years ago

2.3.7

7 years ago

2.3.6

7 years ago

2.3.5

7 years ago

2.3.2

7 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.2.3

7 years ago

2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.1

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

2.0.0-alpha.1

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6-alpha.2

7 years ago

1.1.5

7 years ago

1.1.5-alpha.1

7 years ago

1.1.4

7 years ago

1.1.4-alpha.1

7 years ago

1.1.3

7 years ago

1.1.3-alpha.1

7 years ago

1.1.2

7 years ago

1.1.2-alpha.1

7 years ago

1.1.1

7 years ago

1.1.0-alpha.3

7 years ago

1.1.0-alpha.2

7 years ago

1.1.0-alpha.1

7 years ago

1.1.0

7 years ago

0.1.0-alpha.18

7 years ago

0.1.0-alpha.17

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.1.0-alpha.9

7 years ago

0.1.0-alpha.8

7 years ago

0.1.0-alpha.7

7 years ago

0.1.0-alpha.6

7 years ago

0.1.0-alpha.5

7 years ago

0.1.0-alpha.4

7 years ago

0.1.0-alpha.2

7 years ago

0.1.0-alpha.1

7 years ago

0.0.1-alpha.16

7 years ago

0.0.1-alpha.15

7 years ago

0.0.1-alpha.14

7 years ago

0.0.1-alpha.13

7 years ago

0.0.1-alpha.12

7 years ago

0.0.1-alpha.11

7 years ago

0.0.1-alpha.10

7 years ago

0.0.1-alpha.9

7 years ago

0.0.1-alpha.8

7 years ago

0.0.1-alpha.6

7 years ago

0.0.1-alpha.3

7 years ago

0.0.1-alpha.1

7 years ago

0.0.0

7 years ago