Develop and Test
The Embedded extension settings let Hootsuite load your app in one of two ways:
| Option | Hootsuite loads | Use it for |
|---|---|---|
| Load from development URL | A URL you enter, such as your local dev server at https://localhost:8080 | Day-to-day development. Code changes appear without building or uploading. |
| Load from uploaded bundle | The app.js you upload, hosted by Hootsuite at https://<appId>.hootsuite-apps.com | Testing 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
- Run
npm start. - Open
https://localhost:8080in 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
- In the Developer Portal, open your app's Embedded extension settings.
- Select Load from development URL.
- Type
https://localhost:8080in the URL field. - Click Save settings.
- Reload the page and check that Load from development URL is still selected with your URL.
Step 3: Open the app in Hootsuite
- Open a surface you selected, for example Perch.
- Click Open apps and select your app in the Apps drawer.
- 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
-
Set
BACKEND_HOSTin.envto an HTTPS URL that your browser can reach. See Test the hosted bundle with a backend. -
Run:
npm run build -
Check that
dist/app.jswas created. The build also writesdist/app.js.LICENSE.txtwith the license notices of bundled libraries. Upload onlyapp.js.
Step 2: Upload and save
- In the Embedded extension settings, select Load from uploaded bundle.
- Upload
dist/app.js. Wait until the upload shows as complete. - 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
- Reload the Developer Portal page. The upload area shows that your bundle is already saved.
- 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:
-
Expose the example backend on port
3001with an HTTPS tunneling tool of your choice. -
Check the tunnel URL from a terminal:
curl https://<YOUR_TUNNEL_HOST>/health -
Set
BACKEND_HOST=https://<YOUR_TUNNEL_HOST>in.env. -
Run
npm run build, uploaddist/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.