Appearance
SDK Installation
Current version: @holyheld/sdk@4.1.5 · npm · changelog
Requirements: Node.js 18+
You can add the Holyheld SDK to your project using any package manager:
bash
npm install @holyheld/sdkbash
yarn add @holyheld/sdkbash
pnpm add @holyheld/sdkNode.js Buffer polyfill
The SDK requires a Node.js Buffer global. In Node.js environments this is available automatically. In browser bundlers that do not include Node.js built-ins (Webpack 5, Vite), you must add a polyfill.
Vite
Install the polyfill package and update vite.config.ts:
bash
npm install --save-dev vite-plugin-node-polyfillsbash
yarn add --dev vite-plugin-node-polyfillsbash
pnpm add --save-dev vite-plugin-node-polyfillstypescript
// vite.config.ts
import { defineConfig } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
export default defineConfig({
plugins: [
nodePolyfills({
include: ['buffer'],
}),
],
});Webpack 5
Webpack 5 removed automatic Node.js polyfills. Configure resolve.fallback in your webpack config:
javascript
// webpack.config.js
const { ProvidePlugin } = require('webpack');
module.exports = {
resolve: {
fallback: {
buffer: require.resolve('buffer/'),
},
},
plugins: [
new ProvidePlugin({
Buffer: ['buffer', 'Buffer'],
}),
],
};Install the buffer package if not already present:
bash
npm install --save-dev bufferbash
yarn add --dev bufferbash
pnpm add --save-dev bufferNext.js
Next.js is based on webpack 5. Apply the webpack config above inside next.config.js under config.resolve.fallback using the webpack option.
