Loading Activities
This guide explains how to load your activities into the PreMiD extension for testing and development.
For Non-Developers
If you're not a developer but want to test activities, jump to the Testing Activities for Non-Developers section.
Activity Developer Mode
Before you can load any activities for testing, you must enable Activity Developer Mode in the PreMiD extension. This is a required step for both automatic loading with the CLI and manual loading through the extension interface.
Enabling Activity Developer Mode
- Open the PreMiD extension by clicking on its icon in your browser's toolbar
- Go to the Settings tab
- Scroll down to the "Developer" section
- Enable the "Activity Developer Mode" toggle
When Activity Developer Mode is enabled, the PreMiD extension will accept connections from the PreMiD CLI, allowing you to load and test your activities directly from your local development environment.
Loading Activities with the CLI
The easiest way to load your activities is using the PreMiD CLI's development mode. When you run the npx pmd dev
command, the CLI will automatically:
- Build your activity
- Connect to the PreMiD extension
- Load your activity into the extension
- Watch for changes and reload the activity when you make changes
To start the development server and load your activity:
npx pmd dev "YourActivityName"
You should see a message in the console indicating that the CLI has connected to the extension and loaded your activity.
Manual Loading for Developers
Developers can manually load activities directly through the extension interface. This is useful when:
- You're troubleshooting issues with the CLI
- You want to test activities shared by other developers
- You're using a browser where the CLI connection isn't working
To load an uncompiled activity (a directory with source files):
- Enable Activity Developer Mode in the extension settings
- Go to the Developer tab in the extension
- Click on "Load Activity"
- Select the directory containing your activity files (with metadata.json and presence.ts)
Testing Activities for Non-Developers
For Users Without Development Experience
If you're not a developer but want to test activities shared by others, this section is for you!
You can easily test activities without any development experience or setup. This is perfect for:
- Testing activities shared by friends
- Trying out activities before they're published
- Testing your own custom activities created by someone else
Loading a Compiled Activity
To load a compiled activity (a zip file):
- Open the PreMiD extension by clicking on its icon in your browser's toolbar
- Go to the Settings tab
- Enable "Activity Developer Mode" (you'll find this in the Developer section)
- Go to the Developer tab in the extension
- Click on "Load Compiled Activity"
- Select the zip file containing the compiled activity
- Visit the website the activity is designed for
- Check your Discord status to see if it's showing the activity
What You Need
- A compiled activity zip file (ask the developer to provide this)
- The PreMiD extension installed in your browser
- Discord desktop app running on your computer
No coding knowledge, command line usage, or development tools are required!
Verifying Loaded Activities
To verify that your activity has been loaded correctly:
- Go to the Activities tab in the extension
- Look for your activity in the list of installed activities
- It should have a "Dev" badge next to it, indicating it's loaded in development mode
You can also check the extension's console logs for any loading errors or warnings.
Troubleshooting
If you're having trouble loading your activity:
Connection Issues
- Make sure Activity Developer Mode is enabled in the extension settings
- Check that you're running the latest version of the PreMiD extension
- Try restarting your browser
- Check if there are any firewall or security settings blocking the connection
Loading Issues
- Verify that your activity's
metadata.json
file is valid - Check the console for any build errors
- Make sure your activity's directory structure is correct
- Try manually loading the activity through the extension's developer interface
Activity Not Showing
- Make sure you're visiting a website that matches the URL pattern in your activity's
metadata.json
- Check the extension's console for any runtime errors
- Verify that your activity is properly setting presence data in the
UpdateData
event
Next Steps
Now that you know how to load activities, you can:
- Learn how to use the Developer Tools to debug your activities
- Explore Best Practices for creating high-quality activities
- Learn about Versioning to support multiple API versions