Remote Log Activation

Privacy-first logging: configure the SDK without sending data, then activate remotely for specific users from the dashboard.

Privacy-first by default

Initialize with remote: false to prevent API sends while keeping full SDK configuration. When you need to debug a specific user, activate them from the dashboard. Activation is delivered on the next SDK-server touchpoint (init sync, batch send, or manual sync()). For immediate activation, configure a webhook and call sync() when your app receives a push.

How it works

  1. Initialize the SDK with remote: false, local: true, and userId (your app's user identifier)
  2. Logs can still be shown locally, but no data is sent to API until activation
  3. From the dashboard, go to your project and add the userId to "Remote Log Activation"
  4. On the next app launch, batch send, or when you call sync() (e.g. after a push), the SDK receives remoteLogging.enabled: true and starts collecting
  5. Deactivate from the dashboard when done—the SDK stops on next response

SDK initialization

// Privacy-first: no logs sent until remotely activated
GrenLogger.initialize({
  apiKey: 'your-api-key',
  userId: 'user_abc123',   // Required for remote activation
  remote: false,            // Default: true
  local: true,              // Default: true
});

// Normal mode: send to API and local console
GrenLogger.initialize({
  apiKey: 'your-api-key',
  userId: 'user_abc123',
  remote: true,             // Default
  local: true,              // Default
});

Dashboard usage

  1. Go to your project in the dashboard
  2. Find the "Remote Log Activation" card
  3. Enter the userId (from a support ticket, user report, etc.)
  4. Click "Activate"
  5. View active activations and deactivate when done

Activation via webhook and push notification

By default, activation takes effect on the next app launch or batch send. For immediate activation, GrenLogger supports webhooks—remote log activation is one of the configurable events. The flow:

  1. Dashboard: Admin activates remote logs for a user
  2. Backend: Emits webhook (when configured)
  3. Your backend: Receives webhook, sends push notification to the user's device
  4. User's device: Receives push, your app calls sync()
  5. SDK: Downloads config (including remoteLogging.enabled: true)
  6. Result: Logs start being sent immediately

Example: Call sync() on push receipt

When your app receives a push notification (e.g. from your backend after it gets the webhook), call sync() to fetch the latest config:

iOS (Swift)

// In UNUserNotificationCenterDelegate or AppDelegate
func userNotificationCenter(_ center: UNUserNotificationCenter,
                           didReceive response: UNNotificationResponse) {
  Task {
    let success = await GrenLogger.sync()
    // Config updated, remote logging may now be enabled
  }
}

Android (Kotlin)

// In Firebase Messaging or your push handler
override fun onMessageReceived(remoteMessage: RemoteMessage) {
  lifecycleScope.launch {
    val success = GrenLogger.sync()
    // Config updated, remote logging may now be enabled
  }
}

Ready to use remote activation?

Create a project and configure the SDK with remote: false and local: true.

Get Started

Related