
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
@consensys/ds3-config
Advanced tools
> 🚧 **Note**: This package is under active development. While we're working hard to make it production-ready, please be aware that APIs and features may change. We welcome your feedback and contributions as we continue to improve!
🚧 Note: This package is under active development. While we're working hard to make it production-ready, please be aware that APIs and features may change. We welcome your feedback and contributions as we continue to improve!
🔧 Unified configuration layer for the DS3 ecosystem
Build consistent, type-safe applications across web and React Native with a single configuration layer that handles framework integration, theming, and build tooling.
// One configuration. Any platform. Native everywhere.
import { vitePlugin } from '@consensys/ds3-config/vite';
import { nativewindPreset } from '@consensys/ds3-config/nativewind';
🔄 Framework Integration - Seamless setup for Vite, Expo, and React Native with optimized defaults
🎨 Theme Integration - Unified theming system that works across all platforms
🔧 Build Tooling - Comprehensive build configurations for web and native development
📱 Cross-Platform - Consistent configuration patterns for web and React Native
🛠️ Type Safety - Full TypeScript support with comprehensive type definitions
🏗️ Workspace Support - Optimized for monorepo setups with proper module resolution
pnpm add @consensys/ds3-config
The configuration system follows a three-step process to make your theme available throughout your application:
theme.config.ts
Each platform has its own way of accessing global variables:
For detailed theme configuration options, see the @consensys/ds3-theme documentation.
// theme.config.ts
import { UserConfig } from '@consensys/ds3-theme'
export default {
themes: {
default: {
colors: {
neutral: 'gray',
primary: 'blue',
secondary: 'violet',
error: 'red',
warning: 'amber',
success: 'green',
},
},
},
} satisfies UserConfig;
The Vite plugin provides optimized defaults for web development:
// vite.config.ts
import { defineConfig } from 'vite'
import ds3 from '@consensys/ds3-config/vite';
import themeConfig from "./theme.config";
export default defineConfig(({ command }) => ({
plugins: [
ds3(command, themeConfig),
],
}));
The plugin automatically:
import.meta.env.DS3
You can access the theme configuration in your application using:
const theme = import.meta.env.DS3;
See vite.plugin.ts for implementation details. See vite.config.ts for usage example.
The NativeWind preset combines Tailwind and React Native styling:
// tailwind.config.js
import nativewindPreset from "@consensys/ds3-config/nativewind";
import themeConfig from "./theme.config";
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
'./node_modules/@consensys/ds3/**/*.{js,jsx,ts,tsx}',
],
presets: [nativewindPreset(themeConfig)]
}
See nativewind.preset.ts for implementation details. See tailwind.config.js for usage example.
Expo-specific configurations for React Native development:
// app.config.js
import withDs3 from '@consensys/ds3-config/expo';
import themeConfig from './theme.config';
module.exports = ({ config }) => {
return withDs3({ config, themeConfig });
};
The Expo configuration:
global.DS3
for runtime accessYou can access the theme configuration in your application using:
const theme = global.DS3;
See expo.preset.ts for implementation details. See app.config.js for usage example.
// babel.config.js
module.exports = function (api) {
api.cache(true);
return {
presets: ['@consensys/ds3-config/expo/babel'],
};
};
The babel preset automatically configures:
See babel.preset.ts for implementation details. See babel.config.js for usage example.
Metro bundler configuration for React Native:
// metro.config.js
const { getDefaultConfig } = require('expo/metro-config');
const { withDs3Workspace } = require('@consensys/ds3-config/metro');
const config = getDefaultConfig(__dirname);
module.exports = withDs3Workspace(config);
The Metro configuration:
See metro.config.ts for implementation details. See metro.config.js for usage example.
Next.js-specific configuration for web development with React Native Web support:
// next.config.mjs
import themeConfig from './theme.config.mjs';
import { withDs3 } from '@consensys/ds3-config/nextjs';
/** @type {import('next').NextConfig} */
const nextConfig = {};
export default withDs3(nextConfig, themeConfig);
The Next.js configuration:
global.DS3
for runtime accessYou can access the theme configuration in your application using:
const theme = global.DS3;
See nextjs.config.ts for implementation details. See next.config.mjs for usage example.
For complete examples, see:
@consensys/ds3-config provides a unified configuration layer that ties together the entire DS3 ecosystem:
Single Source of Truth
theme.config.ts
file configures everythingUserConfig
typeFramework Integration
Workspace Optimization
# Install dependencies
pnpm i
# Watch and build
pnpm dev
# Production build
pnpm build
We welcome contributions!
MIT
FAQs
> 🚧 **Note**: This package is under active development. While we're working hard to make it production-ready, please be aware that APIs and features may change. We welcome your feedback and contributions as we continue to improve!
We found that @consensys/ds3-config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 17 open source maintainers 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
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.