OneInfer Aura

Tell the chat bot who is signed in

If your website has signed-in users, add their details to the Aura snippet. Your team then sees who they are on Aura's Live page, and the bot can tailor its answers, for example to the visitor's plan. It's optional: without it, visitors stay anonymous.

1. Add attributes to the snippet

Copy the snippet from your bot's Go live step in Aura, and add a data-visitor-… attribute for each detail:

<script async src="https://aura.oneinfer.ai/widget.js" data-bot-id="bot_…"
  data-visitor-name="Priya Sharma"
  data-visitor-email="priya@example.com"
  data-visitor-plan="Pro"
  data-visitor-credits-left="120"
></script>
AttributeWhat it is
data-visitor-nameTheir name. The bot and your team see it.
data-visitor-emailTheir email. Only your team sees it; the bot never does. If nobody is online when they ask for a person, replies go to it.
data-visitor-idYour own id for them. Only your team sees it.
data-visitor-anythingA detail the bot and your team see: data-visitor-plan becomes "plan", data-visitor-credits-left becomes "credits left". Up to 20.

2. Fill them in from your site

Your site's templates already know who is signed in. Put their values in the attributes, and leave them empty for visitors who aren't signed in. Let your template escape the values, as it does for any HTML.

PHP

data-visitor-name="<?= htmlspecialchars($user->name ?? '') ?>"
data-visitor-plan="<?= htmlspecialchars($user->plan ?? '') ?>"

WordPress (in your theme's footer)

<?php $user = wp_get_current_user(); ?>
data-visitor-name="<?php echo esc_attr( $user->display_name ); ?>"
data-visitor-email="<?php echo esc_attr( $user->user_email ); ?>"

Django or Jinja

data-visitor-name="{{ user.get_full_name }}"
data-visitor-plan="{{ user.profile.plan }}"

Ruby on Rails

data-visitor-name="<%= current_user&.name %>"
data-visitor-plan="<%= current_user&.plan %>"

Single-page apps (React, Vue, Angular…)

If people sign in without the page reloading, tell the widget from your code instead:

// After sign-in
window.Aura?.setVisitor({ name: user.name, email: user.email, details: { plan: user.plan } });

// After sign-out
window.Aura?.setVisitor(null);

Good to know