
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@smartlook/nodejs-sdk
Advanced tools
This small zero-dependency library can be used to send custom events to Smartlook from your backend Node.js services.
These events can be then views in the events tab and you can use them to create funnels.
If you need to use these events to filter the recordings, you have to send smartlook.vid
and smartlook.sid
provided by the frontend Smartlook library in the request to your backend service.
However it is not required and you can use the events to track something not related to the user sessions or someting that happens outside of user session. Set the event vid
to whatever you want to be identified as a source of the event (eg. your internal user id or job id).
You could have for example a background sequence of jobs that should trigger a user activity in the end. You can track with Smartlook how successful this process is. Such case would be checking last user activity on your web, sending an email to remind them your service or let them know about some news and the last event would be user login.
$ npm install @smartlook/nodejs-sdk
const smartlook = require('@smartlook/nodejs-sdk')
// set the key directly or with SMARTLOOK_KEY env variable
smartlook.init({
key: '<PROJECT KEY>',
})
smartlook.event({
vid: '<SOURCE ID>',
name: '<EVENT NAME>',
})
Check out a bit more comprehensive example.
Initializes the SDK with your deploy key
and starts batch uploading of the events every flushIntervalMillis
.
Parameter | Environment variable | Default | Allowed |
---|---|---|---|
key | SMARTLOOK_KEY | null | string |
flushIntervalMillis | SMARTLOOK_FLUSH_INTERVAL_MILLIS | 10000 | integer |
logLevel | SMARTLOOK_LOG_LEVEL | error | mute/trace/debug/info/error |
Uploads pending events and stops recording of new events.
Creates a new custom event.
Parameter | Type | Description |
---|---|---|
vid | string | (required) Event source entity identifier |
name | string | (required) Event name |
value | string | Event value |
props | object | Event key/value properties |
sid | string | User session id obtained from the frontend Smarltook library |
Pull requests for new features, bug fixes, and suggestions are welcome!
FAQs
Smartlook Node.js SDK
We found that @smartlook/nodejs-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.