Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nextjs-edgee

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nextjs-edgee

The Edgee SDK for React applications

  • 1.0.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

nextjs-edgee Component

NextEdgee is a React component that injects the Edgee SDK script into the application. It also sets up listeners to track page navigations via history.pushState and history.replaceState to automatically call the edgee.page method, ensuring page views are tracked during SPA navigations.

NPM NPM Downloads

Install

using npm:

npm install nextjs-edgee

using yarn:

yarn add nextjs-edgee

Usage

import using:

import NextEdgee from 'nextjs-edgee';

Usage with app/layout.js for app folder structure

For rendering add <NextEdgee /> to your return() inside the <body></body> of RootLayout():

import NextEdgee from 'nextjs-edgee';

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        <NextEdgee src={"https://yourdomain.com/_edgee/sdk.js"} />
        {children}
      </body>
    </html>
  );
}

Usage with pages/_app.js for pages folder structure

For rendering add <NextEdgee /> to your return() in MyApp():

import NextEdgee from 'nextjs-edgee';

export default function MyApp({ Component, pageProps }) {
  return (
    <>
      <NextEdgee src="https://yourdomain.com/_edgee/sdk.js" />
      <Component {...pageProps} />;
    </>
  );
}

Usage with React, Vite React or any other React Based Framework

For rendering add <NextEdgee /> to your return() inside the component in App() in your App.js:

import NextEdgee from 'nextjsedgee';
const App = () => {
  return (
    <div>
    <Router>
      <NextEdgee src="https://yourdomain.com/_edgee/sdk.js" />
    <Routes>
    {/* Your Routes Here */}
    </Routes>
    </Router>
    </div>
  )
}

export default App;

Keywords

FAQs

Package last updated on 19 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc