Skip to main content

Getting started with Collab Actions

Collab Actions is a collection of tools designed to help create miniapps for the Collab.Land marketplace. By using Collab Actions, the setup and configuration of the Collab.Land infrastructure, which includes Docker, AWS, security measures, and authentication, is automatically managed for you.

Collab.Land Action Templates

To get started, use any of the Collab Action templates we provide on GitHub:

  1. Express Action template
  2. Loopback Action template
  3. Python Action template

If you don't want to use a template, you can create your own Collab Action from scratch. Check out Build a Custom Collab Action for detailed instructions.

OSS Miniapp Examples

If you would prefer to get some insights or explore the implementation details of some existing miniapps, here are a few repositories to get you started:

  1. Chainpatrol
  2. Huddle01
  3. Token Price

Prerequisites

  • Node.js and npm (Node Package Manager) must be installed on your system.

Using a Collab Action template

  1. Fork the Action template repository from GitHub.
  2. Clone the project.
git clone [PROJECT_URL.git]
  1. Navigate to the project directory and install the project dependencies.
cd collabland-action-express
npm install
  1. Build the project
npm run build

Run the Action server locally

To run the server, you'll need a public key for the Action. You can get the public key from the Collab.Land QA config endpoint by going to https://api-qa.collab.land/config from your browser:

{
"actionEcdsaPublicKey": "0x043b30458cf281461de368fd591b4c9b511a1b9263cea48517f41217ba14aa714fefea1adcfc9d8ae7ec0b4f7272f472178a5e674a1229ce5d2f2526244d62fbd8",
"actionEd25519PublicKey": "DhF7T98EBmH1ZFmdGJvBhkmdn3BfAqc3tz8LxER8VH2q"
}
  1. Download and install ngrok from https://ngrok.com/download.

  2. Run the Action server:

    npm run server -- DhF7T98EBmH1ZFmdGJvBhkmdn3BfAqc3tz8LxER8VH2q

    This will start the server on port 3000. From a different terminal window, run ngrok on the same port to expose the server to other applications on the internet:

    ngrok http 3000
  3. Copy the HTTPS URL, for example:

    https://0c49-2601-646-9e00-80-3964-47d-7146-ff13.ngrok.io/

Your URL will be different.

To get the Action URL, append /hello-action to the end of the ngrok URL. For example: https://0c49-2601-646-9e00-80-3964-47d-7146-ff13.ngrok.io/hello-action

Repeat the same process to get the Action URL for the other Action types:

  • /button-action - Returns a button for users to interact with and
  • /popup-action - Shows a pop up modal to the users for subsequent interactions.

Test the Actions in a Discord server

With the Action server running, you can now test the Action in a Discord server using the Collab.Land QA bot. But first, you'll need to install the Collab.Land TestFlight mini-app on your Discord server. The steps are outlined below.

Create a test Discord server

Follow the instructions on the Discord documentation to create a test Discord server.

Install the Collab.Land QA Bot on Discord

  1. Sign in to the Discord server where you would like to run your Action.
  2. Invite the QA Bot to your server.

Bot Authentication

  1. Grant the required permissions:

Grant Bot Required Permissions

Upon Authorization, you will be redirected to the Collab.Land Command Center. It is a password-protected site with the following credentials:

  • Username: collabland
  • Password: nft1024

To access the Command Center again, go to: https://cc-qa.collab.land

Create a Community Wallet

  1. In the Command Center, go to the Marketplace tab.
  2. Click on the "Create community wallet" button.
  3. You will receive a message saying "Wallet successfully created” and access to the marketplace apps.

Create a Community Wallet

Install the TestFlight Mini-App

  1. In the Marketplace tab, you will see all the available mini-apps, including Test Flight.
  2. Click on the "Install" button for the Test Flight app.
  3. The mini-app modal will pop up for you, click "Free Install" to install the app.

Installing the Test Flight Mini App from Collab.Land Markeplace

Go to the Discord server where you installed the Collab.Land QA bot and type /test to see all the newly installed slash commands that are made available through the “Test Flight” mini app.

Test fligh commands

Install the Action on your Discord server

Select the /test-flight install command and enter the Action URL you created earlier using ngrok in the action-url field. For example, here we entered: https://0c49-2601-646-9e00-80-3964-47d-7146-ff13.ngrok.io/hello-action to test the /hello-action interaction.

Installing hello-action

You will get a message with a description of the Action that you are about to install. Click the “Install the action” button. You will get a confirmation that the “action is installed”.

Installed hello-action mini app

Test the Action

You and your users can now use the Action in the Discord server by running your slash commands!

Test hello-action

To customize this Action and test it locally, follow this guide.