Plugin Installation Flow

OAuth installation flow between TRMNL and your web server.

  1. Installation Request

When the user installs your plugin, TRMNL sends an installation request to installation_url with unique token and installation_callback_url.

  1. Fetch Access Token

After receiving the request, Your server using the client_id, client_secret and token from step#1 request the access_token from TRMNL using the following endpoint

body = {
  code: 'code-from-step-1',
  client_id: 'your-plugin-client-id',
  client_secret: 'your-plugin-secret',
  grant_type: 'authorization_code'
}
response = HTTParty.post("https://usetrmnl.com/oauth/token", body: body)
response['access_token']
  1. Access Token

TRMNL responds with the access_token

  1. Installation Callback

Use the installation_callback_url from Step #1 and redirect the user back to TRMNL.

  1. Success Webhook

After the user has successfully finished installing the plugin, TRMNL sends a success notification to installation_success_webhook_url endpoint. Data is sent in the following format.

{
   "access_token": "c4cc13adcadfecb0796d7549574bbc856c3d37c8",
   "user": {
     "name": "Test User"
     "email: "user@trmnl.com"
     "uuid": "674c9d99-cea1-4e52-9025-9efbe0e30901"
   }
}

Last updated