Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
},
"integrations/front": {
"name": "@gitbook/integration-front",
"version": "1.0.0",
"version": "1.0.1",
"dependencies": {
"@gitbook/runtime": "*",
},
Expand Down Expand Up @@ -592,7 +592,7 @@
},
"integrations/slack": {
"name": "@gitbook/integration-slack",
"version": "2.5.3",
"version": "2.6.0",
"dependencies": {
"@ai-sdk/openai": "^2.0.62",
"@gitbook/api": "*",
Expand Down Expand Up @@ -729,7 +729,7 @@
},
"packages/api": {
"name": "@gitbook/api",
"version": "0.147.0",
"version": "0.151.0",
"dependencies": {
"event-iterator": "^2.0.0",
"eventsource-parser": "^3.0.0",
Expand All @@ -746,7 +746,7 @@
"name": "@gitbook/cli",
"version": "0.26.2",
"bin": {
"gitbook": "./cli.js",
"gitbook": "./cli.js"
},
"dependencies": {
"@1password/op-js": "^0.1.13",
Expand Down Expand Up @@ -802,9 +802,6 @@
},
},
},
"overrides": {
"@gitbook/openapi-parser": "^2.1.0",
},
"packages": {
"@1password/op-js": ["@1password/[email protected]", "", { "dependencies": { "lookpath": "^1.2.2", "semver": "^7.6.2" } }, "sha512-ZZBLxVqywFdvIbLv2xWw2N1ImSi183rRKf90vV19KRMReNyLwuD0dv6IrKrIdrJU33IuV3Gz85Z4K2a1PJTBDg=="],

Expand Down
7 changes: 7 additions & 0 deletions integrations/front/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @gitbook/integration-front

## 1.0.1

### Bug Fixes

- Fixed script injection to append to `<body>` element instead of `<head>`, matching Front's recommended implementation
- Removed duplicate `appendChild` call

## 1.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion integrations/front/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gitbook/integration-front",
"version": "1.0.0",
"version": "1.0.1",
"private": true,
"scripts": {
"typecheck": "tsc --noEmit",
Expand Down
8 changes: 4 additions & 4 deletions integrations/front/src/script.raw.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
(function (d, s) {
((d, s) => {
const chatId = '<TO_REPLACE>';

d = document;
s = d.createElement('script');
s.src = 'https://chat-assets.frontapp.com/v1/chat.bundle.js';
s.async = 1;
d.getElementsByTagName('head')[0].appendChild(s);

s.onload = function () {
s.onload = () => {
if (window.FrontChat) {
window.FrontChat('init', { chatId: chatId, useDefaultLauncher: true });
}
};

d.getElementsByTagName('head')[0].appendChild(s);
// Append to body (just before closing </body> tag) as per Front's documentation
d.getElementsByTagName('body')[0].appendChild(s);
})(window, document);
Loading