
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@livesession/sdk
Advanced tools
This small package let you install LiveSession script and configure it properly.
If you need you can use methods that were also provided in this SDK.
npm i @livesession/sdk
or yarn add @livesession/sdk
Next, you should initialize the SDK on your website like in this example:
import ls from "@livesession/sdk";
// init a script, trackID is required
ls.init("YOUR TRACKID", options, sdkOptions);
After LiveSession is inited, you can start recording session using method newPageView()
Initialization example with enabled recording
ls.init("123456789", { keystrokes: true, rootHostname: ".mypage.com" });
ls.newPageView();
// or with devMode on
ls.init(
"1234.56789",
{ rootHostname: ".mypage.com" },
{
devMode: true, // process.env.NODE_ENV === "development"
}
);
ls.newPageView();
Custom events
ls.track("User Subscribed", {
plan: "premium",
seats: 1,
total: 255.50,
isPatron: true
});
ls.init("YOUR-TRACK-ID", options, sdkOptions);
ls.newPageView();
ReactDOM.render(<App />, document.getElementById("root"));
Implementation is created thanks to @SkowyrnyMG
Import SDK into your main app component
Import OnInit
from @angular/core
Implement OnInit
and call LiveSession init method in ngOnInit
function, and start recording
// app.component.ts
import ls from '@livesession/sdk'
export class AppComponent implemets OnInit {
ngOnInit(){
ls.init("YOUR_TRACK_ID");
ls.newPageView();
}
}
For more about initializing script check out our guide
As a third argument to init method you can pass sdkOptions object, here are all available variables:
Variable | Parameter | Default | Info |
---|---|---|---|
devMode | bool | false | Log methods into console instead of calling their |
scriptURL | string | https://cdn.livesession.io/track.js | Link to LiveSession tracking code, useful if you want to use a specific version of code |
Example
ls.init("exampleID", null, { devMode: true });
If you initialized script, you can simply customize it with following functions:
Function | Parameter | Default | Allowed |
---|---|---|---|
init | trackID, options, sdkOptions | null, null, false | string(required), object, object |
getSessionURL | callback(url, isNewSession) | null | void(string, bool) |
identify | data | null | object |
invalidateSession | - | null | - |
newPageView | options | null | object |
setOptions | options | null | object |
setCustomParams | data | null | object |
off | - | null | - |
optOut | - | false | - |
debug | - | false | - |
track | event, properties | null, null | string(required), object |
log | logLevel, data | "log", null | string("log", "info", "warn", "error"), object |
If out want to learn more about all methods, go to our developers page
Level | Description |
---|---|
"log" | Object will be logged as log |
"info" | Object will be logged as info |
"warn" | Object will be logged as warn |
"error" | Object will be logged as error |
We're always open to work with our community. Let us know if you have ideas for new features or suggestions. Pull requests for bug fixes are also welcome!
This package currently support v.1.4.0
of API, you can find more informations about API changelog here
FAQs
Add a LiveSession script to your site even easier with our SDK
We found that @livesession/sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.