
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@shopkit/core
Advanced tools
Core storefront utilities including theme management and authentication context.
npm install @shopkit/core
# or
bun add @shopkit/core
npm install react react-dom next
// app/layout.tsx (Server Component)
import { getActiveTheme } from '@shopkit/core/theme/server';
import { ThemeProvider } from '@shopkit/core/theme/client';
export default async function RootLayout({ children }) {
const theme = await getActiveTheme('my-merchant');
return (
<html>
<body>
<ThemeProvider merchantName="my-merchant" initialTheme={theme}>
{children}
</ThemeProvider>
</body>
</html>
);
}
// components/MyComponent.tsx (Client Component)
'use client';
import { useTheme } from '@shopkit/core/theme/client';
export function MyComponent() {
const { theme, getValue } = useTheme();
const primaryColor = getValue('colors.primary', '#000000');
return <div style={{ color: primaryColor }}>Themed content</div>;
}
import type { ThemeConfig } from '@shopkit/core';
const themeConfig: ThemeConfig = {
colors: {
primary: '#1a1a1a',
secondary: '#666666',
accent: '#0066cc',
background: '#ffffff',
text: '#1a1a1a',
},
typography: {
fontFamily: {
heading: '"Inter", sans-serif',
body: '"Inter", sans-serif',
},
fontSize: {
xs: '0.75rem',
sm: '0.875rem',
base: '1rem',
lg: '1.125rem',
xl: '1.25rem',
'2xl': '1.5rem',
'3xl': '1.875rem',
'4xl': '2.25rem',
},
fontWeight: {
normal: '400',
medium: '500',
semibold: '600',
bold: '700',
},
},
spacing: {
xs: '0.25rem',
sm: '0.5rem',
md: '1rem',
lg: '1.5rem',
xl: '2rem',
'2xl': '3rem',
},
borderRadius: {
none: '0',
sm: '0.25rem',
md: '0.375rem',
lg: '0.5rem',
full: '9999px',
},
};
import { generateThemeCSS, getCSSVariableMap } from '@shopkit/core/theme';
// Generate CSS string
const css = generateThemeCSS(themeConfig);
// Output: :root { --colors-primary: #1a1a1a; --typography-font-family-heading: "Inter", sans-serif; ... }
// Get variable map
const varMap = getCSSVariableMap(themeConfig);
// { 'colors.primary': '--colors-primary', 'typography.fontFamily.heading': '--typography-font-family-heading', ... }
import { createThemeRegistry } from '@shopkit/core/theme';
const registry = createThemeRegistry({
basePath: './src/themes',
});
// Load theme for a merchant
const theme = await registry.loadTheme('my-merchant', 'light');
import { useTheme } from '@shopkit/core/theme/client';
function MyComponent() {
const {
theme, // Current theme object
getValue, // Get a theme value by path
getCSSVar, // Get CSS variable reference
merchantName, // Current merchant name
} = useTheme();
// Get value with fallback
const color = getValue('colors.accent', '#default');
// Get CSS variable reference
const cssVar = getCSSVar('colors.primary');
// Returns: 'var(--colors-primary)'
}
// app/layout.tsx
import { AuthProvider } from '@shopkit/core/context';
export default function RootLayout({ children }) {
return (
<AuthProvider>
{children}
</AuthProvider>
);
}
'use client';
import { useAuth } from '@shopkit/core/context';
function AccountButton() {
const { customer, isAuthenticated, login, logout } = useAuth();
if (isAuthenticated) {
return (
<div>
<span>Welcome, {customer.firstName}</span>
<button onClick={logout}>Logout</button>
</div>
);
}
return <button onClick={() => login()}>Login</button>;
}
// Main entry (everything)
import { ThemeProvider, AuthProvider } from '@shopkit/core';
// Theme module
import { ThemeConfig, Theme } from '@shopkit/core/theme';
// Theme client (React components/hooks)
import { ThemeProvider, useTheme } from '@shopkit/core/theme/client';
// Theme server (SSR utilities)
import { getActiveTheme, configureThemeLoader } from '@shopkit/core/theme/server';
// Context module (Auth)
import { AuthProvider, useAuth } from '@shopkit/core/context';
// Theme configuration (what you define)
interface ThemeConfig {
colors?: Record<string, string>;
typography?: {
fontFamily?: Record<string, string>;
fontSize?: Record<string, string>;
fontWeight?: Record<string, string>;
lineHeight?: Record<string, string>;
};
spacing?: Record<string, string>;
borderRadius?: Record<string, string>;
[key: string]: unknown;
}
// Resolved theme (what you use)
interface Theme {
id: string;
name: string;
role: ThemeRole;
config: ThemeConfig;
}
// Theme roles
type ThemeRole = 'light' | 'dark' | 'high-contrast';
interface ThemeContextValue {
theme: Theme | null;
merchantName: string;
isLoading: boolean;
getValue: <T>(path: string, defaultValue?: T) => T;
getCSSVar: (path: string) => string;
}
import { pathToCssVar, cssVarRef } from '@shopkit/core/theme';
pathToCssVar('colors.primary'); // '--colors-primary'
cssVarRef('colors.primary'); // 'var(--colors-primary)'
import { flattenObject, unflattenObject } from '@shopkit/core/theme';
const flat = flattenObject({ colors: { primary: '#000' } });
// { 'colors.primary': '#000' }
const nested = unflattenObject({ 'colors.primary': '#000' });
// { colors: { primary: '#000' } }
import { resolveThemeValue, hasThemeValue } from '@shopkit/core/theme';
const theme = { config: { colors: { primary: '#000' } } };
resolveThemeValue(theme, 'colors.primary'); // '#000'
hasThemeValue(theme, 'colors.primary'); // true
hasThemeValue(theme, 'colors.nonexistent'); // false
import { createPageBuilder } from '@shopkit/builder';
import { createThemeRegistry } from '@shopkit/core/theme';
const themeRegistry = createThemeRegistry({
basePath: './src/themes',
});
const pageBuilder = createPageBuilder({
widgets: widgetRegistry,
commerceClient: shopifyClient,
themeLoader: themeRegistry, // Implements IThemeLoader
templateLoader: templateLoader,
});
MIT
FAQs
Core storefront utilities including theme and context
We found that @shopkit/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.