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

@resypress/theme-sdk

v0.1.3

Published

SDK for building ResyPress themes - reusable components, API services, and utilities

Readme

@resypress/theme-sdk

SDK for building ResyPress themes - reusable components, API services, and utilities.

License: MIT

Open Source

This project is open source and available under the MIT License.

Installation

npm install @resypress/theme-sdk

Quick Start

Initialize the SDK

The SDK automatically detects configuration from multiple sources. You can initialize it with minimal or no configuration:

import { init } from '@resypress/theme-sdk';

// Option 1: Auto-detect from domain (recommended for production)
// The SDK will automatically detect account from the current domain
await init();

// Option 2: Override specific values
await init({
  accountID: '123',
  apiBaseUrl: 'https://api.resypress.com/api',
  locale: 'en',
});

// Option 3: Use environment variables in development
// In your theme project, create a .env file with:
// VITE_RESYPRESS_ACCOUNT_ID=123
// VITE_RESYPRESS_API_BASE_URL=http://localhost:8080/api
// VITE_RESYPRESS_LOCALE=en
// Then pass them to init():
await init({
  accountID: import.meta.env.VITE_RESYPRESS_ACCOUNT_ID,
  apiBaseUrl: import.meta.env.VITE_RESYPRESS_API_BASE_URL || '/api',
  locale: import.meta.env.VITE_RESYPRESS_LOCALE || 'en',
});

Configuration Priority

The SDK uses the following priority order (highest to lowest):

  1. Explicit init() options - Values passed directly to init()
  2. localStorage overrides - For runtime testing (useful for development)
    • RESYPRESS_ACCOUNT_ID
    • RESYPRESS_API_BASE_URL
    • RESYPRESS_LOCALE
  3. window.RESYPRESS__CONFIG - Injected config object (from config.json or server-side)
  4. Domain auto-detection - Automatically detects account from current hostname
    • Uses the FULL domain name (e.g., example.com or www.example.com)
    • Matches backend's WebsiteDomain lookup behavior (looks up by full domain_value)
    • Skips localhost and IP addresses
  5. Default values - Fallback defaults (/api for base URL, en for locale)

Environment Variables in Development

For development, you can use environment variables in your theme project's .env file:

VITE_RESYPRESS_ACCOUNT_ID=123
VITE_RESYPRESS_API_BASE_URL=http://localhost:8080/api
VITE_RESYPRESS_LOCALE=en

Then pass them to init():

await init({
  accountID: import.meta.env.VITE_RESYPRESS_ACCOUNT_ID,
  apiBaseUrl: import.meta.env.VITE_RESYPRESS_API_BASE_URL || '/api',
  locale: import.meta.env.VITE_RESYPRESS_LOCALE || 'en',
});

Note: The SDK cannot directly access your project's import.meta.env at runtime, so you need to pass environment variables explicitly to init().

Use API Services

import { apiClient } from '@resypress/theme-sdk';

// Make API calls
const properties = await apiClient('/public/{accountID}/properties');

Use Utilities

import { getText } from '@resypress/theme-sdk';

// Handle multilingual strings
const name = getText(property.name, 'en'); // Returns 'en' version or fallback

Features

  • Core Configuration - Initialize and manage SDK configuration
  • API Client - Type-safe API client with error handling
  • i18n Utilities - Multilingual string handling
  • 🚧 React Components - Coming soon
  • 🚧 React Hooks - Coming soon
  • 🚧 Additional Services - Coming soon

Documentation

Full documentation is available in THEME_SDK.md.

Development

# Install dependencies
npm install

# Build the library
npm run build

# Type check
npm run type-check

# Watch mode
npm run dev

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.