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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@quantabit/sdk-config

v1.1.0

Published

QuantaBit SDK unified configuration management - Shared API config for all SDKs

Downloads

5,533

Readme

@quantabit/sdk-config

QuantaBit SDK unified config management. All SDKs share this config — modify once, apply everywhere.

Features

  • 🔧 Unified Configuration - All SDKs share API URL, timeout, and other settings
  • 🌍 Environment Presets - One-click switching between dev, staging, and production
  • 🔄 Dynamic Updates - Runtime configuration changes supported
  • ⚛️ React Hook - Convenient useSDKConfig Hook
  • 🔐 Token Management - Unified authentication token storage and management
  • 📝 Logging System - Configurable log levels

Installation

npm install @quantabit/sdk-config
# or
yarn add @quantabit/sdk-config

Quick Start

1. Initialize Configuration at App Startup

// app/layout.tsx or main.jsx
import { initConfig } from "@quantabit/sdk-config";

// Use custom configuration
initConfig({
  apiBaseUrl: "https://api.yoursite.com/api/v1",
  timeout: 15000,
  debug: process.env.NODE_ENV !== "production",
});

// Or use environment preset
import { initWithEnvironment } from "@quantabit/sdk-config";
initWithEnvironment("production");

2. Using Hooks in Components

import { useSDKConfig } from "@quantabit/sdk-config";

function SettingsPanel() {
  const { config, setApiBaseUrl } = useSDKConfig();

  return (
    <div>
      <p>Current API: {config.apiBaseUrl}</p>
      <button onClick={() => setApiBaseUrl("https://new-api.com")}>
        Switch API
      </button>
    </div>
  );
}

3. Using in Other SDKs

// Internal use by other SDKs
import { getConfig, buildApiUrl, getToken } from "@quantabit/sdk-config";

async function fetchData() {
  const config = getConfig();
  const url = buildApiUrl("/users/me");
  const token = getToken();

  const response = await fetch(url, {
    headers: {
      Authorization: `Bearer ${token}`,
    },
    timeout: config.timeout,
  });

  return response.json();
}

API Reference

Configuration Functions

| Function | Description | | ------------------------------------- | --------------------------------------- | | getConfig() | Get current config object | | initConfig(options) | Initialize config (call at app startup) | | setApiBaseUrl(url) | Set API base URL | | setWsBaseUrl(url) | Set WebSocket URL | | setDebug(debug) | Set debug mode | | resetConfig() | Reset to default config | | subscribeConfig(listener) | Subscribe to config changes | | initWithEnvironment(env, overrides) | Initialize with environment preset |

Token Management

| Function | Description | | ----------------------------- | ---------------------- | | getToken() | Get access token | | getRefreshToken() | Get refresh token | | saveTokens(access, refresh) | Save tokens | | clearTokens() | Clear all tokens | | isAuthenticated() | Check if authenticated |

Utility Functions

| Function | Description | | ----------------------------------- | ------------------ | | buildApiUrl(endpoint, useFullUrl) | Build full API URL | | logger.debug/info/warn/error | Log output |

Configuration

| Option | Type | Default | Description | | ------------ | ------- | --------------- | -------------------- | | apiBaseUrl | string | /api/v1 | API base path | | apiFullUrl | string | '' (required) | Full API URL | | timeout | number | 30000 | Request timeout (ms) | | retryCount | number | 3 | Retry count | | debug | boolean | false | Debug mode | | logLevel | string | info | Log level | | wsBaseUrl | string | '' (required) | WebSocket URL |

Environment Presets

import { initWithEnvironment } from "@quantabit/sdk-config";

// Development
initWithEnvironment("development");

// Staging
initWithEnvironment("staging");

// Production
initWithEnvironment("production");

// With override config
initWithEnvironment("production", {
  timeout: 10000,
});

Integration with Other SDKs

All QuantaBit SDKs should read configuration from this package:

// In auth-sdk, wallet-sdk, etc.
import {
  getConfig,
  buildApiUrl,
  getToken,
  logger,
} from "@quantabit/sdk-config";

class ApiClient {
  async request(endpoint, options = {}) {
    const config = getConfig();
    const url = buildApiUrl(endpoint);
    const token = getToken();

    logger.debug("Requesting:", url);

    const response = await fetch(url, {
      ...options,
      headers: {
        "Content-Type": "application/json",
        Authorization: token ? `Bearer ${token}` : undefined,
        ...options.headers,
      },
    });

    return response.json();
  }
}

License

MIT © QuantaBit Team


🌐 Brand & Links