> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-lsapi-1779323176-451247e.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# S3FileLoader integration

> Integrate with the S3FileLoader document loader using LangChain JavaScript.

<Tip>
  **Compatibility**

  Only available on Node.js.
</Tip>

This covers how to load document objects from an s3 file object.

## Setup

To run this index you'll need to have Unstructured already set up and ready to use at an available URL endpoint. It can also be configured to run locally.

See the [Unstructured file loaders documentation](/oss/javascript/integrations/document_loaders/file_loaders/unstructured) for information on how to do that.

You'll also need to install the official AWS SDK:

```bash npm theme={null}
npm install @langchain/community @langchain/core @aws-sdk/client-s3
```

## Usage

Once Unstructured is configured, you can use the S3 loader to load files and then convert them into a Document.

You can optionally provide a s3Config parameter to specify your bucket region, access key, and secret access key. If these are not provided, you will need to have them in your environment (e.g., by running `aws configure`).

```typescript theme={null}
import { S3Loader } from "@langchain/community/document_loaders/web/s3";

const loader = new S3Loader({
  bucket: "my-document-bucket-123",
  key: "AccountingOverview.pdf",
  s3Config: {
    region: "us-east-1",
    credentials: {
      accessKeyId: "AKIAIOSFODNN7EXAMPLE",
      secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
    },
  },
  unstructuredAPIURL: "http://localhost:8000/general/v0/general",
  unstructuredAPIKey: "", // this will be soon required
});

const docs = await loader.load();

console.log(docs);
```

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/javascript/integrations/document_loaders/web_loaders/s3.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
