@graphcommerce/algolia-personalization 9.0.0-canary.83 → 9.0.0-canary.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,23 +1,7 @@
1
1
  # @graphcommerce/algolia-personalization
2
2
 
3
- ## 9.0.0-canary.83
3
+ ## 9.0.0-canary.84
4
4
 
5
- ## 9.0.0-canary.82
5
+ ### Minor Changes
6
6
 
7
- ## 9.0.0-canary.81
8
-
9
- ## 9.0.0-canary.80
10
-
11
- ## 9.0.0-canary.79
12
-
13
- ## 9.0.0-canary.78
14
-
15
- ## 9.0.0-canary.77
16
-
17
- ## 9.0.0-canary.76
18
-
19
- ## 9.0.0-canary.75
20
-
21
- ## 9.0.0-canary.74
22
-
23
- ## 9.0.0-canary.73
7
+ - [#2377](https://github.com/graphcommerce-org/graphcommerce/pull/2377) [`56fcc45`](https://github.com/graphcommerce-org/graphcommerce/commit/56fcc45b60e43574c64fcdd7b02f8062d677e250) - Integrated algolia personalisation and algolia analytics into graphql mesh. Built user profiles and gives user personalised results. Keep track of the user data and view in algolia analytics dashboard ([@Renzovh](https://github.com/Renzovh))
package/README.md CHANGED
@@ -1,36 +1,3 @@
1
1
  # Algolia Magento 2
2
2
 
3
- An implementation of Algolia personalization/Analytics through the GraphQL Mesh.
4
-
5
- ## Prerequisites
6
-
7
- 1. Make sure you have configured @graphcommerce/algolia-mesh.
8
- 2. As this is an extension of the google-datalayer. Make sure you have installed
9
- @graphcommerce/google-datalayer
10
-
11
- ## Installation
12
-
13
- 1. Find current version of your `@graphcommerce/next-ui` in your package.json.
14
- 2. `yarn add @graphcommerce/algolia-personalization@9.0.0` (replace 9.0.0 with
15
- the version of the step above)
16
-
17
- ## Configuration
18
-
19
- 1. See [Config](./Config.graphqls) for the configuration values. Add the
20
- following to your graphcommerce.config.js:
21
-
22
- ```js
23
- const config = {
24
- // Even if you do not use personalization, enabling analytics still allows you to track events in Algolia.
25
- algoliaEnableAnalytics: true,
26
- algoliaPersonalizationEnabled: true,
27
- }
28
- ```
29
-
30
- 2. In your algolia dashboard make sure, you have personalization enabled.
31
- 3. Continue to browse the site, and make sure your events are logged in de event
32
- debugger in your algolia dashboard. In the under left corner.
33
- `Data Sources > Events > Debugger`. Once you've collected several events, you
34
- can start configuring personalization
35
- 4. in `Enchance > personalization` setup the strategies. Note: if you can't find
36
- some events, make sure you have send several.
3
+ [See algolia docs](../../docs/magento/algolia.md)
package/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './mesh/getUserToken'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/algolia-personalization",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "9.0.0-canary.83",
5
+ "version": "9.0.0-canary.84",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,17 +12,18 @@
12
12
  }
13
13
  },
14
14
  "scripts": {
15
- "generate-insights": "tsx scripts/generate-insights-spec.mts"
15
+ "generate": "tsx scripts/generate-insights-spec.mts"
16
16
  },
17
17
  "peerDependencies": {
18
- "@graphcommerce/algolia-mesh": "^9.0.0-canary.83",
19
- "@graphcommerce/google-datalayer": "^9.0.0-canary.83",
20
- "@graphcommerce/graphql": "^9.0.0-canary.83",
21
- "@graphcommerce/graphql-mesh": "^9.0.0-canary.83",
22
- "@graphcommerce/magento-customer": "^9.0.0-canary.83",
23
- "@graphcommerce/magento-product": "^9.0.0-canary.83",
24
- "@graphcommerce/next-config": "^9.0.0-canary.83",
25
- "@graphcommerce/next-ui": "^9.0.0-canary.83",
18
+ "@graphcommerce/algolia-insights": "^9.0.0-canary.84",
19
+ "@graphcommerce/algolia-products": "^9.0.0-canary.84",
20
+ "@graphcommerce/google-datalayer": "^9.0.0-canary.84",
21
+ "@graphcommerce/graphql": "^9.0.0-canary.84",
22
+ "@graphcommerce/graphql-mesh": "^9.0.0-canary.84",
23
+ "@graphcommerce/magento-customer": "^9.0.0-canary.84",
24
+ "@graphcommerce/magento-product": "^9.0.0-canary.84",
25
+ "@graphcommerce/next-config": "^9.0.0-canary.84",
26
+ "@graphcommerce/next-ui": "^9.0.0-canary.84",
26
27
  "react": "^18.2.0"
27
28
  },
