
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
@luckyorange/server
Advanced tools
Official library for sending data to Lucky Orange from a server environment.
Official library for sending data to Lucky Orange from a Node.js server environment.
npm i @luckyorange/server
The following are a few common usage examples to get started sending data to your site in Lucky Orange.
The only requirement to get started is passing your site's unique ID to the siteId
parameter.
const LuckyOrange = require('@luckyorange/server')
const luckyorange = new LuckyOrange({ siteId: 'YOUR-SITE-ID' })
The track()
method accepts three arguments. The first is the name of the event you wish to track. The second is any arbitrary metadata that you want to associate with the event. Finally, you can send a context object. This allows the event to be associated with a particular user that you have identified or a session created by the Lucky Orange browser tracking code.
luckyorange.events.track(
'Account Created',
{ acceptedTerms: true },
{ userId: 'test-user-id' }
)
In order to connect user accounts and their properties in your system with visitor profiles in Lucky Orange, use identify()
. You must provide a unique ID that will then become an alias for a visitor created internally by Lucky Orange. If you also use identify()
in the browser tracking code, the same user's behavior will be combined into one profile.
const LuckyOrange = require('@luckyorange/server')
const luckyorange = new LuckyOrange({ siteId: 'YOUR-SITE-ID' })
luckyorange.visitors.identify('test-user-id', { email: 'test@example.com' })
If you are also using Lucky Orange in the browser, you can pass an additional visitorId
option to identify a visitor already created in the browser. If you skip this step, an entirely new visitor will be created unless the browser has already called identify()
. You can get the browser's visitor ID by calling the LO.visitor.getVisitorId()
on-page API.
const LuckyOrange = require('@luckyorange/server')
const luckyorange = new LuckyOrange({ siteId: 'YOUR-SITE-ID' })
luckyorange.visitors.identify('test-user-id', { email: 'test@example.com' }, { visitorId: 'visitor-id-from-browser' })
FAQs
Official library for sending data to Lucky Orange from a server environment.
We found that @luckyorange/server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.