Skip to main content
Identity verification lets your agent know who the user is—enabling personalized support and persistent conversations.

What You Get

FeatureAnonymousVerified
Chat
Conversation history
Personalized by name
User-specific actions

How It Works

1. User logs into YOUR app
2. Your backend mints a Crow identity token (JWT signed with your Crow secret)
3. Your frontend calls window.crow('identify', { token })
4. Widget now knows who the user is
This is not your app’s session JWT. It’s a separate Crow-scoped identity token that your backend mints specifically for Crow. Your app JWT stays private.

1. Get Your Secret

app.usecrow.ai/deploy → copy Verification Secret Add to your backend environment:
CROW_VERIFICATION_SECRET=your_secret_here
Never expose this secret in frontend code.

2. Create Backend Endpoint

const jwt = require('jsonwebtoken')

app.get('/api/crow-token', authMiddleware, (req, res) => {
  const token = jwt.sign(
    {
      user_id: String(req.user.id),  // Required
      exp: Math.floor(Date.now() / 1000) + 3600,  // Required: 1 hour
      email: req.user.email,  // Optional
      name: req.user.name,  // Optional
    },
    process.env.CROW_VERIFICATION_SECRET,
    { algorithm: 'HS256' }
  )
  res.json({ token })
})

JWT Payload

FieldTypeRequiredDescription
user_idstringYesUnique user identifier
expnumberYesExpiration (Unix timestamp)
emailstringNoUser’s email
namestringNoDisplay name

3. Identify in Frontend


4. Handle Logout

Logout is handled automatically — when the component unmounts or the user navigates away, the session is cleared.

Troubleshooting

IssueSolution
User not identifiedCheck secret matches dashboard, user_id is string
Token invalidCheck exp is in future, algorithm is HS256
History not persistingCall identify() on page load, not just after login