For OpenClaw Users

Add Sponsor Ads
to OpenClaw

One command patches your existing OpenClaw installation with MomentScience-powered sponsor ads across all channels — Telegram, Discord, Slack, and more.

Get the Install Command

Requires OpenClaw already installed · Takes 3–5 minutes

Before You Begin

Requirements

OpenClaw Installed

OpenClaw must already be installed via the official install script. Node, git, and pnpm are set up automatically by OpenClaw's installer — no extra tools needed.

Install OpenClaw first
MomentScience API Key

You'll need a MomentScience DirectPerks API key to fetch sponsored offers. Pass it as --api-key=<KEY> in the install command below.

Supported versions: OpenClaw 2026.3.13 and 2026.3.14. The script will tell you clearly if your version isn't supported yet.
Under the Hood

What the Patch Does

The script runs fully automatically. Here's exactly what happens when you run it.

01
Detect & Verify

Finds your globally installed OpenClaw, reads its version, and confirms it's a supported release. Creates a timestamped backup of dist/ before any changes.

02
Clone & Patch

Clones the matching OpenClaw source from GitHub, copies in the ad module files, and applies diffs to wire the ad injector into the reply pipeline.

03
Build & Replace

Runs pnpm build on the patched source, then swaps the installed dist/ folder with the freshly compiled output.

04
Configure

Merges the ads config block into ~/.openclaw/openclaw.json with your API key. Skips this step safely if ads are already configured.

One Command

Install AdClaws

Replace YOUR_API_KEY with your MomentScience API key and run the command below.

curl -fsSL https://install.adclaws.io/openclaw-ads/patch.sh | bash -s -- --api-key=YOUR_API_KEY

Optional: add --frequency=5 to show one ad every 5 replies instead of the default (3).

After the script completes: run openclaw gateway restart to activate the changes.
Safe to re-run. The config step is skipped if ads already exists in openclaw.json. A timestamped dist/ backup is always created before any changes.
Rollback

The exact rollback command is printed at the end of every run. To undo manually:

# Replace <timestamp> with the backup suffix printed during install cp -r "$(npm root -g)/openclaw/dist.bak.<timestamp>" \ "$(npm root -g)/openclaw/dist" openclaw gateway restart
After Install

Configuration

The patch writes an ads block to ~/.openclaw/openclaw.json. You can edit any field after install.

{ "ads": { "enabled": true, "apiKey": "your-api-key-here", "adsPrefix": "Sponsor:\n", "frequency": { "messagesPerAd": 3 }, "formatting": { "prefix": "\n---\n", "suffix": "\n---", "separator": " \u00b7 " }, "cache": { "ttlSeconds": 3600, "maxEntries": 50 } } }
Field Default Description
adsPrefix "Sponsor:\n" Label shown before each ad. The \n puts the ad title on its own line.
frequency.messagesPerAd 3 One ad per every N replies. Increase to show ads less frequently.
formatting.prefix "\n---\n" Separator inserted before the ad block.
formatting.suffix "\n---" Separator inserted after the ad block.
cache.ttlSeconds 3600 How long fetched offers stay cached locally (in seconds).
cache.maxEntries 50 Maximum number of offers held in the local cache.
Example reply with ad
Here's what I found for your question... --- Sponsor: Stay Secure with NordVPN — Up to 74% Off! Protect your browsing with military-grade encryption. [Get The Deal](https://trk.example.com/...) ---