
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
ns-fivem-react-boilerplate
Advanced tools
A modern template for developing FiveM NUI interfaces using React, TypeScript, Vite, and TailwindCSS.
You can create a new project using this template in two ways:
npx ns-fivem-react-boilerplate my-fivem-resource
cd my-fivem-resource
npm install
git clone https://github.com/Nebula-Studios/ns-fivem-react-boilerplate.git my-fivem-resource
cd my-fivem-resource
rm -rf .git
npm install
my-fivem-resource/
├── src/
│ ├── components/ # React components
│ │ └── App.tsx
│ ├── hooks/ # Custom hooks
│ │ └── useNuiEvent.ts
│ ├── providers/ # Context providers
│ │ └── VisibilityProvider.tsx
│ ├── utils/ # Utilities
│ │ ├── debugData.ts
│ │ ├── fetchNui.ts
│ │ └── misc.ts
│ ├── index.css # Global styles
│ ├── main.tsx # Entry point
│ └── vite-env.d.ts # TypeScript definitions
├── index.html
├── package.json
├── vite.config.ts
├── tsconfig.json
└── postcss.config.mjs
# Start development server
npm start
# Build for development with watch mode (for FiveM)
npm run start:game
# Production build
npm run build
# Preview build
npm run preview
During development, use:
npm run start:game
This command will build the project in watch mode, automatically updating files when you make changes.
The template includes hooks and utilities for communicating with the FiveM client:
import { useNuiEvent } from "./hooks/useNuiEvent";
function MyComponent() {
useNuiEvent<{ message: string }>("showNotification", (data) => {
console.log(data.message);
});
return <div>My Component</div>;
}
import { fetchNui } from "./utils/fetchNui";
const handleClick = async () => {
try {
const response = await fetchNui<{ success: boolean }>("myCallback", {
data: "some data",
});
console.log(response.success);
} catch (error) {
console.error("Error:", error);
}
};
The VisibilityProvider
automatically manages interface visibility:
// The interface will automatically hide when ESC is pressed
// or when it receives the 'setVisible' event with false
The project uses TailwindCSS 4.0. You can customize colors and themes by modifying the CSS configuration file in src/index.css
.
TypeScript configurations are optimized for React and Vite. You can modify tsconfig.json
for your specific needs.
For FiveM development:
npm run start:game
For production:
npm run build
Built files will be in the dist/
folder and can be copied to your FiveM resource.
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)This project is released under the MIT License. See the LICENSE
file for more details.
Made with ❤️ for the FiveM community
FAQs
A React boilerplate template for FiveM NUI development
The npm package ns-fivem-react-boilerplate receives a total of 1 weekly downloads. As such, ns-fivem-react-boilerplate popularity was classified as not popular.
We found that ns-fivem-react-boilerplate 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.