You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4. Connect a Pryv.io account, you have two possibilities here :
36
28
37
29
* Use the **Sign in** button to login to your Pryv.IO account and authorize Tableau to access it.
38
30
39
-
* Use Pryv.io sharing(s) by pasting the link(s) in the appropriate input field and click on **Use sharings**.
40
-
31
+
* Use Pryv.io apiEndpoint(s) by pasting the link(s) in the appropriate input field and click on **Use apiEndpoints**.
32
+
33
+
* You may want to load credentials contained into events of type: `'credentials/pryv-api-endpoint'` from these accounts with "Look for extra crendentials into these accounts"
34
+
41
35

42
36
43
37
5. Some selectors (time range, measurements limit) appear, you can use them to filter the data to be retrieved from Pryv.IO, then click on **Get Data**.
@@ -168,55 +162,19 @@ The exact implementation of the retrieval methods will be covered in the Pryv.IO
168
162
For Pryv.IO logic, we import our javascript library in the **index.html** :
It gives access to a pryv.io object that will be used for authentication/connection to Pryv.IO as well as for some utility functions.
175
169
176
-
We also add a login button that will allow the user to authenticate with a Pryv.IO account, as well as a logout button :
170
+
We also add a login button that will allow the user to authenticate with a Pryv.IO account, as well as a resetState button :
177
171
178
172
```html
179
173
<!-- It does not look like a button yet, onclick event will be affected to it later. -->
180
174
<spanid="pryv-button"></span>
181
-
<buttonid="pryv-logout">Logout</button>
175
+
<buttonid="pryv-resetState">resetState</button>
182
176
```
183
177
184
-
#### Initialization
185
-
186
-
In a first step, we configure some settings for Pryv.IO authentication (see [Authorize your app in API reference](http://api.pryv.com/getting-started/javascript/#authorize-your-app)):
187
-
188
-
***Domain** corresponding to the Pryv.IO platform on which the user is registered.
189
-
***Id** of the application (connector).
190
-
* Array of **Permissions** to be granted to the connector, where each **Permission** indicates:
191
-
***streamId**: an ids array of Pryv streams that we want to access from Tableau.
192
-
***level**: the access level we will grant (read/manage/contribute).
193
-
* A set of **callbacks** that will be called during the authentication process (see [Pryv.IO authentication](#authentication)).
194
-
195
-
Finally, the utility function `getSettingsFromURL` loads custom parameters that the user may provide in the connector URL to further configure the Pryv.IO authentication (see [Usage](#usage), step 3).
196
-
197
-
#### Authentication
198
-
199
-
As soon as the Tableau connector opens, it will start the Pryv.IO authentication flow by calling `pryvAuthSetup`. Two situations can be observed:
200
-
201
-
* If the user provided an existing Pryv.IO access through the connector URL or use a sharing link (see [Usage](#usage), step 3), it will bypass Pryv login.
202
-
* Otherwise, it will call `pryv.Auth.setup(authSettings)`, which will activate the Pryv.IO login button and start the authentication flow using the settings prepared previously.
203
-
204
-
##### Phase 1: needSignin
205
-
206
-
The first callback that will trigger is **needSignin**, which indicates that the user did not authorize the Tableau connector to access the Pryv account yet. In this phase, we simply reset the authentication state (`resetAuthState`, in case a previous session still exists) and tell Tableau to abort its current phase for custom authentication (`tableau.abortForAuth`).
207
-
208
-
From there, the connector will just wait until the user logs in with a Pryv.IO account. On sucessful login, the user will be asked to accept the permissions requested by Tableau.
209
-
210
-
##### Phase 2: signedIn
211
-
212
-
Once the user accepts, an access will be granted and it will trigger **the signedIn** callback, which receives the newly opened Pryv.IO connection and shows the Pryv.IO logout button.
213
-
214
-
Finally, connection to Pryv.IO is cached using `getPYConnection` function, which serves in fact three roles:
215
-
216
-
* If a Pryv.IO connection is already open, it stores the corresponding Pryv.IO credentials as Tableau credentials, so that the session persists during phases and navigation in Tableau.
217
-
* If Tableau credentials exists but we lost the connection to Pryv:IO, it opens a new Pryv connection using the same credentials.
218
-
* Finally, it returns the current Pryv.IO connection.
219
-
220
178
#### Data gathering
221
179
222
180
We implemented three functions that define how Tableau will collect data and fill each table we previously declared during [schema definition](#schema-definition).
@@ -244,6 +202,21 @@ var postFilter = function (event) {
244
202
245
203
While Pryv.IO Filters will perform the filtering on the API side, the post-filtering are applied by the connector, after the Events have been retrieved from Pryv.
246
204
205
+
## Dev
206
+
207
+
To develop and debug the app you may want to use the following scheme
208
+
Looks at options [Debugging tableau remotely with Chromium](https://tableau.github.io/webdataconnector/docs/wdc_debugging.html#start-tableau-with-remote-debugging-enabled-macos)
209
+
210
+
1. use [rec.la](https://www.rec.la) - install in local with `npm install rec.la -g` and run `rec.la ./`
211
+
212
+
2. From tableau or the simulator open the WebData Connector pane
213
+
214
+
3. Use `https://l.rec.la:4443` as source link
215
+
216
+
## Support and warranty
217
+
218
+
Pryv provides this software for educational and demonstration purposes with no support or warranty.
0 commit comments