Guide

How to Add Free Live Chat to Astro

Follow this step by step guide to install a free live chat widget on your Astro site. Learn why the is:inline directive is required to keep it working.

JH
Jerry Holt
July 25, 2026 · 8 min read

The short version

  • Place the script tag in your base layout file before the closing body tag.
  • Apply the is:inline directive to prevent Astro from stripping your agent ID.
  • LastWorker provides free live chat and email ticketing with no seat limits.
  • AI is disabled by default and only charges you when it actually generates a reply.

To add live chat to Astro, open your base layout file, usually src/layouts/Layout.astro. Paste the LastWorker script tag immediately before the closing body tag. You must include the is:inline directive on the script tag. This prevents Astro from bundling the script, which would strip the data-agent-id attribute and prevent the widget from loading on your website.

How do I install the chat script in Astro?

The process is fast if you know where your layout lives. Most Astro sites use a central layout file to wrap every page. You want the chat widget to appear everywhere, so this is the place to put it.

Open your project and look for src/layouts/Layout.astro. Scroll to the bottom of the file. You are looking for the </body> tag.

Paste the following code block immediately before that closing tag:

<script is:inline src="https://lastworker.com/widget.js" data-agent-id="YOUR_AGENT_ID" async></script>

You will need to replace YOUR_AGENT_ID with the specific ID found in your LastWorker dashboard. Once you save the file and your site builds, the widget will appear in the bottom corner of your pages.

I have spent eighteen years managing front desks and operations. I know that when you are building a site, you just want the tool to work so you can get back to talking to customers. In the shops I worked with, we did not have time for complex integrations. We needed a button that people could click to ask a question. This method gets that button live in under five minutes.

Why does the script require the is:inline tag?

Astro is designed to be fast by optimizing every script it finds. Usually, it tries to bundle scripts together or move them around to improve performance. This is generally a good thing, but it causes problems for third party widgets.

When Astro processes a script, it often discards data attributes it does not recognize. The LastWorker widget relies on the data-agent-id attribute to know which account it belongs to. If Astro strips that ID during the build process, the script loads but it has no idea who you are. The widget simply won't show up.

By adding is:inline, you are telling Astro to leave the script alone. You are instructing the compiler to ship that HTML tag exactly as you wrote it. It is the one step that most guides leave out, and it is the reason most "quick installs" fail.

Why are most chat tools so expensive for small teams?

I have sat through hundreds of sales pitches for software. Most of them start with a low price that grows into something unmanageable as soon as you hire a third person.

I looked at twelve of the most popular tools on the market. Four of them, including Zendesk and Intercom, do not even offer a free version of their software. If you want to use Front or LiveChat, you are starting at twenty-five dollars per user every month.

The companies that do offer free versions often put handcuffs on them. I worked with a regional dental practice that had eleven front desks. If we had used Zoho Desk, we would have been capped at three users on the free plan. Crisp limits you to two seats and one hundred customer profiles. Even HubSpot limits their free live chat to carry their own branding.

LastWorker is different because the live chat and email support are free forever. There are no seat limits. You can have five people or fifty people answering chats in a shared inbox without a credit card on file. We also include the knowledge base, tickets, and a public help center for free.

In my experience, service businesses do not have "predictable" seat counts. You might have a part-time receptionist on Mondays and a different one on Tuesdays. Paying for two separate seats just to have one person at a desk is a waste of money.

How does the pricing work if there is no subscription?

The reason we can offer free chat is that we only charge for the things that actually cost us money to provide. Most software companies charge you for "seats" because it is a stable way for them to make a profit, even if you aren't using the software.

We charge based on usage. If you want a phone number, it is one dollar per month. If you send an outbound text, it is three cents. If you receive a text, it is free.

This model reminds me of the two-location restaurant group I managed. We didn't pay the linen company a flat monthly fee regardless of how many napkins we used. We paid for the napkins we actually put on the tables.

Software should work the same way. You should not have to pay nineteen or twenty-five dollars a month for an agent who only answers three chats a week. With our model, you only pay for the specific actions the system takes, like AI generations or phone minutes.

What happens when I want to use AI?

We have a very strict rule about AI: it is off by default. I have watched good leads die because an unconfigured bot gave a generic, frustrating answer to a specific customer question.

