Integraties

Pipedream

Draai Thunderbit vanuit een Pipedream Code-step — Node.js of Python, jouw keuze

Pipedream is de developer-vriendelijke neef van Zapier — elke workflow is een echt script dat je kunt bewerken. Gebruik een Code-step voor volledige controle of de HTTP / Webhook-action voor de no-code-route.

Code-step (Node.js)

import { defineComponent } from '@pipedream/core';

export default defineComponent({
  props: {
    thunderbit: { type: 'app', app: 'thunderbit' }, // or use an env var
    url:        { type: 'string' },
  },
  async run({ steps, $ }) {
    const res = await fetch(
      'https://openapi.thunderbit.com/openapi/v1/distill',
      {
        method: 'POST',
        headers: {
          Authorization: `Bearer ${process.env.THUNDERBIT_API_KEY}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({ url: this.url, renderMode: 'basic' }),
      },
    );
    const json = await res.json();
    return json.data.markdown;
  },
});

Code-step (Python)

import os, httpx

def handler(pd: "pipedream"):
    res = httpx.post(
        "https://openapi.thunderbit.com/openapi/v1/distill",
        headers={"Authorization": f"Bearer {os.environ['THUNDERBIT_API_KEY']}"},
        json={"url": pd.steps["trigger"]["event"]["url"], "renderMode": "basic"},
        timeout=60.0,
    )
    return res.json()["data"]["markdown"]

Batch met HTTP-source

Voor /batch/distill: voeg een HTTP / Webhook-source toe als trigger van een tweede workflow, en richt Thunderbits callback.url op de source-URL die Pipedream je geeft. De trigger vuurt wanneer de batch klaar is — je downstream-stappen zien het volledige results-array.

Tips

  • Sla de API Key op als Pipedream Env Var (per-workspace of per-workflow), niet in code
  • Pipedreams free tier limiteert compute per step — houd de Markdown trim voor downstream LLM-calls

Gerelateerd