| Summary | Integrate the donation/tip system of Ko-fi with Discourse. Reward donations with badges or group membership. | |
| Repository Link | https://github.com/magicball-network/discourse-kofi.git | |
| Install Guide | How to install plugins in Discourse |
Features
This plugin allows you to link your Ko-fi account with your Discourse community. People can donate money via Ko-fi, which in turn can grant people rewards like badges or group membership. It also allows you to couple Ko-fi subscription tiers with group memberships.
This plugin relies on the Ko-fi webhook, which will send a notification to Discourse when a payment was received.
You can configure two kinds of rewards:
- One-off rewards like badges and group memberships. These rewards are based on the total amount people have paid.
- Monthly group memberships based on subscription tiers. People remain a member of the group as long as they keep paying for that subscription tier. Group membership is re-evaluated after a month.
Besides these rewards you can also show a dashboard based on recently received payments.
The different dashboard sections can be enabled and configured to your liking.
You can import the CSV export of Ko-fi to register payments which were made before you installed this plugin.
When payments are received the plugin will match it with users based on the email address they used with the Ko-fi payment, and their Discourse email address. If these addresses are not the same, a user can claim made payments via the special Ko-fi page in the user preferences. It also allows user to hide their transaction from public display.
Configuration
You need to have a working Ko-fi account. After installing the plugin in the usual way you need to configure the Ko-fi webhook token in the plugin’s settings and configure the webhook URL to your Discourse installation: https://example.org/ko-fi/webhook
If you have done this you can send a test message from Ko-fi and check on the plugin’s status page if everything is ok.
You might want to configure rewards before enabling the webhook or importing a CSV. Otherwise you will need to reprocess the rewards to so that they are applied to the present payments.
Settings
Include a table of settings and setting descriptions
| Name | Description |
|---|---|
kofi_webhook_token |
The webhook verification token you. You can find this in your Ko-fi account. |
kofi_account |
Your Ko-fi account name. This will be used in the dashboard description and Ko-fi widget. If you enable these. |
kofi_dashboard_enabled |
Enable the donations dashboard in Discourse at https://example.org/ko-fi |
kofi_dashboard_in_menu |
Defines if a “Donations” menu item to the dashboard should be added to the menu. If you want to customize this menu item you should disable this option. |
kofi_dashboard_topic_id |
The topic ID which contains the description on the dashboard. A topic with a default message is created in the “staff” category when the plugin is enabled. |
kofi_dashboard_widget_enabled |
Enable the Ko-fi donation widget on the dashboard. This requires the kofi_account to be configured. |
kofi_dashboard_count |
If larger than 0, should this number of recent payments. |
kofi_dashboard_types |
The Ko-fi payment types to include in the recent payments. |
kofi_dashboard_anonymous_view |
Payment details to show on the dashboard for visitors who are not authenticated. |
kofi_dashboard_authenticated_view |
Details to show when authenticated members go to the dashboard. |
kofi_goal_amount |
If larger than 0, enable the “goal” widget on the dashboard. This can be used to show a progress towards given target amount. |
kofi_goal_period |
Period over which to calculate the goal. |
kofi_goal_since |
If you select the “since” period, this will be the timestamp to calculate the goal progress from. |
kofi_goal_show_amount |
If enabled, also show the target amount on the goal widget. Otherwise you will just have a percentage. |
kofi_goal_types |
Discourse payment types which are counted towards the goal. |
kofi_goal_progress_bar_integration |
This enables integration with the Progress Bar Theme Component. When the goal progress is calculated it will update the current and max value settings of this component. |
kofi_leaderboard_count |
If larger than 0, show a leader board widget on the dashboard. |
kofi_leaderboard_days |
Calculate the leader board based on payments from the past days. |
kofi_leaderboard_types |
Ko-fi payment types which are used for the leader board calculation. |
Reward Configuration
Besides these settings there is a Rewards tab in the Ko-fi plugin settings where you configure the one-off and subscription rewards.
For subscription rewards you must enter the tier name which you configured on Ko-fi. If you ever change the tier names on Ko-fi you also need to update them there as Ko-fi will only send the display name, and not some kind of unique ID.
When creating or changing rewards you can request the for payments to be reprocessed so that these rewards are granted to existing payments.
Administration
Besides the settings, status, and rewards tabs there are also the following tabs on the Ko-fi plugin admin page:
- Payments – list of received Ko-fi payments.
- Accounts – the link between Ko-fi payments and users.
- Import – import a CSV export of Ko-fi payments. Use this to import already received payments.
- Anonymize – allows you to completely anonymize payments made by a given email address.


