From d58a15dc206b979b5e8713eb4d2258bbd029a699 Mon Sep 17 00:00:00 2001 From: Ethan Jaffee Date: Thu, 1 Feb 2024 10:57:43 -0500 Subject: [PATCH] EventsSDK: Update ReadMe with new AnalyticsConfig --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f8c011..186509f 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,10 @@ Next, import and initialize the library in your application. When initializing y import { analytics } from '@yext/analytics'; // Root analytics service with no defaults. -const rootAnalytics = analytics({ key: 'MY_API_KEY' }); +const rootAnalytics = analytics({ + authorizationType: 'apiKey', + authorization: 'MY_API_KEY' +}); ``` In many cases, you might need to repeatedly specify the same properties, such as a Pages site ID or Chat bot ID. Yext Analytics allows you to avoid having to repeatedly specify the same code by allowing you to set **default values**. @@ -49,7 +52,10 @@ You can add a `.with()` method to the root analytics service you initialized, wh import { analytics } from '@yext/analytics'; // Root analytics service with no defaults. -const rootAnalytics = analytics({ key: 'MY_API_KEY' }); +const rootAnalytics = analytics({ + authorizationType: 'apiKey', + authorization: 'MY_API_KEY' +}); // Pages analytics service with Pages defaults. const pageAnalytics = rootAnalytics.with({ pages: { siteId: 123 } });