Manage Apps

In this guide, we will take a look at how to create and update MetaKeep apps programmatically using the MetaKeep admin APIs. You can find end-to-end working scripts here.

Prerequisites

  1. MetaKeep Console Account: Create an account on the MetaKeep console. You can sign up here.
  2. Account key and secret: Create an account key and secret from the MetaKeep console. You can refer to the documentation for more details.
  3. API signatures: All admin APIs require an API signature that is signed using the account key pair. You can refer to the documentation for more details.

Manage Apps

Step 1: Create an App

Construct the request payload with the required parameters:

  1. name: The name of your App.
  2. chainId: The chain ID of the blockchain you want the app to be associated with. You can refer to the new app API documentation here for more details.
{
  "name": "MetaKeep Solana App",
  "blockchain": {
    "chain_id": "CHAIN_ID_SOLANA_MAINNET"
  }
}

Once you have the request payload ready, you can make a POST request /v2/app/create API to create an app.

Step 2: Update the App

Construct the request payload with the app attributes you want to update. You can refer to the update app API documentation here for more details.

Here's an example payload that updates the app's name and user wallet attributes.

{
  "appId": "appId",
  "name": "New App Name",
  "userWallet": {
    "displayName": "New Display Name",
    "button": {
      "backgroundColor": "#6495ED"
    },
    "theme": { "style": "DARK" },
    "logoUrl": "https://link-to-your-logo"
  }
}

Once you have the request payload ready, you can make a POST request /v2/app/update API to update the app.

Running the demo scripts

You can find end-to-end working scripts here. To run the scripts, follow the steps below:

Step 1: Clone the MetaKeepCodeSamples repository and navigate to the admin-apis directory.

Step 2: Install all dependencies using npm install.

Step 3: Update ACCOUNT_KEY and ACCOUNT_SECRET in the .env file.

Step 4: Run npm run createApp to create an app.

Step 5: Update APP_ID in the .env file with the appId of the app you created in the previous step.

Step 6: Run npm run updateApp to update the app.

You have successfully created and updated a MetaKeep app programmatically using your account key.