28
29
  "devDependencies": {
@@ -1,3 +1,4 @@
1
+ import { ALGOLIA_USER_TOKEN_COOKIE_NAME } from '@graphcommerce/algolia-insights'
1
2
  import {
2
3
  type getInContextInput as getInContextInputType,
3
4
  type useInContextInput as useInContextInputType,
@@ -5,12 +6,10 @@ import {
5
6
  import type { InContextInput } from '@graphcommerce/graphql-mesh'
6
7
  import type { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
7
8
  import { cookie } from '@graphcommerce/next-ui'
8
- import { ALGOLIA_USER_TOKEN_COOKIE_NAME } from '../hooks/useSendAlgoliaEvent'
9
9
 
10
10
  export const config: PluginConfig = {
11
11
  type: 'function',
12
12
  module: '@graphcommerce/graphql',
13
- ifConfig: 'algolia.personalizationEnabled',
14
13
  }
15
14
 
16
15
  export const getInContextInput: FunctionPlugin<typeof getInContextInputType> = (
@@ -1,11 +1,10 @@
1
- import type { getSearchResultsInput as getSearchResultsInputType } from '@graphcommerce/algolia-mesh'
1
+ import type { getSearchResultsInput as getSearchResultsInputType } from '@graphcommerce/algolia-products'
2
2
  import { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
3
3
  import { getUserToken } from '../mesh/getUserToken'
4
4
 
5
5
  export const config: PluginConfig = {
6
6
  type: 'function',
7
- module: '@graphcommerce/algolia-mesh',
8
- ifConfig: 'algolia.personalizationEnabled',
7
+ module: '@graphcommerce/algolia-products',
9
8
  }
10
9
 
11
10
  export const getSearchResultsInput: FunctionPlugin<typeof getSearchResultsInputType> = async (
@@ -15,6 +14,5 @@ export const getSearchResultsInput: FunctionPlugin<typeof getSearchResultsInputT
15
14
  ) => ({
16
15
  ...(await prev(args, context)),
17
16
  clickAnalytics: true,
18
- analytics: true,
19
17
  userToken: getUserToken(context),
20
18
  })
@@ -1,11 +1,10 @@
1
- import type { getSearchSuggestionsInput as getSearchSuggestionsInputType } from '@graphcommerce/algolia-mesh'
1
+ import type { getSearchSuggestionsInput as getSearchSuggestionsInputType } from '@graphcommerce/algolia-products'
2
2
  import { FunctionPlugin, PluginConfig } from '@graphcommerce/next-config'
3
3
  import { getUserToken } from '../mesh/getUserToken'
4
4
 
5
5
  export const config: PluginConfig = {
6
6
  type: 'function',
7
- module: '@graphcommerce/algolia-mesh',
8
- ifConfig: 'algolia.analyticsEnabled',
7
+ module: '@graphcommerce/algolia-products',
9
8
  }
10
9
 
11
10
  export const getSearchSuggestionsInput: FunctionPlugin<
@@ -13,6 +12,5 @@ export const getSearchSuggestionsInput: FunctionPlugin<
13
12
  > = async (prev, search, context) => ({
14
13
  ...(await prev(search, context)),
15
14
  clickAnalytics: true,
16
- analytics: true,
17
15
  userToken: getUserToken(context),
18
16
  })
package/Config.graphqls DELETED
@@ -1,10 +0,0 @@
1
- extend input GraphCommerceAlgoliaConfig {
2
- """
3
- Send algolia analytics events.
4
- """
5
- analyticsEnabled: Boolean
6
- """
7
- Enable personalized queries.
8
- """
9
- personalizationEnabled: Boolean
10
- }