FeedbackJar

User Identification

Call identify() after a user logs into your app.

What you sendResult
Name / email without a signaturePersonalized greeting and author fields. Submissions are not linked to a portal profile.
Same fields plus a server-generated signature, timestamp, and organizationIdPosts and comments share one profile on your feedback board (“My requests”, history, etc.).

To link widget feedback to a portal profile, sign identity on your backend. Details and code samples: Auto-login.

  1. Enable auto-login in Settings → Auto-login and copy your secret key and organization ID.
  2. On your server, sign the user and return the payload to your frontend.
  3. Call identify() with that payload after login (and when restoring a session).
javascript
// Frontend — payload comes from your API
const payload = await fetchIdentifyPayload();

window.fj.identify({
  id: payload.id,
  email: payload.email,
  firstName: payload.firstName,
  lastName: payload.lastName,
  avatar: payload.avatar,
  organizationId: payload.organizationId,
  signature: payload.signature,
  timestamp: payload.timestamp,
});

You’ll get:

  • Feedback attributed to the right person
  • A portal profile with their request history
  • Portal links on your page enriched with auto-login (and optional navigateToPortal()) while the signature is fresh — see Auto-login

Display-only identify

Use this when you only want a greeting or prefilled name/email:

javascript
window.fj.identify({
  id: user.id,
  email: user.email,
  firstName: user.firstName,
  lastName: user.lastName,
  avatar: user.avatar,
});

Feedback still works; it just won’t appear under a signed-in portal profile until you add the signature fields.

Parameters

FieldDisplay-onlyLinked profileDescription
idYesYesStable user ID from your product
emailOptionalYesUser email
timestampYesUnix ms from your server at sign time
signatureYesServer-generated HMAC (see Auto-login)
organizationIdYesYour FeedbackJar project ID
firstNameOptionalOptionalShown in the widget
lastNameOptionalOptionalShown in the widget
avatarOptionalOptionalAvatar URL

Clearing identity

On logout:

javascript
window.fj.identify(null);

This clears the widget user and restores any portal links that were enriched with fj_auth.

Privacy

  • Only send fields you need (id and email are enough to link a profile).
  • Never put passwords, payment data, or other secrets in identify().
  • Generate signatures on your server — never ship your project secret to the browser.

See also