curl is the shortest way to register a new client:
Optionally check that you have jq installed on your system. You can normally install this with brew, apt-get, yum or chocolatey. If you do not have jq installed, you can remove it from the command below.
The examples on this page use
https://mastodon.social as the default Mastodon instance. If you are setting up PostQueen to connect to a different self-hosted Mastodon instance (e.g., https://fosstodon.org), you must replace https://mastodon.social with your instance’s URL in the curl command below. You will also need to ensure the MASTODON_URL environment variable in your application’s .env file (or equivalent configuration for Docker, etc.) is set to your custom instance’s URL.1
Register your client
Your Mastodon OAuth2 Redirect URI:This will give you output that looks something like this;
- Production:
https://postqueen.example.com/integrations/social/mastodon - Local development:
http://localhost:4200/integrations/social/mastodon - Docker:
http://localhost:4007/integrations/social/mastodon
2
Add credentials to your environment
Make a note of your
client_id and client_secret and add them to your .env file.3
Start PostQueen
Stop PostQueen if it is running, and then start it using the .env file with the Mastodon details. Click through the new channel setup and you should be asked to login on Mastodon.
The channel is in the left sidebar with its avatar and name. That is the whole confirmation: if it is in the list, she can post to it.
Troubleshooting
”Failed to fetch” / “fetch failed” when connecting
The PostQueen backend needs network access to reach your Mastodon instance. If the connect call fails at this stage, the backend container could not resolve or reach theMASTODON_URL host.
Fix
- From inside the backend container, run
curl -I https://mastodon.example.com/. If that fails, fix DNS/egress before retrying. - If you are behind a corporate proxy, set
HTTPS_PROXYon the backend. - Confirm
MASTODON_URLexactly matches your instance (protocol included, no trailing slash issues).
Next steps
What she can post to Mastodon
Limits, post types and settings
Configuration reference
Every variable she reads
Connect errors
Invalid state, invalid_grant and the rest
Another channel
Every network, and what each one asks for