# @amplitude/analytics-browser Official Amplitude SDK for Web # Doc See the [Browser SDK reference](https://amplitude.com/docs/sdks/analytics/browser/browser-sdk-2/reference) for a list and description of all available SDK methods. # Installation and Quick Start Please visit our :100:[Developer Center](https://www.docs.developers.amplitude.com/data/sdks/browser-2/) for instructions on installing and using our the SDK. ## Installation To get started with using Amplitude Browser SDK, install the package to your project via npm, yarn or script loader. ### Installing via package manager This SDK is available as a package on npm registry named `@amplitude/analytics-browser`. You can install the package using npm or yarn CLI. #### Using npm CLI ```sh npm install @amplitude/analytics-browser ``` #### Using yarn CLI ```sh # yarn yarn add @amplitude/analytics-browser ``` Import the package into your project and initialize it with your API key. ```ts import * as amplitude from '@amplitude/analytics-browser'; amplitude.init(''); ``` ### Installing via script loader This SDK is also available through CDN. Copy the script loader below and paste before the `` tag of every page you want to track and initialize it with your API key. ```html ``` ## Tracking events Once the SDK is initialize, you can start tracking events. ```ts amplitude.track('Page Viewed'); ``` For in-depth documentation, please visit to our [Developer Center](https://www.docs.developers.amplitude.com/data/sdks/sdk-quickstart/#browser).