diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 8eb00a47fd..742de4bc49 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -13,4 +13,4 @@ jobs: - run: gh workflow run deploy.yaml --repo apify/apify-docs-private env: GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} - SMARTLOOK_PROJECT_KEY: ${{ secrets.SMARTLOOK_PROJECT_KEY }} + INTERCOM_APP_ID: ${{ secrets.INTERCOM_APP_ID }} diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 53a0cd1306..3a1cf97b5c 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -36,7 +36,7 @@ jobs: env: APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - SMARTLOOK_PROJECT_KEY: ${{ secrets.SMARTLOOK_PROJECT_KEY }} + INTERCOM_APP_ID: ${{ secrets.INTERCOM_APP_ID }} - name: Set up GitHub Pages uses: actions/configure-pages@v5 diff --git a/.github/workflows/lychee.yml b/.github/workflows/lychee.yml index b8d550c565..15a7510883 100644 --- a/.github/workflows/lychee.yml +++ b/.github/workflows/lychee.yml @@ -29,7 +29,7 @@ jobs: env: APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - SMARTLOOK_PROJECT_KEY: ${{ secrets.SMARTLOOK_PROJECT_KEY }} + INTERCOM_APP_ID: ${{ secrets.INTERCOM_APP_ID }} - name: Run Lychee Link Checker id: lychee diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 07dae9ce2c..1641501437 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -30,7 +30,7 @@ jobs: - run: npm run build env: - SMARTLOOK_PROJECT_KEY: ${{ secrets.SMARTLOOK_PROJECT_KEY }} + INTERCOM_APP_ID: ${{ secrets.INTERCOM_APP_ID }} lint_content: name: Lint markdown content diff --git a/apify-docs-theme/package.json b/apify-docs-theme/package.json index dd425d5151..53c891e63f 100644 --- a/apify-docs-theme/package.json +++ b/apify-docs-theme/package.json @@ -25,7 +25,6 @@ "axios": "^1.7.4", "babel-loader": "^9.1.3", "docusaurus-gtm-plugin": "^0.0.2", - "docusaurus-plugin-smartlook": "^1.0.2", "postcss-preset-env": "^9.3.0", "prism-react-renderer": "^2.0.6" }, diff --git a/apify-docs-theme/src/config.js b/apify-docs-theme/src/config.js index b1c5ca385e..a170092b6b 100644 --- a/apify-docs-theme/src/config.js +++ b/apify-docs-theme/src/config.js @@ -13,7 +13,6 @@ const themeConfig = ({ hideable: true, }, }, - smartlook: { projectKey: process.env.SMARTLOOK_PROJECT_KEY || '-' }, navbar: { title: 'Apify Docs', logo: { @@ -266,7 +265,6 @@ const themeConfig = ({ }); const plugins = [ - 'docusaurus-plugin-smartlook', [ 'docusaurus-gtm-plugin', { diff --git a/docusaurus.config.js b/docusaurus.config.js index bf418bb5f4..1e2ba8d731 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -33,7 +33,19 @@ module.exports = { sizes: 'any', }, }, - ], + // Intercom messenger + process.env.INTERCOM_APP_ID && { + tagName: 'script', + innerHTML: `window.intercomSettings={api_base:"https://api-iam.intercom.io",app_id:"${process.env.INTERCOM_APP_ID}"};`, + attributes: {}, + }, + // Intercom messenger + process.env.INTERCOM_APP_ID && { + tagName: 'script', + innerHTML: `(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',w.intercomSettings);}else{var d=document;var i=function(){i.c(arguments);};i.q=[];i.c=function(args){i.q.push(args);};w.Intercom=i;var l=function(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/${process.env.INTERCOM_APP_ID}';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);};if(document.readyState==='complete'){l();}else if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()`, + attributes: {}, + }, + ].filter(Boolean), onBrokenLinks: /** @type {import('@docusaurus/types').ReportingSeverity} */ ('throw'), diff --git a/package-lock.json b/package-lock.json index 75173c4e00..f6a0ff3a08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -65,7 +65,7 @@ }, "apify-docs-theme": { "name": "@apify/docs-theme", - "version": "1.0.128", + "version": "1.0.130", "license": "ISC", "dependencies": { "@apify/docs-search-modal": "^1.0.26", @@ -74,7 +74,6 @@ "axios": "^1.7.4", "babel-loader": "^9.1.3", "docusaurus-gtm-plugin": "^0.0.2", - "docusaurus-plugin-smartlook": "^1.0.2", "postcss-preset-env": "^9.3.0", "prism-react-renderer": "^2.0.6" }, @@ -9377,12 +9376,6 @@ "@docusaurus/utils": "^3.0.0" } }, - "node_modules/docusaurus-plugin-smartlook": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/docusaurus-plugin-smartlook/-/docusaurus-plugin-smartlook-1.0.2.tgz", - "integrity": "sha512-HKOavP16LMWsdZ6xpEqGecIweButfZ3hteCy6FZb1+s8c5b3hFsn9n1ohChAC1B1KETQZG5OhmQ270C0ak06Rg==", - "deprecated": "docusaurus-plugin-smartlook is now available at @stackql/docusaurus-plugin-smartlook" - }, "node_modules/docusaurus-theme-redoc": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/docusaurus-theme-redoc/-/docusaurus-theme-redoc-2.0.2.tgz",