Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update documentation
Browse files Browse the repository at this point in the history
swong1213 committed Jan 25, 2024
1 parent 52aa4b4 commit ebe6799
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 } });

0 comments on commit ebe6799

Please sign in to comment.