New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@netacea/vercel

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netacea/vercel

Netacea Vercel CDN Integration

latest
npmnpm
Version
0.4.4
Version published
Weekly downloads
761
52.51%
Maintainers
2
Weekly downloads
 
Created
Source

Netacea Vercel

Netacea Header

TypeScript

@netacea/vercel is a package designed to add Netacea functionality to Vercel edge middleware.

This package has been released for Beta testing and interfaces may change without warning.

Installation

Within your Vercel project, run:

npm i @netacea/vercel

Netacea Config

This integration is best configured using Vercel environment variables.

Please consult the following table for the environment variables which must be set. The Netacea Solutions Engineering team can assist in providing this config.

NameDescription
NETACEA_COOKIE_NAMEName of the Netacea session cookie.
NETACEA_CAPTCHA_COOKIE_NAMEName of the Netacea captcha cookie.
NETACEA_PROTECTOR_API_URLURL for the Netacea Protector API.
NETACEA_PROTECTION_MODEThe Protection Mode for the integration.

The following variables should be set as sensitive:

NameDescription
NETACEA_API_KEYAPI Key to contact Netacea services.
NETACEA_COOKIE_ENCRYPTION_KEYKey used to secure the session cookie.
NETACEA_SECRET_KEYAdditional key for securing the session cookie.
NETACEA_KINESIS_ACCESS_KEYKey to write to Netacea Kinesis ingest.
NETACEA_KINESIS_SECRET_KEYKey to write to Netacea Kinesis ingest.
NETACEA_KINESIS_STREAM_NAMEName of the stream to write ingested logs.

Middleware Setup

The following code should be placed in the middleware.ts file within your project:

import { NextRequest, NextResponse } from 'next/server'
import { waitUntil } from '@vercel/functions'
import {
  NetaceaVercelIntegration,
  getNetaceaArgsFromEnv,
  type NetaceaVercelIntegrationArgs
} from '@netacea/vercel'

let netaceaWorker: NetaceaVercelIntegration | undefined = undefined

export default async function middleware(req: NextRequest) {
  try {
    /**
     * Initialize the Netacea worker.
     */
    if (netaceaWorker === undefined) {
      netaceaWorker = new NetaceaVercelIntegration({
        ...getNetaceaArgsFromEnv(process.env)
      } as NetaceaVercelIntegrationArgs)
    }

    // Run Netacea integration
    const event = { request: req }
    const netaceaResult = await netaceaWorker.run(event, originRequest)

    // Asynchronously ingest the Netacea result, without adding latency to the request
    waitUntil(netaceaWorker.ingest(req, netaceaResult))

    return netaceaResult.response
  } catch (error) {
    console.error("Netacea Middleware Error:", error)
    return NextResponse.next()
  }
}

async function originRequest(request: Request): Promise<NextResponse> {
  return NextResponse.next({
    headers: request.headers
  })
}

FAQs

Package last updated on 01 Apr 2026

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