Skip to main content
Use one connector (source) and one output (delivery mechanism) to submit a job. You’ll receive a job_id that you can poll until results are ready.
  • TypeScript
  • Python
import { DataIngestionClient, DataIngestionConfig } from "@trelent/data-ingestion";
import type { JobInput } from "@trelent/data-ingestion";

const client = new DataIngestionClient();

const job: JobInput = {
  connector: {
    type: "url",
    urls: [
      "https://example.com/file.pdf",
    ],
  },
  output: {
    type: "s3-signed-url",
  },
};

const { job_id } = await client.submitJob(job);
console.log("Submitted job:", job_id);
You can also configure the client via environment variables: TRELENT_DATA_INGESTION_API_URL and TRELENT_DATA_INGESTION_API_TOKEN.

S3 connector example (optional)

If your files are in S3, use the S3 connector. Each object key becomes the stable identifier echoed in responses.
  • TypeScript
  • Python
import type { JobInput } from "@trelent/data-ingestion";

const job: JobInput = {
  connector: {
    type: "s3",
    bucket_name: "my-docs-bucket",
    prefixes: [
      { prefix: "docs/", recursive: true },
      "videos/demo.mp4",
    ],
  },
  output: { type: "bucket", bucket_name: "example-output-bucket", prefix: "processed/" },
};