User Identification
Call identify() after a user logs into your app.
| What you send | Result |
|---|---|
| Name / email without a signature | Personalized greeting and author fields. Submissions are not linked to a portal profile. |
Same fields plus a server-generated signature, timestamp, and organizationId | Posts 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.
Recommended: signed identify
- Enable auto-login in Settings → Auto-login and copy your secret key and organization ID.
- On your server, sign the user and return the payload to your frontend.
- 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
| Field | Display-only | Linked profile | Description |
|---|---|---|---|
id | Yes | Yes | Stable user ID from your product |
email | Optional | Yes | User email |
timestamp | — | Yes | Unix ms from your server at sign time |
signature | — | Yes | Server-generated HMAC (see Auto-login) |
organizationId | — | Yes | Your FeedbackJar project ID |
firstName | Optional | Optional | Shown in the widget |
lastName | Optional | Optional | Shown in the widget |
avatar | Optional | Optional | Avatar 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 (
idandemailare 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
- Auto-login — how to sign the payload and open the portal signed in
- Single Sign-On — board login for visitors who start on the portal
- API Methods —
identifyreference