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

@simpleapps-com/augur-server

v2.3.1

Published

Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)

Readme

@simpleapps-com/augur-server

Server-side utilities for Augur ecommerce sites (Redis caching, SDK helpers, auth)

Auto-generated. Do not edit manually. Regenerate with: pnpm run generate-exports

Part of the @simpleapps-com/augur-* platform. All packages use fixed versioning (same version number).

Install

pnpm add @simpleapps-com/augur-server

Peer Dependencies

@simpleapps-com/augur-api, @tanstack/react-query, ioredis, next, next-auth, react

Entry Points

| Import | Description | |--------|-------------| | @simpleapps-com/augur-server | 27 exports, 3 types | | @simpleapps-com/augur-server/auth | 1 exports, 6 types | | @simpleapps-com/augur-server/query | 2 exports, 1 types | | @simpleapps-com/augur-server/testing | 5 exports, 3 types | | @simpleapps-com/augur-server/site | 1 exports, 3 types | | @simpleapps-com/augur-server/actions | 3 exports, 0 types | | @simpleapps-com/augur-server/hooks | 2 exports, 0 types | | @simpleapps-com/augur-server/query-action | 5 exports, 0 types | | @simpleapps-com/augur-server/api | 1 exports, 0 types | | @simpleapps-com/augur-server/next-auth | 0 exports, 0 types |

Exports

Auth & Context

| Export | Kind | Description | |--------|------|-------------| | QueryOptionsConfig | value | | | createQueryOptions | value | | | createSiteActions | function | | | createSuspenseQueryOptions | value | | | getSiteActions | function | | | registerSiteActions | function | | | createAuthConfig | function | Creates a NextAuth configuration with Joomla credential provider, session callbacks, and automatic cart initialization. | | createQueryOptions | const | Creates useQuery options with consistent key generation. | | createSuspenseQueryOptions | const | Creates useSuspenseQuery options with consistent key generation. | | clearSiteActions | function | | | createMockSiteActions | function | Creates a fully-mocked SiteActions object for testing. | | createServerSite | function | Create a server-side site instance that bundles the SDK client, server | | getSessionCredentials | function | Resolve session credentials from the Auth.js JWT cookie. | | resetSessionImports | function | Reset lazy-loaded imports. Used in tests only. @internal |

Items & Categories

| Export | Kind | Description | |--------|------|-------------| | isProduction | const | true when running on the production deployment. |

Transforms

| Export | Kind | Description | |--------|------|-------------| | paginateOffset | function | |

Utilities

| Export | Kind | Description | |--------|------|-------------| | unwrap | value | | | unwrapOr | value | | | unwrapBaseResponse | function | Unwrap SDK BaseResponse if the result matches the standard shape. |

Other

| Export | Kind | Description | |--------|------|-------------| | ActionResult | value | | | EdgeCacheValue | value | | | SafeActionResult | value | | | batchFetch | function | Fetches data for multiple params in parallel, returning a Record keyed by | | cacheGet | function | Read a cached value by key. | | cacheSet | function | Write a value to cache with a TTL. Fire-and-forget semantics: no-ops | | createServerQueryClient | function | Creates a server-side query client optimised for prefetching. | | env | const | Resolved environment: "development", "staging", or "production". | | getCircuitState | function | Returns the current circuit breaker state. | | getServerQueryClient | const | Returns a per-request singleton QueryClient for React Server Components. | | isDev | const | true when running locally (localhost / NODE_ENV=development). | | isRedisConnected | function | Whether the Redis client is connected and ready to accept commands. | | isStaging | const | true when running on the staging/dev deployment. | | safeAction | function | Wraps an async function call with error handling, returning a | | sdkCall | function | Calls an Augur SDK method, forwarding all arguments with full type safety. | | verifyRecaptcha | function | Server-side Google reCAPTCHA v3 verification. | | withServerCache | function | Server-side cache wrapper using augur-server's Redis client. | | DeepMockClient | value | | | MockClientResult | value | | | createMockClient | value | | | ApiResult | value | | | ListResult | value | | | SafeActionResult | value | | | QueryActionFn | value | | | createServerQueryProxy | function | Creates a client-side proxy that mirrors the SDK namespace and routes | | queryAction | function | Generic server action that routes any SDK method call through the raw | | resolveMethod | function | Resolve a dot-separated method path on an object, returning the leaf function. | | createAugurApiHandler | function | Creates a Next.js Route Handler that routes method calls through queryAction. |

