Browse documentation

On this page

Embedded UIPackage v0.1.0-beta.1

Sample partner app

The public Paprel Embed examples repository contains a production-shaped, framework-neutral real-estate application. It mounts @paprel/embed-accounting and @paprel/embed-reports as real npm consumers and demonstrates the boundaries your host application should own.

Run locally

Shell
git clone https://github.com/nexara-global/paprel-embed-ui-examples.git
cd paprel-embed-ui-examples
npm install
cp apps/real-estate-accounting/.env.example apps/real-estate-accounting/.env.local
npm run dev

Open http://127.0.0.1:5181/. Without App Connect credentials, the application still starts and shows the exact server variables required for the selected entity.

The sample includes:

  • A local-only /api/embed-token BFF that exchanges App Connect credentials
  • Host-owned routing, company context, URL-backed search, filters, tabs, and pagination
  • Delegated paprel:resource-open, paprel:view-change, and paprel:operation-success events
  • Account, journal, bank, transaction, reconciliation, lock, and report routes
  • One App Connect client per managed company, with tokens cached per company in the BFF
  • Inherited Paprel design tokens inside a partner-owned shell

Authentication is App Connect client credentials only. The sample does not use Partner API sessions.

Three details worth copying

These are the parts a host application usually gets wrong, so the sample is built to show them working:

Renewing a token must not remount your widgets. The sample re-renders only what changed, so a token renewal, a Refresh, or a list URL update leaves unsaved journal and account form values, focus, and scroll position intact. If your host rebuilds the route on every session change, an operator loses a half-typed journal every hour.

One token request per connect. The token route is rate limited per client IP, and every user of your product shares your server's IP. The sample's BFF caches each company's token until it nears expiry, so a reconnect does not exchange credentials twice.

An expired session is recoverable in place. When the token cannot be renewed, the sample shows a banner with a Reconnect button and keeps the page mounted, rather than redirecting away from unsaved work.

Pass criteria

Before porting the pattern into your stack, confirm:

  1. Chart of accounts loads without console errors
  2. Journal list loads and pagination works
  3. Row click opens journal detail
  4. Editor saves a balanced journal and the host displays success feedback
  5. Banking, reconciliation, and report routes load with the required scopes
  6. Browser history restores list filters and pagination
  7. A journal form keeps a typed-in value across a token renewal
  8. Expiring a session shows the Reconnect banner, and reconnecting returns to the same view
  9. The journal and account forms use the company's currency, not a hardcoded one

Environment

Copy .env.example to .env.local. A new setup starts with one company, and the file carries a commented template for adding a second:

VariableSidePurpose
VITE_PAPREL_API_BASE_URLBrowserSandbox or production API base URL
VITE_PARTNER_DOMAINBrowserYour registered partner domain
VITE_PAPREL_ENTITIESBrowserCompanies in the sidebar switcher, as key:Display name. The first entry must use the key default
APP_CONNECT_TOKEN_URLServerApp Connect token endpoint
APP_CONNECT_CLIENT_IDServerClient id for the default company
APP_CONNECT_CLIENT_SECRETServerClient secret — never in a VITE_* variable
PARTNER_DOMAINServerPartner domain sent with the token exchange

An "entity" in this sample is one company in your product, and each has its own App Connect client. To add a second, append it to VITE_PAPREL_ENTITIES and set APP_CONNECT_ENTITY_<KEY>_CLIENT_ID and _CLIENT_SECRET; the token URL and partner domain fall back to the values above.

The proxy verifies TLS. It skips verification only for local hosts, or when you set PAPREL_DEV_INSECURE_TLS=1 for an untrusted local certificate — never in production.

The Vite BFF is for local development only. A production route must authenticate and authorize the partner user before choosing a company or minting a token.

Evaluate Paprel

Build in sandbox, launch with a production trial

Use sandbox for developer testing with no billing. When you are ready for real workflows, start production on a monthly plan with a 14-day free trial.

API-First Delivery
Audit-Ready Controls
Sandbox And Guided Rollout
We use cookies to improve your experience.

We use cookies and local storage for essential settings and, with your choices, analytics and advertising. Online identifiers and activity can be personal data. You can reject optional categories or change your choices.

These cookies are necessary for the basic functionality of the website, ensuring a seamless user experience. They cannot be disabled.