From ebe6799ca623500e21864e5af398c38e9f42c9e2 Mon Sep 17 00:00:00 2001 From: Sara Wong Date: Thu, 25 Jan 2024 15:18:25 -0500 Subject: [PATCH] Update documentation --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b5e2fe11..6f8c0112 100644 --- a/README.md +++ b/README.md @@ -46,10 +46,10 @@ In many cases, you might need to repeatedly specify the same properties, such as You can add a `.with()` method to the root analytics service you initialized, which returns a new analytics object with the specified JSON merged on top of the existing defaults. ```ts -import { Analytics } from '@yext/analytics'; +import { analytics } from '@yext/analytics'; // Root analytics service with no defaults. -const rootAnalytics = new Analytics({ key: 'MY_API_KEY' }); +const rootAnalytics = analytics({ key: 'MY_API_KEY' }); // Pages analytics service with Pages defaults. const pageAnalytics = rootAnalytics.with({ pages: { siteId: 123 } });