Install with an AI assistant
Using Cursor, Claude Code, Lovable, Bolt or v0? Copy this prompt, replace pk_YOUR_KEY with your website key, and paste it into your assistant.
prompt
Add the Bridge live chat to this website, and tell Bridge who each visitor is when the site knows it.
1. Install the script once, on every page (root layout or main HTML template, just before </body>):
<script src="https://bridgechat.app/widget.js" data-bridge-key="pk_YOUR_KEY" async></script>
- Next.js: in the root layout, <Script src="https://bridgechat.app/widget.js" data-bridge-key="pk_YOUR_KEY" strategy="afterInteractive" /> (import Script from "next/script").
- WordPress, Shopify, Webflow, Wix, Squarespace: paste it in the site-wide footer code setting, and tell me where it went.
2. Identify the visitor, only with data that is really about them.
Call this wherever the site learns who the current visitor is: after sign-in or sign-up, on pages where they're signed in,
and when they submit a form with their email (checkout, contact, newsletter, quote...):
window.Bridge = window.Bridge || [];
window.Bridge.push(["identify", { email, name }]);
Rules, for every field:
- Only the current visitor's own data: their own email, their own name. Never a value about someone or something else, even
if it's the closest thing you have: the account owner, the person a link or invite was made for, a company or team, a page
title, a label like "Internal", "Test" or "Guest".
- If you're not sure a value is theirs, leave the field out. An empty field is fine (Bridge shows a name guessed from the
email). A wrong one is not: it's the name the team will use with the customer.
- email: as the visitor typed it or as stored on their account. name: only from a real name field (profile, form).
company: only their own company.
- Other useful details go in extra keys with explicit names, so nobody takes them for the visitor's identity: plan, orders,
signup_date, link_for, referred_by... Simple values only (text, numbers, true/false, dates). Each one becomes an attribute
on the visitor's profile in Bridge.
- Never call identify with hardcoded, sample or test values, and not on pages where the visitor is anonymous.
3. When the user signs out, forget the visitor, so the next person on this browser isn't shown as them:
window.Bridge = window.Bridge || [];
window.Bridge.push(["reset"]);
4. If a bar is stuck to the bottom of the screen on mobile (cart, checkout summary...), lift the chat button above it while
it's visible, and back down when it's gone:
window.Bridge.push(["setOffset", { bottom: barHeightInPixels }]);
window.Bridge.push(["setOffset", { bottom: 0 }]);
5. Before telling me it's done:
- Check that the chat button shows on a few pages.
- List every place you call identify and, for each field, where its value comes from. If a value comes from anything other
than the visitor themselves, fix it or leave the field out.
- Ask me to go through one real path (sign in, or submit a form with my own email), then check in Bridge, under Contacts,
that the visitor shows with the right email and name.
Don't add any other chat widget and don't change anything else. List the files you edited.
Reference: https://docs.bridgechat.app/javascript-apiYour key is in Settings → Websites → your site → Install in Bridge. The prompt does the install, identifies your visitors with their own details only, handles sign-out, and asks your assistant to check its work in Bridge.