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

@base-org/account

v2.5.1

Published

Base Account SDK

Downloads

1,673,508

Readme

Base Account SDK

Base Account SDK allows dapps to connect to Base Account

  1. Base Account

Installing Base Account SDK

  1. Check available versions:

      # yarn
      yarn info @base-org/account versions
    
      # npm
      npm view @base-org/account versions
  2. Install latest version:

    # yarn
    yarn add @base-org/account
    
    # npm
    npm install @base-org/account
  3. Check installed version:

    # yarn
    yarn list @base-org/account
    
    # npm
    npm list @base-org/account

Upgrading Base Account SDK

  1. Compare the installed version with the latest:

    # yarn
    yarn outdated @base-org/account
    
    # npm
    npm outdated @base-org/account
  2. Update to latest:

    # yarn
    yarn upgrade @base-org/account --latest
    
    # npm
    npm update @base-org/account

Basic Usage

  1. Initialize Base Account SDK

    const sdk = createBaseAccountSDK({
      appName: 'SDK Playground',
    });
  2. Make Base Account Provider

    const provider = sdk.getProvider();
  3. Request accounts to initialize a connection to wallet

    const addresses = provider.request({
      method: 'eth_requestAccounts',
    });
  4. Make more requests

    provider.request('personal_sign', [
      `0x${Buffer.from('test message', 'utf8').toString('hex')}`,
      addresses[0],
    ]);
  5. Handle provider events

    provider.on('connect', (info) => {
      setConnect(info);
    });
    
    provider.on('disconnect', (error) => {
      setDisconnect({ code: error.code, message: error.message });
    });
    
    provider.on('accountsChanged', (accounts) => {
      setAccountsChanged(accounts);
    });
    
    provider.on('chainChanged', (chainId) => {
      setChainChanged(chainId);
    });
    
    provider.on('message', (message) => {
      setMessage(message);
    });

Developing locally and running the test dapp

  • The Base Account SDK test dapp can be viewed here https://base.github.io/account-sdk/.

  • To run it locally follow these steps:

    1. Fork this repo and clone it
    2. From the root dir run yarn install
    3. From the root dir run yarn dev

Script Tag Usage

Base Accunt can be used directly in HTML pages via a script tag, without any build tools:

<!-- Via unpkg -->
<script src="https://unpkg.com/@base-org/account/dist/base-account.min.js"></script>

<!-- Via jsDelivr -->
<script src="https://cdn.jsdelivr.net/npm/@base-org/account/dist/base-account.min.js"></script>

Once loaded, the SDK is available as window.base and window.createBaseAccountSDK:

// Make a payment
const result = await window.base.pay({
  amount: "10.50",
  to: "0xYourAddress...",
  testnet: true
});

// Check payment status
const status = await window.base.getPaymentStatus({
  id: result.id,
  testnet: true
});

// Create Base Account Provider
const provider = window.createBaseAccountSDK().getProvider()