Skip to main content

Develop and Test

The Embedded extension settings let Hootsuite load your app in one of two ways:

OptionHootsuite loadsUse it for
Load from development URLA URL you enter, such as your local dev server at https://localhost:8080Day-to-day development. Code changes appear without building or uploading.
Load from uploaded bundleThe app.js you upload, hosted by Hootsuite at https://<appId>.hootsuite-apps.comTesting the real hosted bundle before you submit, and publishing.

The user's OAuth authorization belongs to the app, not to the URL, so you can switch between the two options without reconnecting your provider.


Option A: Load from a development URL​

Step 1: Start the dev server​

  1. Run npm start.
  2. Open https://localhost:8080 in a separate browser tab and accept the certificate warning. Do this again after every restart, because the dev server generates a new certificate each time. If you skip it, the app area in Hootsuite stays blank.

Step 2: Point the extension at the dev server​

  1. In the Developer Portal, open your app's Embedded extension settings.
  2. Select Load from development URL.
  3. Type https://localhost:8080 in the URL field.
  4. Click Save settings.
  5. Reload the page and check that Load from development URL is still selected with your URL.

Step 3: Open the app in Hootsuite​

  1. Open a surface you selected, for example Perch.
  2. Click Open apps and select your app in the Apps drawer.
  3. The first time, the app shows Connect your account to continue. Click Connect and complete your provider's consent screen in the popup. If nothing opens, allow popups for Hootsuite in your browser.

When you change a file, webpack rebuilds the app. Close and reopen the app in Hootsuite to load the new version. With HMR_ENABLED=TRUE, the dev server also supports hot module replacement.


Option B: Load from an uploaded bundle​

Step 1: Build the bundle​

  1. Set BACKEND_HOST in .env to an HTTPS URL that your browser can reach. See Test the hosted bundle with a backend.

  2. Run:

    npm run build
  3. Check that dist/app.js was created. The build also writes dist/app.js.LICENSE.txt with the license notices of bundled libraries. Upload only app.js.

Step 2: Upload and save​

  1. In the Embedded extension settings, select Load from uploaded bundle.
  2. Upload dist/app.js. Wait until the upload shows as complete.
  3. Click Save settings. Uploading alone does not change the extension. After an upload, the portal reminds you with the message "Bundle uploaded. Click Save settings to publish it."

Hootsuite serves the bundle from your app's origin, https://<appId>.hootsuite-apps.com, under a path that Hootsuite chooses, and provides the HTML page that loads it. When you save, Hootsuite stores that URL for you, and uploading a new app.js replaces the previous one at the same URL.

Step 3: Check the result​

  1. Reload the Developer Portal page. The upload area shows that your bundle is already saved.
  2. Open your app in Hootsuite and check that it loads.

Test the hosted bundle with a backend​

A hosted bundle runs on https://<appId>.hootsuite-apps.com. Browsers block requests from an HTTPS page to a plain http:// backend (mixed content). Some browsers make an exception for http://localhost, so a hosted bundle built with BACKEND_HOST=http://localhost:3001 can reach your local backend, but only in your own browser. To test the real production path before you deploy, give your local backend a temporary public HTTPS URL:

  1. Expose the example backend on port 3001 with an HTTPS tunneling tool of your choice.

  2. Check the tunnel URL from a terminal:

    curl https://<YOUR_TUNNEL_HOST>/health
  3. Set BACKEND_HOST=https://<YOUR_TUNNEL_HOST> in .env.

  4. Run npm run build, upload dist/app.js, and click Save settings.

Temporary tunnel URLs often change when the tunnel restarts. Because BACKEND_HOST is written into app.js at build time, each new URL means a new build and upload. Use a stable domain for anything beyond a quick test. See Call your own backend.


Test checklist​

Before you submit, test these flows with the hosted bundle:

  • A user who has not connected the provider sees the Connect screen, and Connect completes OAuth.
  • Closing, reopening, and reloading the app keeps the user connected.
  • The app shows correct data for the surface context, for example the week visible in Perch.
  • The app shows an empty state when there is no data for the context.
  • The app shows an error state when your backend is unavailable.
  • If your provider issues tokens that expire, leave the app open longer than the token lifetime (often one hour) without reloading, then trigger a backend call. It succeeds without showing Reconnect, because the app renews the token and retries.
  • After the user revokes access in the provider, the next backend call returns 401, the app shows Reconnect without opening a popup by itself, and data loads again after the user clicks Reconnect and consents.
  • The browser console shows no CORS, mixed-content, or other errors.

Next step​

Call your own backend.