
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@remkoj/optimizely-one-nextjs
Advanced tools
React components (both client & server) to integrate the browser-side products from Optimizely (Web Experimentation, Data Platform & Content Analytics / Recommendations)
Start by adding the package to your project:
yarn add @remkoj/optimizely-one-nextjs
Then make the service endpoints available by creating a new API route within Next.JS. For the app router this is done by creating this file:
app/api/me/[[...path]]/route.ts
Put the following code in this file to use the API Route handler from the package:
import { createOptimizelyOneApi } from '@remkoj/optimizely-one-nextjs/server';
const handler = createOptimizelyOneApi()
export const GET = handler
export const POST = handler
export const runtime = 'edge' // 'nodejs' (default) | 'edge'
export const dynamic = 'force-dynamic'
export const dynamicParams = true
export const fetchCache = 'default-no-store'
Within the global layout (or your "third party providers component", whatever applies best), add the Optimizely One Scripts (Scripts.Header
& Scripts.Footer
), Context Provider (OptimizelyOneProvider
), Page Activator (PageActivator
), and - if you want to - the demo gadget (OptimizelyOneGadget
).
import { Scripts } from '@remkoj/optimizely-one-nextjs/server'
import { OptimizelyOneProvider, PageActivator } from '@remkoj/optimizely-one-nextjs/client'
import OptimizelyOneGadget from '@remkoj/optimizely-one-nextjs/optimizely-one-gadget'
export type RootLayoutProps = {
children: React.ReactNode
}
export default function RootLayout({ children }: RootLayoutProps)
{
return <html>
<head>
<Scripts.Header />
</head>
<body>
<OptimizelyOneProvider value={{ debug: true }}>
<PageActivator />
{ children }
<OptimizelyOneGadget />
</OptimizelyOneProvider>
<Scripts.Footer />
</body>
</html>
}
Whenever you want to track additional events, use the provided hook to get to the context and send events.
'use client'
import React, { type FunctionComponent } from 'react'
import { useOptimizelyOne } from '@remkoj/optimizely-one-nextjs/client'
export const YourComponent : FunctionComponent<{}> = props => {
const opti = useOptimizelyOne()
function handler()
{
opti?.track({ event: "name", action: "action" })
}
return <button onClick={() => handler()}>Output</button>
}
FAQs
Unknown package
The npm package @remkoj/optimizely-one-nextjs receives a total of 171 weekly downloads. As such, @remkoj/optimizely-one-nextjs popularity was classified as not popular.
We found that @remkoj/optimizely-one-nextjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.