Creating Your Own Gadgets for Inspector

Think gadgets are the bees knees? You can create your own for Inspector. You host the gadget on your server, where the UserVoice app can access it over https.

The Request

Implement an endpoint that will serve the gadget HTML. It can be anything you’d like, so long as it’s SSL. For instance, you might pick:

UserVoice will call this endpoint with a GET request containing the following parameters in its query string:

  • email: (Email address of the user)
  • name: Sally (The current name we have on file for this person)
  • guid: null (Guid created for SSO, if one exists)
  • user_id: 123 (Same user id that you’ll find in our API)
  • external_ids:

When the gadget is displayed in the context of a ticket, key ticket attributes will be passed as well, under the ‘ticket’ key:

  • ticket:
    • id: 456 (Unique id of ticket)
    • ticket_number: 123 (Human-facing ticket identifier)
    • custom_fields: (Any custom fields set on the ticket)
      • MyField: my value
    • created_at: 2010-03-24T14:53:48-04:00
    • updated_at: 2010-03-28T12:00:48-04:00

In order to handle authentication and account-specific scoping, you might want to accept additional parameters that UserVoice admins supply.

You can choose anything you want, and name these parameters what you want. So you might pick account and api_token, for instance. These parameters will be merged into the default parameters, like this:

  • email:
  • user_id: 123
  • name: Sally
  • account: posterous
  • api_key: 12345abcd (UV Admin entered this, and presumably got it from your website.)

UserVoice will then form all of this into a GET request:


To which you reply with…

The Response

You need to render an HTML page.

For CSS, we recommend you use our CSS file. You can do whatever you want here, but obviously something that looks like it fits in is ideal. Our base gadget styles are here:

For JavaScript, you just include this javascript file just before the closing body tag:

This javascript communicates via postMessage to the parent UserVoice window what the height of your gadget is and whether it has data. If you don’t include this javascript file, your gadget will not show up in UserVoice.

If your gadget has no data to display, for instance if the user can’t be found in your CRM, then the best practice is to hide the gadget completely. You can do this simply by including this snippet before you include the gadget.js file:

<script type="text/javascript">
  window.gadgetNoData = true;

Here is a sample HTML document that you might render. It uses ERB and assumes you have a variable named ‘data’:

<!DOCTYPE html>
    <title>Title your gadget</title>
    <link href=""
      media="all" rel="stylesheet" type="text/css" />
    <% if data %>
          <td><%= data %></td>
    <% else %>
      <script type="text/javascript">
        window.gadgetNoData = true;
    <% end %>
    <script src=""

Create a One-Off Gadget

Let’s say you run a website called Most likely, you have a database and a secret admin area you can access to view who signed up on your site. You’d like a gadget that can pull in customer data into UserVoice. Obviously, this gadget only applies to you – you don’t want any other UserVoice account access to it!

This situation is fully supported. You’ll want to head on over to your UserVoice account’s admin area, click Settings, and go into Integrations. Add a custom gadget:

Then enter your gadget URL:

Your URL might be something like:

UserVoice will then call your endpoint, including the parameters (such as email and user_id) listed above in the previous section.

It should be noted that you can use this method to test out a broader integration.

Creating A Gadget Anyone Can Use

You want to implement a gadget and distribute it to others. Maybe you run a CRM SaaS app like, or maybe you’re a 3rd party and you want to implement a gadget on their behalf. You want an admin on to go here to add your gadget:

And once it has been enabled, you want it to show up here:

There are two steps to this process. First, implement an endpoint on your server according to our gadget specifications. Second, tell us about it and we can work with you to add it into our UI for others to use.

Tell Us

Now that you’ve gotten your gadget working, you want anyone to be able to access it. Please email us at and we’ll work with you on getting it added into the UserVoice UI so anyone can add it!


So, you’ve learned how to pull in data from your personal system and from popular 3rd party systems. Please let us know if you create generic gadgets that others might find useful!