From 7c39474d10fec241ab34dae178578388c848066b Mon Sep 17 00:00:00 2001 From: Ron Cohen Date: Thu, 15 Feb 2024 11:41:40 +0100 Subject: [PATCH 001/349] Cookies and use of backend HTTP API (#97) * Cookies and use of backend HTTP API * fix style --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 7f184a02..173ace90 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,9 @@ The Bucket SDK comes with a Live Satisfaction collection mode enabled by default Note: To get started with automatic feedback collection, make sure you call `bucket.user()`. +Live Satisfaction works even if you're not using the SDK to send events to Bucket. +It works because the Bucket SDK maintains a live connection to Bucket's servers and can show a Live Satisfaction prompt whenever the Bucket servers determines that an event should trigger a prompt - regardless of how this event is sent to Bucket. + You can find all the options to make changes to the default behaviour in the [Bucket feedback documentation](./FEEDBACK.md). #### Bucket feedback UI @@ -106,6 +109,15 @@ import { sha256 } from 'crypto-hash'; bucket.user(await sha256("john_doe")); ``` +### Use of cookies + +The Bucket SDK uses a couple of cookies to support Live Satisfaction. These cookies are not used for tracking purposes and thus should not need to appear in cookie consent forms. + +The two cookies are: + +- `bucket-prompt-${userId}`: store the last Live Satisfaction prompt message ID received to avoid repeating prompts +- `bucket-token-${userId}`: caching a token used to connect to Bucket's live messaging infrastructure that is used to deliver Live Satisfaction prompts in real time. + ### Custom attributes You can pass attributes as a object literal to the `user`, `company` and `track` methods (2nd argument). From eee00b16cc28dfb24bc229c8c6b2c30d00c5caff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20M=C3=BCller?= Date: Wed, 27 Mar 2024 13:55:01 +0100 Subject: [PATCH 002/349] Fix test data mock that fails when run in a non-UTC timezone (#100) --- test/sse.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sse.test.ts b/test/sse.test.ts index 7c3891e8..3c92e1a8 100644 --- a/test/sse.test.ts +++ b/test/sse.test.ts @@ -21,7 +21,7 @@ const tokenRequest = { }; const tokenDetails = { token: "token", - expires: new Date(2023, 0, 1).getTime(), + expires: new Date("2023-01-01T00:00:00.000Z").getTime(), }; const userId = "foo"; From c3aedde0b53ddf9c38ba0b4fdc50e2bddcc94790 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:51:32 +0200 Subject: [PATCH 003/349] Bump vite from 5.0.12 to 5.0.13 (#102) Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.0.12 to 5.0.13. - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/v5.0.13/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v5.0.13/packages/vite) --- updated-dependencies: - dependency-name: vite dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index bd2338b2..a4d02979 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "ts-loader": "^9.5.1", "ts-node": "^10.9.2", "typescript": "^5.3.3", - "vite": "^5.0.12", + "vite": "^5.0.13", "vite-plugin-dts": "^3.7.0", "vitest": "^1.1.3", "webpack": "^5.89.0", diff --git a/yarn.lock b/yarn.lock index 237ebf56..4f9f15c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5501,10 +5501,10 @@ vite-plugin-dts@^3.7.0: kolorist "^1.8.0" vue-tsc "^1.8.26" -vite@^5.0.0, vite@^5.0.12: - version "5.0.12" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.0.12.tgz#8a2ffd4da36c132aec4adafe05d7adde38333c47" - integrity sha512-4hsnEkG3q0N4Tzf1+t6NdN9dg/L3BM+q8SWgbSPnJvrgH2kgdyzfVJwbR1ic69/4uMJJ/3dqDZZE5/WwqW8U1w== +vite@^5.0.0, vite@^5.0.13: + version "5.0.13" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.0.13.tgz#605865b0e482506163e3f04f91665238f3be8cf1" + integrity sha512-/9ovhv2M2dGTuA+dY93B9trfyWMDRQw2jdVBhHNP6wr0oF34wG2i/N55801iZIpgUpnHDm4F/FabGQLyc+eOgg== dependencies: esbuild "^0.19.3" postcss "^8.4.32" From cb1cea2ea83d4d57c4a21d62d546e02881746e66 Mon Sep 17 00:00:00 2001 From: Richard Foster Date: Thu, 4 Apr 2024 15:09:44 +0100 Subject: [PATCH 004/349] Support offsetting feedback dialog (#99) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Support offsetting feedback dialog * Improve offset documentation * Fix docs * Simplify offset implementation * Linting * Document x and y offset options Co-authored-by: Peter Müller * Linting --------- Co-authored-by: Peter Müller --- FEEDBACK.md | 6 +++++- dev/app.tsx | 31 +++++++++++++++++++++++++++++-- src/feedback/FeedbackDialog.tsx | 31 +++++++++++++++++++++++++++---- src/feedback/types.ts | 13 ++++++++++++- 4 files changed, 73 insertions(+), 8 deletions(-) diff --git a/FEEDBACK.md b/FEEDBACK.md index f7e36c6b..785ae40d 100644 --- a/FEEDBACK.md +++ b/FEEDBACK.md @@ -168,10 +168,14 @@ Using a dialog is a soft push for feedback. It lets the user continue their work The default feedback UI behaviour is a dialog placed in the bottom right corner of the viewport. -```javascript +```typescript position: { type: "DIALOG", placement: "top-left" | "top-right" | "bottom-left" | "bottom-right" + offset?: { + x?: string | number; // e.g. "-5rem", "10px" or 10 (pixels) + y?: string | number; + } } ``` diff --git a/dev/app.tsx b/dev/app.tsx index 3fc8d690..c7e71ce3 100644 --- a/dev/app.tsx +++ b/dev/app.tsx @@ -40,6 +40,8 @@ const CUSTOM_TRANSLATIONS: FeedbackTranslations = { export function App() { const [placement, setPlacement] = useState("bottom-right"); + const [offsetX, setOffsetX] = useState("1rem"); + const [offsetY, setOffsetY] = useState("1rem"); const [openWithCommentVisible, setOpenWithCommentVisible] = useState(false); const [customTranslations, setCustomTranslations] = useState(false); @@ -55,8 +57,10 @@ export function App() {

Feedback configs

-
+
+ + + setOffsetX(e.currentTarget.value)} + /> + + setOffsetY(e.currentTarget.value)} + />