Integrate with Discourse
Discourse is a popular and powerful open source discussion forum software. Memberful integrates directly with Discourse, making it easy to create a members-only discussion forum. In this article, we'll walk you through the steps to integrate your Discourse forum with Memberful.
If you're new to Discourse, read the official Discourse install tutorial to get started.
In this help doc:
- Create a Discourse Group.
- Generate an API Key.
- Integrate Memberful with Discourse.
- Set your Discourse Groups.
- Protect your Discourse Categories.
- Disallow anonymous access (optional).
- Set up Discourse admins.
- Add a signup link to your forum.
- Disable Discourse integration.
Create a Discourse Group
In Discourse, navigate to Groups via the menu icon.
Click New Group.
Name and save your Group.
Generate an API Key
In Discourse, generate an API Key via Admin → API.
Integrate Memberful with Discourse
Navigate to Settings → Discourse in your Memberful dashboard, and click Connect.
Enter information about your Discourse site including the API key you just generated. The Username and Email must be for the Discourse admin.
Now you're connected!
Advanced: Discourse Settings
When Memberful connects to Discourse it changes some of your default Discourse settings. A list of those changed settings is below.
Settings → Login
enable discourse connect:On (Formerly "enable_sso")
enable discourse connect provider:Off (Formerly "enable sso provider")
discourse connect url:Set by Memberful (Formerly "sso url")
discourse connect secret:Set by Memberful (Formerly "sso secret")
auth overrides email:On (Formerly "sso overrides email")
auth overrides name:On (Formerly "sso overrides name")
Settings → Users
Settings → Posting
display name on posts:On
Settings → Plugins
disable discourse narrative bot welcome post:On
Set your Discourse Groups
After you've connected, we'll automatically add and sync all your members (free or paid) to Discourse. If you'd like to protect certain Discourse Categories for active, paying members, select a Discourse Group from the dropdown list in your plan's settings.
Once set, active members will be synced to that Discourse Group. If their subscription expires, they will be removed from the Discourse Group and not have access to any Categories restricted for that Group.
Members who registered for free will not have access to any Categories protected by a Discourse Group synced with a plan in Memberful.
Protect your Discourse Categories
To leverage the Discourse Groups you've set up, you'll need to change the security settings on your Discourse Categories.
Click a Discourse Category and then click the edit Wrench icon.
Navigate to the Security settings, click Add a group and select the Discourse Group.
After choosing your new Discourse Group, select the See / Reply / Create settings and click the Save Category to add this security setting.
Repeat the process for all other members-only Categories.
Disable default categories
Default Discourse categories like Meta don't have security settings. If you want a "members-only" forum, don't use the default categories.
Disable posting to Uncategorized
You'll notice that the Uncategorized Category does not have a Security tab. You can disable posting to the Uncategorized Category by visiting Admin → Settings → Posting.
Disallow anonymous access
If you're running a protected Discourse forum, we also recommend disallowing anonymous access from Settings → Login.
Keep in mind, if you disallow anonymous access, all members will need to sign in to Memberful to view your forum.
Set up Discourse admins
We have a security setting that doesn't allow Memberful non-admins to be Discourse admins. This is necessary because we don't confirm email address ownership. The solution is to create your Discourse admins as Memberful staff. Navigate to Settings → Account settings → Staff from your Memberful dashboard to set up staff.
Access the forum as an admin
We use the member login page for SSO since the vast majority of Discourse users are members. If you want to access your Discourse forum as an admin, make sure to sign in to your Memberful dashboard first.
Make a paying member a moderator
If you set a paying member as a Discourse admin, we will remove the admin flag the next time we sync the member. This is to protect your Discourse admin account. However, we don't touch the Moderator flag, so your paying members can be Discourse moderators.
Add a signup link to your forum
When SSO is enabled, Discourse will show a login button but no signup button. To add a signup link to your Discourse discussion forum, create a Memberful plan, copy the plan purchase link, and add it to your website or forum. Or customize your Discourse header to include the link.
Disable Discourse integration
When you disable our Discourse integration, we try to disable Memberful Single Sign On (SSO) on your forum. Once the integration is successfully disabled, you (and your members) will be able to log in to the forum normally.
If you are unable to log in to your forum after you've disabled our integration, log in via this URL to fix your Discourse settings:
Related help doc: