Skip to content

Commit c9511b1

Browse files
committed
update docs and links as this is v4 only
1 parent 73379ce commit c9511b1

5 files changed

Lines changed: 50 additions & 19 deletions

File tree

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam._index/route.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,6 @@ function HelpfulInfoHasTasks({ onClose }: { onClose: () => void }) {
715715
isExternal
716716
/>
717717
<LinkWithIcon to={docsPath("/examples/puppeteer")} description="Puppeteer" isExternal />
718-
<LinkWithIcon to={docsPath("/examples/lightpanda")} description="Lightpanda" isExternal />
719718
<LinkWithIcon to={docsPath("/examples/react-pdf")} description="React to PDF" isExternal />
720719
<LinkWithIcon
721720
to={docsPath("/examples/resend-email-sequence")}

docs/config/config-file.mdx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,6 @@ See the [syncEnvVars documentation](/config/extensions/syncEnvVars) for more inf
433433

434434
See the [puppeteer documentation](/config/extensions/puppeteer) for more information.
435435

436-
#### lightpanda
437-
438-
See the [Lightpanda documentation](/config/extensions/lightpanda) for more information.
439-
440436
#### ffmpeg
441437

442438
See the [ffmpeg documentation](/config/extensions/ffmpeg) for more information.
Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
---
22
title: "Lightpanda"
33
sidebarTitle: "lightpanda"
4-
description: "Use the lightpanda build extension to be able to use Lightpanda Browser in your project"
4+
description: "Use the lightpanda build extension to add Lightpanda browser to your project"
5+
tag: "v4"
56
---
67

7-
<ScrapingWarning />
8+
import UpgradeToV4Note from "/snippets/upgrade-to-v4-note.mdx";
89

9-
To use Lightpanda in your project, add these build settings to your `trigger.config.ts` file:
10+
<UpgradeToV4Note />
11+
12+
To use the Lightpanda browser in your project, add the extension to your `trigger.config.ts` file:
1013

1114
```ts trigger.config.ts
12-
import { defineConfig } from "@trigger.dev/sdk/v3";
15+
import { defineConfig } from "@trigger.dev/sdk";
1316
import { lightpanda } from "@trigger.dev/build/extensions/lightpanda";
1417

1518
export default defineConfig({
@@ -21,10 +24,42 @@ export default defineConfig({
2124
});
2225
```
2326

24-
And add the following environment variable in your Trigger.dev dashboard on the Environment Variables page:
27+
### Options
2528

26-
```bash
27-
LIGHTPANDA_BROWSER_PATH: "/usr/bin/lightpanda",
29+
- `version`: The version of the browser to install. Default: `"nightly"`.
30+
- `disableTelemetry`: Whether to disable telemetry. Default: `false`.
31+
32+
For example:
33+
34+
```ts trigger.config.ts
35+
import { defineConfig } from "@trigger.dev/sdk";
36+
import { lightpanda } from "@trigger.dev/build/extensions/lightpanda";
37+
38+
export default defineConfig({
39+
project: "<project ref>",
40+
build: {
41+
extensions: [
42+
lightpanda({
43+
version: "nightly",
44+
disableTelemetry: true,
45+
}),
46+
],
47+
},
48+
});
2849
```
2950

30-
Follow [this example](/guides/examples/lightpanda) to get setup with Trigger.dev and Lightpanda in your project.
51+
### Environment variables
52+
53+
The extension sets the following environment variables during the build:
54+
55+
- `LIGHTPANDA_BROWSER_PATH`: Set to `/usr/bin/lightpanda` so the browser can be found at runtime
56+
57+
#### Development
58+
59+
When running in dev, you will first have to download the Lightpanda browser binary. See [Lightpanda's installation guide](https://lightpanda.io/docs/getting-started/installation).
60+
61+
Then, set the `LIGHTPANDA_BROWSER_PATH` environment variable to the path of the Lightpanda browser binary.
62+
63+
```bash
64+
export LIGHTPANDA_BROWSER_PATH="/usr/local/bin/lightpanda"
65+
```

docs/config/extensions/overview.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ Trigger.dev provides a set of built-in extensions that you can use to customize
5050
| :-------------------------------------------------------------------- | :----------------------------------------------------------------------------- |
5151
| [prismaExtension](/config/extensions/prismaExtension) | Using prisma in your Trigger.dev tasks |
5252
| [pythonExtension](/config/extensions/pythonExtension) | Execute Python scripts in your project |
53-
| [playwright](/config/extensions/playwright) | Use Playwright in your Trigger.dev tasks |
5453
| [puppeteer](/config/extensions/puppeteer) | Use Puppeteer in your Trigger.dev tasks |
55-
| [lightpanda](/config/extensions/lightpanda) | Use Lightpanda in your Trigger.dev tasks |
5654
| [ffmpeg](/config/extensions/ffmpeg) | Use FFmpeg in your Trigger.dev tasks |
5755
| [aptGet](/config/extensions/aptGet) | Install system packages in your build image |
5856
| [additionalFiles](/config/extensions/additionalFiles) | Copy additional files to your build image |

docs/guides/examples/lightpanda.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ tag: "v4"
66
---
77

88
import ScrapingWarning from "/snippets/web-scraping-warning.mdx";
9+
import UpgradeToV4Note from "/snippets/upgrade-to-v4-note.mdx";
10+
11+
<UpgradeToV4Note />
912

1013
## Overview
1114

@@ -31,7 +34,7 @@ LIGHTPANDA_TOKEN: "<your-token>",
3134
```
3235

3336
```ts trigger/lightpanda-cloud-puppeteer.ts
34-
import { logger, task } from '@trigger.dev/sdk/v3'
37+
import { logger, task } from '@trigger.dev/sdk'
3538
import puppeteer from 'puppeteer'
3639

3740
export const lightpandaCloudPuppeteer = task({
@@ -109,7 +112,7 @@ You will have to pass the URL as a payload when triggering the task.
109112

110113
### Task
111114
```ts trigger/lightpanda-lightpanda-fetch.ts
112-
import { logger, task } from '@trigger.dev/sdk/v3'
115+
import { logger, task } from '@trigger.dev/sdk'
113116
import { execSync } from 'node:child_process'
114117

115118
export const lightpandaFetch = task({
@@ -154,7 +157,7 @@ This task initialises a Lightpanda CDP server to allow you to scrape directly vi
154157
Your task will have to launch a child process in order to have the websocket available to scrape using Puppeteer.
155158

156159
```ts trigger/lightpandaCDP.ts
157-
import { logger, task } from '@trigger.dev/sdk/v3'
160+
import { logger, task } from '@trigger.dev/sdk'
158161
import { spawn, type ChildProcessWithoutNullStreams } from 'node:child_process'
159162
import puppeteer from 'puppeteer'
160163

@@ -171,7 +174,7 @@ const spawnLightpanda = async (log: typeof logger) =>
171174
])
172175

173176
child.on('spawn', async () => {
174-
log.info("Running Lightpanda's CDP server…", {
177+
logger.info("Running Lightpanda's CDP server…", {
175178
pid: child.pid,
176179
})
177180

0 commit comments

Comments
 (0)