Step 2: Import the Library

Next, import and initialize the core library in your application.

import { provideAnalytics } from '@yext/analytics';

The bundle is ES6 compatible.

Code Sandbox Vanilla JS Example

In your index.ts file, import the library, and feel free to remove the additional JS on the page:

import { provideAnalytics } from '@yext/analytics';

// remove the following
// document.getElementById("app").innerHTML = `
// <h1>Hello Parcel!</h1>
// <div>
//   Look
//   <a href="https://parceljs.org" target="_blank" rel="noopener noreferrer">here</a>
//   for more info about Parcel.
// </div>
// ;