---
title: "Getting Started — Vanilla JS"
description: "Drop the EmbedPDF viewer into any page in minutes."
integration: "Vanilla JS"
source: "https://www.embedpdf.com/docs/viewer/vanilla/getting-started"
---

# Getting Started

The ready-made viewer gives you a complete PDF experience with a small
integration surface. Pick your stack in the sidebar; this page and every
example will stay on that integration.

## Installation

Vanilla JavaScript can load the viewer directly from a CDN. Framework projects
install their dedicated adapter with pnpm.

**`install.html`**

```html
<script type="module">
  import EmbedPDF from 'https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js';
</script>
```

## Add your first viewer

Give the viewer a PDF URL and a height. The adapter handles the engine,
plugins, toolbar, and document lifecycle for you.

**`basic.html`**

```html
<div id="pdf-viewer" style="height: 500px"></div>

<script type="module">
  import EmbedPDF from 'https://cdn.jsdelivr.net/npm/@embedpdf/snippet@2/dist/embedpdf.js';

  const viewer = EmbedPDF.init({
    type: 'container',
    target: document.getElementById('pdf-viewer'),
    src: 'https://snippet.embedpdf.com/ebook.pdf',
  });
</script>
```

## Where to go next

- Configure the toolbar and available viewer controls.
- Listen to the ready event when you need access to the plugin registry.
- Switch to the Headless docs when you want to build the entire interface yourself.
