-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
40 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
<blockquote class="lang-specific javascript--browser"> | ||
<p>You selected the documentation for the JavaScript language utilizing the JavaScript Browser library. | ||
The library is deployed under the MIT License and is available as <a href="https://github.com/Breinify/brein-api-library-javascript-browser">open-source project</a> | ||
<blockquote class="lang-specific javascript--node"> | ||
<p>You selected the documentation for Node.js library. | ||
The library is deployed under the MIT License and is | ||
available as <a href="https://github.com/Breinify/brein-api-library-node">open-source project</a> | ||
on GitHub.</p> | ||
</blockquote> | ||
|
||
> | ||
```javascript--browser | ||
```javascript--node | ||
/* | ||
* I'm an example snippet of the JavaScript library. The following | ||
* I'm an example snippet of the Node.js library. The following | ||
* documentation should help you to get started with the library. | ||
* Even more examples and documentation can be found at: | ||
* | ||
* https://github.com/Breinify/brein-api-library-javascript-browser | ||
* https://github.com/Breinify/brein-api-library-node | ||
*/ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,9 @@ | ||
<blockquote class="lang-specific javascript--browser"> | ||
<p>There are multiple ways on how to integrate the library within your project. | ||
The library is available on bower, jsdelivr (CDN), npm, or as download from GitHub.</p> | ||
</blockquote> | ||
|
||
<blockquote class="lang-specific javascript--browser"> | ||
<h3>Using Bower</h3> | ||
<p>The library can be installed via bower, further information about bower can be found | ||
<a href="https://bower.io" target="_blank">here</a>.</p> | ||
</blockquote> | ||
|
||
> | ||
```javascript--browser | ||
bower install breinify-api --save | ||
``` | ||
|
||
<blockquote class="lang-specific javascript--browser"> | ||
<h3>jsdelivr (CDN)</h3> | ||
<p>The library can be loaded directly within the html code from . | ||
<a href="https://www.jsdelivr.com/" target="_blank">jsdelivr</a>. Please replace | ||
the {version} placeholder with the version you would like to use. | ||
To see a list of all available version have a look | ||
<a href="https://www.jsdelivr.com/projects/breinify-api" target="_blank">here</a></p> | ||
</blockquote> | ||
|
||
> | ||
```javascript--browser | ||
<script type="text/javascript" src="https://cdn.jsdelivr.net/breinify-api/{version}/breinify-api.min.js"></script> | ||
``` | ||
|
||
<blockquote class="lang-specific javascript--browser"> | ||
<p>To use the most current SNAPSHOT version, you can also use the following URL. | ||
This URL should only be used for developing purposes (see also <a href="https://rawgit.com/" target="_blank">rawgit.com</a>).</p> | ||
</blockquote> | ||
|
||
> | ||
```javascript--browser | ||
<script type="text/javascript" src="https://rawgit.com/Breinify/brein-api-library-javascript-browser/master/dist/breinify-api.min.js"></script> | ||
``` | ||
|
||
<blockquote class="lang-specific javascript--browser"> | ||
<h3>Using npm</h3> | ||
<p>The library can be installed via npm, further information about npm can be found | ||
<a href="https://www.npmjs.com/" target="_blank">here</a>. It should be mentioned that it is | ||
<b>not recommended</b> to use this library with Node.js, instead use the | ||
<a href="https://github.com/Breinify/brein-api-library-node" target="_blank">Node.js Library</a></p> | ||
<blockquote class="lang-specific javascript--node"> | ||
<p>The library is distributed through Node.js package manager | ||
(<a href="https://www.npmjs.com/package/breinify-node">npm</a>).</p> | ||
</blockquote> | ||
|
||
> | ||
```javascript--browser | ||
npm install breinify-api --save | ||
npm install breinify-node --save | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
> | ||
```javascript--browser | ||
var sId = Breinify.UTL.cookie.get('JSESSIONID'); | ||
var email = '[email protected]'; // typically read from an input field | ||
Breinify.activity({ 'sessionId': sId, 'email': email }, 'login'); | ||
```javascript--node | ||
// the req object may be passed, e.g., using express: | ||
// app.post('/login', function(req, res) { ... }); | ||
var user = { | ||
'sessionId': req.sessionID, | ||
'email': req.body.email | ||
}; | ||
breinify.activity(user, 'login'); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
> | ||
```javascript--browser | ||
var sId = Breinify.UTL.cookie.get('JSESSIONID'); | ||
Breinify.activity({ 'sessionId': sId }, 'pageVisit'); | ||
```javascript--node | ||
// the req object may be passed, e.g., using express: | ||
// app.post('/login', function(req, res) { ... }); | ||
breinify.activity({ 'sessionId': req.sessionID }, 'pageVisit'); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters