Integration

Ko-fi

Connect Ko-fi to receive donations, shop purchases, and subscription events directly in FaustBot.

Overview

FaustBot integrates with Ko-fi webhooks to provide real-time notifications for supporter activity:

Donations

React to one-time coffee donations.

Shop Purchases

Handle Ko-fi shop item orders.

Subscriptions

Track monthly membership events.

Commission Orders

Receive commission request notifications.

Supporter Messages

Display messages from supporters.

Webhook Security

Verify authentic Ko-fi events.

Setup

Configure Ko-fi Webhook

Ko-fi uses webhooks to send events to FaustBot. You'll need to set up the webhook URL in your Ko-fi account.

1

Get Webhook URL from FaustBot

In FaustBot, go to Integrations → Ko-fi. Copy the Webhook URL shown at the top of the settings panel.

2

Configure Ko-fi

Log in to Ko-fi and go to Settings → API. Paste the webhook URL into the Webhook URL field.

Screenshot: Ko-fi API settings
3

Copy Verification Token

Copy your Verification Token from Ko-fi and paste it into FaustBot's Ko-fi settings. This ensures only authentic Ko-fi events are processed.

4

Test the Connection

Click Send Test in Ko-fi to verify the webhook is working. You should see a test event appear in FaustBot's logs.

Port Forwarding Required

Ko-fi webhooks require your FaustBot instance to be accessible from the internet. You may need to configure port forwarding or use a tunnel service like ngrok.

Triggers

Respond to Ko-fi events:

Donation Received Someone bought you a coffee
Shop Purchase Someone purchased a shop item
Subscription Started New monthly supporter
Subscription Renewed Monthly supporter renewed
Subscription Ended Supporter cancelled membership
Commission Ordered New commission request

Trigger Variables

These variables are available in your actions:

%kofiAmount% Donation/purchase amount
%kofiCurrency% Currency code (USD, EUR, GBP)
%kofiMessage% Supporter's message
%kofiFromName% Supporter's display name
%kofiEmail% Supporter's email (if provided)
%kofiType% Event type (Donation, Subscription, etc.)
%kofiIsPublic% Whether the donation is public
%kofiTierName% Membership tier name (subscriptions)

Effects

Supporter Management

Grant VIP Status

Give supporters special chat privileges.

Add to Group

Add supporter to a user group.

Send Thank You

Send automated thank you message.

Alerts

Show Alert

Display donation on overlay.

Play Sound

Play notification sound.

TTS Message

Read donation message aloud.

Scripting API

Access Ko-fi data from your scripts:

Accessing Event Data

Access Ko-fi event data
# Get donation details from trigger
amount = CPH.GetArg("kofiAmount")
supporter = CPH.GetArg("kofiFromName")
message = CPH.GetArg("kofiMessage")
event_type = CPH.GetArg("kofiType")

# Check if it's a subscription
if event_type == "Subscription":
    tier = CPH.GetArg("kofiTierName")
    CPH.LogInfo(f"{supporter} subscribed to {tier}!")
else:
    CPH.LogInfo(f"{supporter} donated {amount}!")

Responding to Donations

Respond to Ko-fi donations
# Thank the supporter in chat
supporter = CPH.GetArg("kofiFromName")
amount = CPH.GetArg("kofiAmount")
currency = CPH.GetArg("kofiCurrency")

CPH.SendMessage(f"Thank you {supporter} for the {amount} {currency} coffee! You're amazing!")

# Play a sound alert
CPH.PlaySound("kofi_alert.mp3")

# Trigger OBS scene change
CPH.ObsShowSource("Alerts", "KofiDonation")

Tracking Supporters

Track supporter totals
# Save supporter to database
supporter = CPH.GetArg("kofiFromName")
amount = float(CPH.GetArg("kofiAmount"))

# Get current total
current_total = CPH.GetGlobalVar("kofi_total_" + supporter, 0)
new_total = current_total + amount

# Save new total
CPH.SetGlobalVar("kofi_total_" + supporter, new_total)

CPH.LogInfo(f"{supporter} has donated {new_total} total via Ko-fi")

See the full API reference for all available methods.