Recognizing Logged-In Users (User Authentication)
Let your agent greet users by name, pre-fill their details, and remember them across sessions.
Table of Contents
A customer has been using your product for two years. They open the chat with a billing question. The first thing your agent asks is their name and email address. They have already typed this into your product dozens of times. They close the chat and email support instead.
User Authentication prevents that. When a logged-in user opens the chat, your agent already knows who they are. It greets them by name, has access to the information you pass through, and skips straight to the part where it helps them. The conversation starts from context, not from zero.
In this article, you'll learn:
- What User Authentication does and why it matters
- How it works at a high level
- How to enable it and what your development team needs to do
What User Authentication Does
Without authentication, every chat session starts fresh. Your agent doesn't know who the user is, can't access their account details, and can't maintain continuity across visits.
With authentication enabled:
- Your agent can greet users by name ("Hi Sarah, how can I help you today?")
- Your agent can access verified user data (name, email, account ID) to personalize responses and avoid asking users to re-enter information they've already provided
- Conversation history is linked to the user - they can pick up where they left off
- Your agent can pass verified user identity to Actions, enabling lookups like "What's the status of my order?" without asking for account details
How It Works
User Authentication uses a standard called JWT (JSON Web Token). Here's the concept in plain language:
- When a logged-in user visits your site, your website generates a small, secure token that contains the user's identity (name, email, etc.).
- That token is passed to the Outlearn widget - it tells the widget who this user is.
- Outlearn verifies the token is legitimate and uses the user's information to personalize the conversation.
The token is signed by your backend using a secret key — this is what makes it secure. Outlearn can verify the token without ever seeing your secret key.
This requires a change in your website's code. A developer needs to implement the token generation on your backend. If you don't have a developer available, this feature can be skipped - your agent works fine without it.
How to Enable User Authentication
- Go to the Deploy tab.
- Click Customize Widget on the Chat Widget card.
- Click the Embed tab.
- Scroll down to the Authenticate your users section and expand it.
- Follow the instructions shown to configure JWT authentication.

What Your Developer Needs to Do
Your development team will need to:
- Generate a JWT token on your backend when a user logs in, containing the user's verified details (at minimum: a unique user ID and email).
- Sign the token using the secret key provided in your Outlearn embed configuration.
- Pass the token to the Outlearn widget via the embed script.
The exact implementation depends on your tech stack. Your developer can refer to the JWT standard (jwt.io) for language-specific libraries and examples.
Best Practices
- Only implement User Authentication if you have a logged-in user experience on your site - it has no benefit for anonymous visitors.
- Treat the JWT secret key like a password - never expose it in client-side code or public repositories.
- Test authentication in a staging environment before deploying to production - verify that the widget correctly identifies test users before real customers see it.
- Even without authentication, your agent works well. Only prioritize this if personalizing the experience is a meaningful improvement for your users.