# Can I write my Playwright scripts in TypeScript?

> Loadster Playwright scripts support both JavaScript and TypeScript. You can paste in a .ts or .js Playwright test and it just works.

Source: https://loadster.com/faqs/playwright-typescript-support/

Yes. Loadster Playwright scripts support both **JavaScript** and **TypeScript**, whichever you prefer. Loadster runs your
script through the Playwright Test runner, which compiles TypeScript automatically—so type annotations, interfaces, and
other TypeScript features work out of the box with no extra configuration.

```typescript
import {test, expect, type Page} from '@playwright/test';

interface Credentials {
    username: string;
    password: string;
}

test('login with typed credentials', async ({page}: {page: Page}) => {
    const creds: Credentials = {username: 'demo', password: 'secret'};

    await page.goto('https://example.com/login');
    await page.fill('#username', creds.username);
    await page.fill('#password', creds.password);
    await page.click('button[type="submit"]');
});
```

You can paste an existing `.ts` or `.js` Playwright test straight into the script editor—there's nothing extra to
configure either way. See [Playwright Scripting](https://loadster.com/manual/playwright-scripts/) for more on writing and playing Playwright
scripts.

