Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Change the API to improve initialisation #176

Open
chrisvanmook opened this issue Jun 2, 2020 · 2 comments
Open

Change the API to improve initialisation #176

chrisvanmook opened this issue Jun 2, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@chrisvanmook
Copy link
Contributor

Instead of passing an object, it would be nice to have something like this instead:

instance
    .urlBase('https://LINK.TO.DOMAIN')
    .siteId(3)
    .setUserId('example_id')
    .disableCookies()
    .setSecureCookie(true)
    .setRequestMethod('POST');

#174 (comment)

@An-dz
Copy link
Contributor

An-dz commented Jun 2, 2020

That would be similar to my tinta package.

It would need some sort of run method to execute the injector (insertBefore). This could be the first thing called on trackEvents for JS and on createInstance for React. Without this it can't be injected on the page as every method injects on window._paq and it's impossible to know if the chain has ended.

@chrisvanmook
Copy link
Contributor Author

As mentioned here we should also keep in mind that some settings should also be able to set after initialisation

@chrisvanmook chrisvanmook changed the title Change the API to have chained calls on the instance Change the API to improve initialisation Jun 7, 2020
@jonkoops jonkoops self-assigned this Sep 1, 2020
@jonkoops jonkoops added the enhancement New feature or request label Sep 1, 2020
@jonkoops jonkoops added this to the 0.3.0 milestone Sep 1, 2020
@jonkoops jonkoops mentioned this issue Oct 1, 2020
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants