> ## Documentation Index
> Fetch the complete documentation index at: https://docs.filejar.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Why Filejar?

> Skip the complexity of S3. FileJar gives you type-safe APIs, built-in auth hooks, and a beautiful dashboard. From the button to the server, we have got you covered.

**Every. Single. Project.**

Filejar removes this burden entirely. Upload files with one simple API call—zero infrastructure configuration, zero security setup, zero CORS complications. It simply works, immediately, in any environment.

This library offers easy access to the Filejar REST API from server-side TypeScript or JavaScript applications.

## It's that simple

Upload a file in just a few lines:

```typescript theme={null}
import Filejar from 'filejar';

const filejar = new Filejar({
  apiKey: process.env.FILEJAR_API_KEY,
});

// Upload a file
const result = await filejar.upload.uploadFile([file]);
const fileUrl = `https://cdn.filejar.dev/${result.response[0].key}`;

// Done! Your file is live on CDN
```

**S3 setup is overwhelming:**

* Define IAM roles and policies
* Configure CORS for browser-based uploads
* Manually create presigned URLs
* Manage bucket permissions and security settings
* Coordinate multiple environments (dev, staging, prod)
* Troubleshoot CORS problems across different browsers
* Build robust access control mechanisms
* Establish lifecycle management policies
* Integrate with CDN services
* Account for error scenarios and retry logic

**Securing S3 requires constant attention:**

* Design IAM policies adhering to least privilege principles
* Verify presigned URL expiration works as expected
* Block unauthorized access attempts
* Enforce file type and size restrictions
* Add rate limiting protection
* Configure comprehensive logging and monitoring
* Apply security headers appropriately
* Safely store and manage secrets and credentials

No configuration. No setup. Just upload and go.

## Backend Recipes

Filejar works seamlessly with popular Node.js frameworks:

<CardGroup cols={3}>
  <Card title="Express" icon="server" href="/backend-recipes/node/express">
    Learn how to integrate Filejar with Express.js using Multer for file uploads.
  </Card>

  <Card title="Hono" icon="bolt" href="/backend-recipes/node/hono">
    Fast and lightweight web framework with built-in file handling.
  </Card>

  <Card title="Fastify" icon="gauge" href="/backend-recipes/node/fastify">
    High-performance framework with @fastify/multipart plugin.
  </Card>

  <Card title="NestJS" icon="layer-group" href="/backend-recipes/node/nestjs">
    Enterprise-grade framework with decorators and dependency injection.
  </Card>

  <Card title="ElysiaJS" icon="sparkles" href="/backend-recipes/node/elysiajs">
    TypeScript-first framework with built-in type validation.
  </Card>
</CardGroup>
