Skip to content

Commit c4a1428

Browse files
Finish integration, add changeset
1 parent 4e7a941 commit c4a1428

File tree

7 files changed

+300
-16
lines changed

7 files changed

+300
-16
lines changed

.changeset/hot-ads-decide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/integration-helpscout': major
3+
---
4+
5+
This change releases the first version of the HelpScout integration for GitBook
Loading
29.7 KB
Loading

integrations/helpscout/gitbook-manifest.yaml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,30 @@ name: helpscout
22
title: HelpScout
33
organization: gitbook
44
visibility: public
5-
description: ''
5+
description: Add the HelpScout chat widget to your published GitBook content
6+
summary: |
7+
# Overview
8+
9+
The HelpScout integration for GitBook allows you to display the HelpScout chat widget on your public documentation to connect and interact with your readers.
10+
11+
# How it works
12+
13+
Automatic chat widget on your documentation: Each of your connected GitBook spaces will fetch the HelpScout chat widget script and add it to your published content.
14+
15+
# Configure
16+
17+
You can configure the integration on single or multiple public spaces by navigating to the integrations in sub-navigation or org settings. You will then have to provide HelpScout ID to finish the configuration.
18+
categories:
19+
- analytics
620
script: src/index.tsx
7-
scopes: []
8-
blocks:
9-
- id: helpscout
10-
title: HelpScout
11-
description: My GitBook Integration
21+
icon: ./assets/icon.png
22+
previewImages:
23+
- assets/helpscout-preview.png
24+
# The following scope(s) are available only to GitBook Staff
25+
# See https://developer.gitbook.com/integrations/configurations#scopes
26+
scopes:
27+
- space:script:inject
28+
- site:script:inject
1229
secrets: {}
1330
contentSecurityPolicy:
1431
script-src: https://beacon-v2.helpscout.net;
@@ -17,15 +34,15 @@ configurations:
1734
properties:
1835
helpscout_id:
1936
type: string
20-
title: Koala Key
37+
title: HelpScout ID
2138
description: Your HelpScout integration ID.
2239
required:
2340
- helpscout_id
2441
site:
2542
properties:
2643
helpscout_id:
2744
type: string
28-
title: Koala Key
45+
title: HelpScout ID
2946
description: Your HelpScout integration ID.
3047
required:
3148
- helpscout_id

integrations/helpscout/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
2-
"name": "helpscout",
2+
"name": "@gitbook/integration-helpscout",
33
"private": true,
4+
"version": "0.0.1",
45
"scripts": {
56
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
67
"typecheck": "tsc --noEmit",
@@ -14,4 +15,4 @@
1415
"@gitbook/eslint-config": "*",
1516
"@gitbook/tsconfig": "*"
1617
}
17-
}
18+
}

integrations/helpscout/src/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ export const handleFetchEvent: FetchPublishScriptEventCallback = async (
2020
event,
2121
{ environment }: HelpScoutRuntimeContext
2222
) => {
23-
const koalaId =
23+
const helpscoutID =
2424
environment.spaceInstallation.configuration.helpscout_id ??
2525
environment.siteInstallation?.configuration?.helpscout_id ??
26-
'Koala Key not configured';
26+
'HelpScout ID not configured';
2727

28-
if (!koalaId) {
28+
if (!helpscoutID) {
2929
return;
3030
}
3131

32-
return new Response(script.replace('<TO_REPLACE>', koalaId), {
32+
return new Response(script.replace('<TO_REPLACE>', helpscoutID), {
3333
headers: {
3434
'Content-Type': 'application/javascript',
3535
'Cache-Control': 'max-age=604800',

package-lock.json

Lines changed: 263 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)