Examples

safeAction

const result = await safeAction(
  () => actions.commerce.addToCart(cartId, items),
);
if (result.ok) {
  // result.data is the response data (undefined for void actions)
} else {
  // result.error is the error message
}

sdkCall

const result = await sdkCall(
  augurServices.items.invMast.get,
  invMastUid,
  { edgeCache: 4 },
);

createMockSiteActions

import { createMockSiteActions } from "@simpleapps-com/augur-server/testing";

const { actions, mocks } = createMockSiteActions();

// Setup return values
mocks.pricing.getItemPrice.mockResolvedValue({ price: 9.99 });

// Pass actions to your component/server action
const price = await actions.pricing.getItemPrice("ITEM-1");

// Assert calls
expect(mocks.pricing.getItemPrice.mock.calls[0]).toEqual(["ITEM-1"]);

createServerSite

import { AugurApi } from "@simpleapps-com/augur-api";
import { createServerSite } from "@simpleapps-com/augur-server";

const api = new AugurApi({ baseUrl: process.env.AUGUR_API_URL! });
export const site = createServerSite(api, {
  defaultCustomerId: "12345",
  auth: { secret: process.env.AUTH_SECRET },
});

createServerQueryProxy

import { createServerQueryProxy } from "@simpleapps-com/augur-server/hooks";

const q = createServerQueryProxy();

// Reads — any SDK method, routed through server actions
const { data: item } = useQuery(q.items.invMast.doc.get(42));
const { data: price } = useQuery(q.pricing.priceEngine.get({ itemId, customerId }));

// Infinite queries — spread and add infinite-specific options
const { data, fetchNextPage } = useInfiniteQuery({
  ...q.items.itemCategory.categoryItems.get(uid, filters),
  getNextPageParam: (lastPage) => lastPage.nextCursor,
  initialPageParam: 0,
});

// Mutations — write methods return mutation options
const addToCart = useMutation(q.commerce.cartLine.add.create());

createAugurApiHandler

// app/api/augur/route.ts
import { createAugurApiHandler } from "@simpleapps-com/augur-server/api";

const handler = createAugurApiHandler();
export const POST = handler;

Types

PaginatedResult, SiteActions, SiteActionsConfig, AugurAuthCallbacks, AugurAuthClient, AugurJWT, AugurSession, AugurUser, CreateAuthConfigOptions, QueryOptionsConfig, MockFn, MockSiteActions, MockSiteActionsResult, ServerSite, ServerSiteAuthConfig, ServerSiteConfig

Related Packages

All packages use fixed versioning -- same version number across the platform.

| Package | Description | |---------|-------------| | @simpleapps-com/augur-config | Shared tooling configuration presets for Augur ecommerce sites | | @simpleapps-com/augur-core | Universal foundation for Augur packages — proxy infrastructure, cache keys, method classification, shared types | | @simpleapps-com/augur-hooks | Cross-platform React Query hooks and Zustand stores for Augur ecommerce sites | | @simpleapps-com/augur-mobile | React Native/Expo adapters for Augur ecommerce apps (offline sync, biometrics, push) | | @simpleapps-com/augur-tailwind | Shared Tailwind CSS v4 theme with HSL variables for Augur ecommerce sites | | @simpleapps-com/augur-utils | Shared types, cache configuration, and utility functions for Augur ecommerce sites | | @simpleapps-com/augur-web | Shared React UI components for Augur ecommerce sites (Radix + Tailwind) |