npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@blobkit/sdk

v3.1.8

Published

TypeScript SDK for blob storage with EIP-4844 support and browser compatibility

Readme

@blobkit/sdk

TypeScript SDK for EIP-4844 blob storage on Ethereum. Supports browser and Node.js environments.

Installation

npm install @blobkit/sdk ethers

Usage

Browser

import { BlobKit } from '@blobkit/sdk';
import { ethers } from 'ethers';

const provider = new ethers.BrowserProvider(window.ethereum);
const signer = await provider.getSigner();

const blobkit = new BlobKit(
  {
    rpcUrl: process.env.BLOBKIT_RPC_URL!,
    chainId: 1,
    proxyUrl: 'https://proxy.example.com',
    requestSigningSecret: 'shared-secret-with-proxy'
  },
  signer
);

const result = await blobkit.writeBlob({ message: 'Hello world' }, { appId: 'my-app' });

console.log('Blob hash:', result.blobHash);
console.log('Transaction:', result.blobTxHash);

Node.js

import { BlobKit, createFromEnv } from '@blobkit/sdk';
import { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider(process.env.BLOBKIT_RPC_URL);
const signer = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);

// Option 1: From environment variables
const blobkit = createFromEnv(signer);

// Option 2: Manual configuration
const blobkit = new BlobKit(
  {
    rpcUrl: process.env.BLOBKIT_RPC_URL!,
    chainId: 1
  },
  signer
);

const result = await blobkit.writeBlob(data);
console.log('Blob hash:', result.blobHash);

Reading Blobs

BlobKit supports reading blob data from transactions:

// Read blob data by transaction hash
const blobData = await blobkit.readBlob(txHash);
console.log('Blob data:', blobData.data);
console.log('Source:', blobData.source); // 'rpc', 'archive', or 'fallback'

// Read specific blob by index (for transactions with multiple blobs)
const secondBlob = await blobkit.readBlob(txHash, 1);

// Read and decode as string
const text = await blobkit.readBlobAsString(txHash);
console.log('Text content:', text);

// Read and decode as JSON
const json = await blobkit.readBlobAsJSON(txHash);
console.log('JSON data:', json);

Archive Support

If you configure an archiveUrl, BlobKit will attempt to read blobs from your archive first:

const blobkit = new BlobKit(
  {
    rpcUrl: 'https://mainnet.infura.io/v3/YOUR_PROJECT_ID',
    archiveUrl: 'https://your-blob-archive.com',
    chainId: 1
  },
  signer
);

The archive URL should serve blob data at ${archiveUrl}/${blobTxHash} as binary data.

Configuration

Environment Variables

BLOBKIT_RPC_URL=https://rpc.flashbots.net
BLOBKIT_CHAIN_ID=1
BLOBKIT_PROXY_URL=https://custom-proxy.example.com
BLOBKIT_ESCROW_1=0x1234567890123456789012345678901234567890
BLOBKIT_LOG_LEVEL=info

Testing and Development

npm test               # Run tests
npm run test:coverage  # Run tests with coverage
npm run build          # Build distribution
npm run lint           # Lint code
npm run type-check     # TypeScript checking

KZG Trusted Setup

BlobKit requires a KZG trusted setup for creating blob commitments and proofs. This is handled automatically in most cases:

Browser Environment

In browsers, the SDK uses a lightweight WASM implementation that includes the necessary trusted setup data.

Node.js Environment

In Node.js, the SDK can use either:

  1. Built-in Setup (default): The SDK includes the official Ethereum mainnet trusted setup
  2. Custom Setup: Provide your own trusted setup file path
// Using built-in setup (recommended)
const blobkit = new BlobKit(
  {
    rpcUrl: process.env.BLOBKIT_RPC_URL!,
    chainId: 1
  },
  signer
);

// Using custom trusted setup
const blobkit = new BlobKit(
  {
    rpcUrl: process.env.BLOBKIT_RPC_URL!,
    chainId: 1,
    kzgSetup: {
      trustedSetupPath: '/path/to/trusted_setup.txt'
    }
  },
  signer
);

Trusted Setup File Format

The trusted setup file should contain the powers of tau ceremony results in the standard format used by Ethereum. You can download the official setup from the Ethereum KZG Ceremony.

Documentation

See /docs/sdk/ for complete API reference.