Confusion between power-up client / getRestApi and client.js rest API helper

Hi,

first: building power-ups and interacting with Trello is a lot of fun, and the examples in Glitch are stellar.

Now, for my question: While I’m playing with the API, I’d like to build a tiny power-up to include API debug information like what webhooks I’m running, etc. Now, I thought the TrelloPowerUp.getRestApi will give me access to client.js rest api, but I think that are actually 2 separate things, right?

If I want to use API in my PowerUp, I have to include power-up.js AND client.js, right?

TrelloPowerUp.getRestApi will give me access to client.js rest api , but I think that are actually 2 separate things, right?

Correct, client.js is separate from power-up.js and the REST client it gives you. client.js is a small, API wrapper that provides some helper methods for interacting with Trello’s API. It does require jquery as it relies fairly heavily on jquery.ajax().

The REST API Client in power-up.js doesn’t provide any API request helpers, but it does provide helper methods for getting and securely storing a user’s API token within the Power-Ups platform.

They can be used together, though. For instance you may use the REST API Client to retrieve the user’s API token and then pass that token along to client.js to make calls to Trello’s REST API.

1 Like