In many modern tools, AI is forced on you. You pay a high monthly fee for a "suite" and the AI is just part of the cost. With LastWorker, everything starts as a manual process handled by a human.

When you decide you want the AI to handle a reply on chat or email, it costs four cents. That only happens when the AI actually generates the response. If a human answers, the cost is zero.

If you want the AI to answer a phone call, the cost is ten cents per minute. This includes the carrier cost. I used to write phone scripts at 2am trying to make sure our after-hours service didn't sound like a robot. With this technology, you can have a system that actually understands the customer without the overhead of a massive call center contract.

Is this better than a traditional answering service?

I have hired plenty of answering services for the businesses I ran. They are expensive. Usually, you are looking at a base fee plus a high per-minute rate, and the quality of the notes they take is often poor.

Using an Astro site with a free chat widget allows you to capture those leads yourself. If you are busy, you can let the lead sit in the shared inbox until you are free. If you want it handled instantly, you can flip on the AI for four cents.

Compare that to the entry price of the tools I mentioned earlier. Help Scout starts at twenty-five dollars per user. If you have four people in your office who need to see customer emails, you are spending one hundred dollars a month before you even send your first reply.

By using Astro, which is already a very efficient platform, and pairing it with a tool that doesn't charge per seat, you are keeping your overhead low. This is how you scale a service business without the software bill eating your margins.

How do I manage multiple locations?

When I was running that dental practice with eleven front desks, the biggest headache was seeing who was doing what. One office would have a pile of voicemails while another office was sitting idle.

Because LastWorker allows for unlimited teammates on the free tier, you can bring every location into one shared inbox. You do not have to worry about the cost of adding a new office manager to the system.

You can set up your Astro site to route different pages to different contact points, or just let everything flow into the central ticketing system. The tickets, contacts, and saved replies are all part of the free package.

I have seen businesses struggle to grow because their "pro" software plan was capped at ten seats. To add the eleventh person, they had to jump to a plan that cost twice as much. We don't do that. You stay on the same free plan for chat and email whether you have one location or twenty.

Setting up your help center

Once the chat widget is on your Astro site, you might want to give customers a place to find their own answers. This is another feature that is usually locked behind a paywall.

Freshdesk, for example, puts their reporting and routing on paid plans that start at nineteen dollars a seat. We give you a public help center and a knowledge base for free.

You can write your articles, organize them by category, and host them on a public page. This reduces the number of simple questions your team has to answer. It is the same logic as having a clear menu in a restaurant. If people can see the prices and the options, they don't have to flag down a server to ask.

Closing thoughts on the installation

Adding a widget to an Astro site is simple, but the is:inline detail is everything. I have spent too many nights troubleshooting code that should have worked.

If you follow the steps of placing the script before the closing body tag and using that directive, you will have a professional communication system running in minutes. You get a shared inbox, a ticketing system, and live chat for zero dollars a month.

You only pay when you decide to use the phone features or the AI. It is a fair way to run a business, and it is the kind of tool I wish I had when I was writing scripts at 2am and watching leads disappear into a voicemail box.

Frequently asked questions

Where do I find my Astro layout file?

In most Astro projects, your base layout is located at src/layouts/Layout.astro. This file typically contains the HTML head and body tags that wrap every page on your site.

Why is my LastWorker widget not appearing on my Astro site?

The most common reason is a missing is:inline directive. Without this, Astro attempts to process or bundle the script, which often results in the data-agent-id attribute being lost or ignored.

Is there a limit to how many agents can use the free chat?

No. LastWorker offers unlimited seats and unlimited conversations for live chat and email support at no cost.

JH
Jerry Holt
Customer Operations Lead, LastWorker

Jerry Holt has spent eighteen years running customer operations for service businesses, from a two-location restaurant group to a regional dental practice with eleven front desks. He has hired receptionists, written phone scripts at 2 a.m., and watched good leads die in a voicemail box. These days he writes about what actually moves the needle on the phones, in the inbox, and over chat, and where AI earns its place versus where it gets in the way.

Stop letting customers go to voicemail.

Set up in about fifteen minutes. Live chat and email are free forever, so there is no bill to weigh up before you try it.