Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@sei-js/coinbase-x402

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sei-js/coinbase-x402

x402 Payment Protocol

latest
Source
npmnpm
Version
0.3.10
Version published
Maintainers
3
Created
Source

@coinbase/x402

The official Coinbase facilitator package for the x402 Payment Protocol. This package provides direct access to Coinbase's hosted facilitator service, enabling seamless payment verification and settlement.

Installation

npm install @coinbase/x402

Environment Variables

This package requires CDP API keys from the Coinbase Developer Platform:

  • CDP_API_KEY_ID: Your CDP API key ID
  • CDP_API_KEY_SECRET: Your CDP API key secret

Quick Start

// Option 1: Import the default facilitator config (assumes CDP_API_KEY_ID and CDP_API_KEY_SECRET environment variables)
import { facilitator } from "@coinbase/x402";

// Option 2: Create a custom facilitator config, passing in your credentials
import { createFacilitatorConfig } from "@coinbase/x402";

const facilitator = createFacilitatorConfig(
  "your-cdp-api-key-id",
  "your-cdp-api-key-secret"
);

// Use the facilitator config in your x402 integration

Integration Examples

With Express Middleware

import express from "express";
import { paymentMiddleware } from "x402-express";
import { facilitator } from "@coinbase/x402";

const app = express();

app.use(paymentMiddleware(
  "0xYourAddress",
  {
    "/protected": {
      price: "$0.10",
      network: "base-sepolia"
    }
  },
  facilitator // Use Coinbase's facilitator
));

FAQs

Package last updated on 26 Jun 2025

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