> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the SDK

> Add the Encore Web SDK (@encorekit/web-sdk) to your JavaScript or TypeScript project via npm, yarn, pnpm, or the UMD script bundle.

The Encore Web SDK is a lightweight, dependency-free JavaScript/TypeScript library that
displays targeted offers in your web app. It's framework-agnostic: it works with React,
Vue, Angular, Svelte, or plain JavaScript.

<Note>
  **New to Encore?** Start with the [Getting Started Guide](/quickstart) for account creation
  and guided setup. You'll need your publishable API key (`pk_...`) from
  [dashboard.encorekit.com](https://dashboard.encorekit.com).
</Note>

## Install

<Tabs>
  <Tab title="npm">
    ```bash theme={null}
    npm install @encorekit/web-sdk
    ```
  </Tab>

  <Tab title="yarn">
    ```bash theme={null}
    yarn add @encorekit/web-sdk
    ```
  </Tab>

  <Tab title="pnpm">
    ```bash theme={null}
    pnpm add @encorekit/web-sdk
    ```
  </Tab>

  <Tab title="Script tag (UMD)">
    For projects without a build system, the package ships a UMD bundle at
    `dist/umd/encore.min.js` (global name `Encore`). Serve it with your own assets:

    ```html theme={null}
    <script src="/vendor/encore.min.js"></script>
    <script>
      // The UMD global exposes the SDK instance on .default
      var EncoreSDK = Encore.default || Encore;
      EncoreSDK.configure({ apiKey: 'pk_live_yourpublishablekey' });
    </script>
    ```

    <Note>
      A hosted CDN URL for the script tag is available. Confirm the current URL with your Encore
      contact before shipping, or self-host `dist/umd/encore.min.js` from the npm package (the
      always-safe option).
    </Note>
  </Tab>
</Tabs>

## Verify

```javascript theme={null}
import Encore from '@encorekit/web-sdk';

console.log('Encore SDK version:', Encore.getVersion());
```

TypeScript types are bundled, so no extra packages are needed:

```typescript theme={null}
import Encore, { type EncoreConfig, type ShowResult } from '@encorekit/web-sdk';
```

## Browser support

Chrome/Edge, Firefox, and Safari (last 2 versions each); iOS Safari 15+. The SDK targets
ES2022 and uses `fetch` and `localStorage` (with `sessionStorage` and in-memory fallbacks);
no polyfills are needed on supported browsers.

If you use a Content Security Policy, allow the Encore API host:

```
connect-src 'self' https://api.encorekit.com;
```

## Next steps

* **[Configure the SDK](./configure)**: initialize with your API key
* **[User Management](./user-management)**: anonymous ids and `identify()`
* **[Present Offers](./present-offers)**: show offers in your app
