Constimport { PlaywrightEnvironment } from "effect-playwright/experimental";
import { chromium } from "playwright-core";
const env = PlaywrightEnvironment.layer(chromium);
const program = Effect.gen(function* () {
const browser = yield* PlaywrightBrowser;
const page = yield* browser.newPage();
yield* page.goto("https://example.com");
}).pipe(PlaywrightEnvironment.withBrowser, Effect.provide(env));
Provides a scoped
PlaywrightBrowserservice, allowing you to access the browser from the context (e.g. by yieldingPlaywrightBrowser).You will need to provide the
PlaywrightEnvironmentlayer first.