Adding Components
Learn how to add uploaded unify components using the Unify CLI.
What is a Component?
Components are modules that follow the Unify structure and that are accessable through Unify CLI.
Adding Components via CLI
To add a component, you simply use the npx unify-rocks@latest add command followed by the component name. The CLI automatically fetches the component from the official Unify component repository.
npx unify-rocks@latest add MonetizationClientyou can also add a unify component from a url:
npx unify-rocks@latest add "https://example.com/AdminServer.luau"Once added, the component will appear in your Packages folder under ReplicatedStorage.
Example File Structure
Here’s how your project structure may look after adding the MonetizationClient component:
Using Your Component
Once the component is added, you can require it in your scripts like so with:
Unify:Get("MonetizationClient")Make Your Own Component Accessable
Once your component is ready and hosted online, you can add it to your project using the Unify CLI:
npx unify-rocks@latest add "https://yourdomain.com/YourComponentClient.luau"The CLI will automatically detect the type based on the filename (Client or Server) and place it in the correct location in your project.
