InvergeDocs

A complete integration

Wire a mobile app and its backend together so one person's journey — taps, requests, queries, errors — reads as one story.

This walkthrough connects a Flutter app and a Laravel API (swap in any SDK — the calls are the same everywhere). By the end, opening a crash in the console shows the person, their session, the request that failed and every query it ran.

1. Use one id for a person, everywhere

Pick the id you already have — your database user id, or a prefixed form such as CLIENTS.42. That string is the distinct id. Every SDK attributes telemetry to it, and the console joins on it.

// after login
await Nexus.instance.identify('user_42', email: user.email, name: user.name);

// on logout — forget the person and start a fresh session
Nexus.instance.reset();

2. Let the backend record the request journey

With the PHP package installed and NEXUS_API_KEY set, Laravel's requests, jobs, commands and scheduled tasks are recorded by Telescope automatically — including the signed-in user, so each journey is attached to user_42 as well.

.env
NEXUS_API_KEY=nxs_live_xxx
NEXUS_SERVICE_NAME=orders-api

3. Capture what goes wrong on both sides

Uncaught errors are reported automatically by every SDK. For handled ones:

try {
  await api.placeOrder(cart);
} catch (e, st) {
  await Nexus.instance.errors.capture(e, st, {'handled': true, 'feature': 'checkout'});
  rethrow;
}

An exception inside a recorded journey is filed in Errors and linked back: the issue page has View the request journey, and the journey shows the issue.

4. Track the moments that matter

context.nexus.events.track('checkout_started', properties: {'items': cart.length});

Events are buffered and shipped in batches, so tracking costs microseconds.

5. Ship it

Before release, run through Going to production: separate keys per environment, release names, data you must redact, and which products you actually want on.

On this page