Help widget
The Help widget puts a Help button on your company's website or web app. Customers select it to report a problem or send feedback without leaving the page, and the request arrives in the Support inbox like any other ticket. Set it up under Support, Help widget.
Add the widget to your website
- Under New widget, give it a name (such as "Customer app"), choose the brand, and enter the address of each website that should show it, one per line, starting with https:// (for example https://app.example.com). Select Create widget.
- Copy the identity secret that is shown once and keep it for your developer (see "Signed-in customers" below), then select Done.
- Select Copy code and paste the code before the closing
</body>tag of every page that should show the button. It looks like this:
Pages that still have the earlier code (<script>window.astroSupport = window.astroSupport || [];</script> <script src="https://astrocsm.ai/api/public/support/widget/v2.js" integrity="sha384-..." crossorigin="anonymous" data-widget="wk_..." async></script>v1.js) keep working; paste the new code to let your app ask for ratings.
The widget only appears on the websites you listed, exactly as written (https://www.example.com and https://example.com are two different websites). On any other website nothing shows, and anything sent from one is ignored. The help panel is a page of ASTRO CSM, so your website cannot read what the customer types.
Choose how it looks and what it offers
- Help button: bottom right or bottom left, its text and colour (empty: the brand's colour). Choose No button
to open the widget from your own menu instead: your page calls
astroSupport.push(["open"]). - What it offers: Report a problem, Send feedback (with a rating if you like), Rate us (see Ratings), whether it asks which product, and a security check against robots.
- Quick ratings: the scale, how many days before the same visitor is asked again, when a rating makes a feedback ticket, and
the question. Your app can ask with
astroSupport.push(["rate"]); listen withastroSupport.push(["on", "rated", fn]). - Untick On to hide the widget everywhere without removing the code. New key makes a new code; pages with the old code stop showing the widget until you paste the new one.
Live chat
With Support Pro, the panel also shows Chat with us while someone on your team is available for chat and the brand is open. See Live chat.
Known problems
With Support Pro, a known problem you show a banner for appears at the top of the help panel while it is open, with its workaround, so customers see it before they write in.
What comes with each request
The ticket shows the page the customer was on, their browser and screen size. Your page can add details such as the version of your app:
astroSupport.push(["context", { appVersion: "4.2.1", plan: "Pro" }]). A screenshot is added only when the customer selects
Add a screenshot (the browser asks them what to share), and log files only when they attach them. Details named
Page, Browser, Company or License are left out: ASTRO writes those itself, and the company and
license come only from a signed-in customer's token.
Signed-in customers
When customers are signed in to your app, your own server can tell the widget who they are. The widget then fills in their e-mail address (they cannot change it), marks their requests as verified, ties them to the contact in ASTRO CSM, and shows them My requests: their requests with this brand, the replies, and a box to answer.
- On your server, make a short-lived token signed with the widget's identity secret (HS256), with
audset to the widget's key (thewk_...value in the code),sub(your user id),email, optionallyname,companyandlicense, andiatandexpno more than an hour apart. - Put the token in the page and call
astroSupport.push(["identify", { token: "..." }]). CallastroSupport.push(["logout"])when the customer signs out.
C# (Microsoft.IdentityModel.JsonWebTokens):
var token = new JsonWebTokenHandler().CreateToken(new SecurityTokenDescriptor
{
Audience = "wk_...",
Claims = new Dictionary<string, object> { ["sub"] = user.Id, ["email"] = user.Email, ["name"] = user.Name },
IssuedAt = DateTime.UtcNow,
Expires = DateTime.UtcNow.AddMinutes(30),
SigningCredentials = new SigningCredentials(
new SymmetricSecurityKey(Encoding.UTF8.GetBytes(identitySecret)), SecurityAlgorithms.HmacSha256),
});
Node (jsonwebtoken):
const token = jwt.sign(
{ sub: user.id, email: user.email, name: user.name },
process.env.ASTRO_WIDGET_SECRET,
{ algorithm: 'HS256', audience: 'wk_...', expiresIn: '30m' });
Python (PyJWT):
now = int(time.time())
token = jwt.encode(
{"sub": user.id, "email": user.email, "name": user.name, "aud": "wk_...", "iat": now, "exp": now + 1800},
identity_secret, algorithm="HS256")
Keep the identity secret on your server only, never in a web page. A token that is wrong, expired or made for another widget is ignored: the customer simply uses the widget without being signed in, and the reason shows under Latest refused sign-ins, with the most recent time of each reason. Recording a refused sign-in never changes the widget's settings, so a new key or a removed website always stays as you saved it.
Change the identity secret
- Select New identity secret and copy it. The old one keeps working.
- Put the new secret on your server.
- Select Stop the old secret. From then on only the new one works.