Open kayhadrin opened 9 years ago
+1 yes please. I would like that too!
+1
+1
I think you can un-minify it by yourself using online tools
Unfortunately it is uglified. I've had some success reverse engineering it (using online tools) and I could publish that if enough people are interested. That said, getting the original non-uglified code would be way more ideal.
Yup unfortunately it's uglified. @dansomething what tools did you use to reverse engineer? Unless you have the min.map file of the uglified code, it might not be possible to get it back to the original source code.
@pasangsherpa yeah, I can't get back to the exact original source, but I can reverse engineer it back to something that is human readable/maintainable. I'm done with most of the work now minus a few lines here and there that are still highly optimized code. I'll post that in a public repo as soon as I'm comfortable with the work which should be in the next day or so.
Thanks all for the interest in sp.js Analytics library. It has become a widely used library to provide many Splunk users with a simple-to-use API to track client-side events.
I apologize for the extended silence. We’re currently working on the next iteration of sp.js which will incorporate many of the awesome features brought in from bugsense product (now known as Splunk MINT) which was acquired by Splunk. Examples of these features include error reporting and network monitoring. And yes, the next iteration will be open sourced. So stay tuned!
In the meantime, if you have a particular feature in mind that prompts you to need the source code, please do share them as a separate issue here. We have received similar requests in the past, and we’re happy to add necessary extensibility to satisfy your requirements.
@rarsan what's the intended license for the v1 sp.min.js source? I see the docCookies library in it from Mozilla which is under the GPL license implying sp.js is also under GPL. I'm asking because I would like to fix bugs in it. For example, it doesn't seem to obey the track_pageview setting that you can pass to init.
@dansomething any progress on this?
Hi @dansomething Any update on open sourcing or licensing this component?
I think the last I heard is this repo is dead and they're working on a new version? It may be closed source or something. That was over a year ago. Take a look here: https://github.com/ReadyTalk/splunk-demo-collector-for-analyticsjs/blob/master/sp-no-cookies.js
It's 2021 now, and most Splunk users will be using HTTP Event Collectors as the destination of their event submissions. In my opinion, team that developed HTTP Event Collectors in Splunk should have taken over development of sp.js when they were finished or as a side project. If they were aware of this project and vice-versa, it could be made sure that all of the following were true:
sp
object has a property _token
_token
property is a string that matches the pattern /^[A-Fa-f0-9]{8}-(?:[A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}$/
sp.load
function takes two arguments, url
and token
, where the token
argument is used to set sp._token
aboveXMLHttpRequest
sent while the _token
property is truthy has the HTTP header 'Authorization: Splunk ' + sp._token
I believe that is all that is necessary to revive the sp.js project and make it compatible with HTTP Event Collectors.
Thank you!!!
Hi there,
First of all, thanks for making this splunk demo available online. I note though that the
sp.js
file is only provided as a minified js file: http://d21ey8j28ejz92.cloudfront.net/analytics/v1/sp.min.jsCould you also share this file's source code?
Cheers,
David