For the complete documentation index, see llms.txt. This page is also available as Markdown.

Plugin Installation Flow

OAuth installation flow between TRMNL and your web server.

Plugin installation flow between TRMNL and your web server

Third Party plugins use a simplified OAuth2 flow. There is no client_id or client_secret to manage — TRMNL identifies your plugin by the URLs you registered during Plugin Creation, and each installation is authorized by a single-use code.

  1. Installation Request

When a user installs your plugin, TRMNL redirects their browser to your installation_url. This is a GET request, so both parameters arrive in the query string (URL-encoded):

  • code — a single-use installation code, unique to this user + plugin

  • installation_callback_url — the TRMNL URL you send the user back to once installation is complete (see Step 4)

  1. Fetch Access Token

Exchange the code from Step 1 for an access_token by sending a POST request to TRMNL's token endpoint. The code is the only parameter required, sent as a form-encoded body:

  1. Access Token

TRMNL responds with a JSON body containing the access_token. Persist this token — you'll use it as the Bearer token to authenticate the screen generation requests TRMNL sends to your server.

If the code is missing or invalid, TRMNL responds with an error body instead (note: the HTTP status is still 200):

  1. Installation Callback

Redirect the user's browser to the installation_callback_url you received in Step 1. This GET redirect returns them to TRMNL to finish connecting the plugin.

  1. Success Webhook

Once the user has finished installing the plugin, TRMNL sends a POST request to your installation_success_webhook_url. The request is authenticated with the user's access_token and the body is JSON.

HTTP Headers:

Body:

Time zone mappings are available here under "Constants:" https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html

The plugin_setting_idis useful for building a redirect URI in your own application, for example to send a user back to trmnl.com/plugin_settings/:plugin_setting_id/edit.

Last updated