1.1.1 • Published 3 years ago
syslins v1.1.1
Syslins
Syslins lets you create markers on the HTML elements which you click on to the get more information about the Element.
Getting Started
Install usign npm
`npm i syslins`
Create a developer account in Orgnaz. Create an app. Copy the client_id and client_secret of the app. From the backend of your application request for a user token. The following is example doing with CURL. Replace values YOUR_APP_CLIENT_ID, YOUR_APP_CLIENT_SECRET, USER_EMAIL, USER_FIRSTNAME, USER_LASTNAME and USER_TYPE. If the user is not found, a new user will be created for your app.
`$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://orgnaz.com/api/oauth/user-token");
curl_setopt($ch, CURLOPT_POST, 1);// set post data to true
curl_setopt($ch, CURLOPT_POSTFIELDS,"client_id=<YOUR_APP_CLIENT_ID>&client_secret=<YOUR_APP_CLIENT_SECRET>&email=USER_EMAIL&first_name=USER_FIRSTNAME&last_name=USER_LASTNAME&user_type=USER_TYPE"); // post data
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close ($ch);
echo $json;`
In front end of your application initiate the lib. Replace URL_TO_YOUR_TOKEN with Route user token in backend of your application.
`import { Syslins } from './Syslins.js';
new Syslins({
api: {clientTokenUrl: URL_TO_YOUR_TOKEN}
});`
Run http-server from the root of the Syslins.