## 0.4.1 (2026-05-29)

This was a version bump only for @abapify/adt-puppeteer to align it with other projects, there were no code changes.

## 0.4.0 (2026-05-29)

This was a version bump only for @abapify/adt-puppeteer to align it with other projects, there were no code changes.

## 0.3.6 (2026-04-21)

This was a version bump only for @abapify/adt-puppeteer to align it with other projects, there were no code changes.

## 0.3.5 (2026-04-20)

This was a version bump only for @abapify/adt-puppeteer to align it with other projects, there were no code changes.

## 0.3.4 (2026-04-20)

### 🩹 Fixes

- **packages:** add repository/homepage/bugs to every published package ([e1853e48](https://github.com/abapify/adt-cli/commit/e1853e48))

### ❤️ Thank You

- Petr Plenkov

## 0.3.3 (2026-04-20)

This was a version bump only for @abapify/adt-puppeteer to align it with other projects, there were no code changes.

## 0.3.2 (2026-04-20)

This was a version bump only for @abapify/adt-puppeteer to align it with other projects, there were no code changes.

## 0.3.1 (2026-04-20)

This was a version bump only for @abapify/adt-puppeteer to align it with other projects, there were no code changes.

## 0.3.0 (2026-04-20)

This was a version bump only for @abapify/adt-puppeteer to align it with other projects, there were no code changes.

## 0.2.0 (2026-04-02)

This was a version bump only for @abapify/adt-puppeteer to align it with other projects, there were no code changes.

# Changelog

## [Unreleased]

### Added

- **Session Persistence**: Added `userDataDir` option to persist browser profile across runs
  - Set `userDataDir: true` to use default directory (`~/.adt/puppeteer-profile`)
  - Set `userDataDir: '/custom/path'` for custom profile location
  - Automatically validates existing sessions before prompting for re-login
  - Perfect for long-lived Okta/IDP tokens - only need to refresh SAP cookies
- **Silent Session Refresh**: Implemented `refresh()` method for automatic session renewal
  - Launches headless browser with persistent profile (no window popup)
  - Leverages stored Okta session to obtain fresh SAP cookies
  - Completes in <30 seconds without user interaction
  - Enables `npx adt auth refresh` command for manual refresh
  - ADT CLI can auto-refresh expired sessions transparently

### Changed

- Improved authentication flow to check for valid existing sessions when using persistent profiles
- Enhanced logging to show session validation status
- Refactored `userDataDir` to be a plugin-level setting (via `PuppeteerPluginOptions`)
  - Use `withPuppeteer(config, { userDataDir: true })` instead of per-destination config
  - Aligns with standard plugin architecture patterns

### Example

```typescript
import { puppeteer } from '@abapify/adt-puppeteer';

export default defineConfig({
  destinations: {
    // Enable session persistence (recommended for SSO/Okta)
    PROD: puppeteer({
      url: 'https://sap.example.com',
      userDataDir: true, // Okta cookies persist between runs
    }),
  },
});
```

**Benefits:**

- First run: Complete Okta login → profile saved
- Subsequent runs: Reuse Okta session → skip login or only refresh SAP cookies
- Massive time savings for users with SSO authentication
