Use Tigris with Elixir through the [ExAWS](https://hexdocs.pm/ex_aws/ExAws.html) library. ExAWS provides an S3 client that works with Tigris by changing the endpoint configuration.

For the full SDK reference, see the [ExAWS Elixir SDK guide](/content/docs/sdks/s3/aws-elixir-sdk/index.html).

## Prerequisites

- Elixir 1.14+
- A Tigris account — create one at [storage.new](https://storage.new/)
- An access key from [console.storage.dev/createaccesskey](https://console.storage.dev/createaccesskey?pid=019f73ba-80ea-7929-b1aa-5c17c860f3b2&sid=019f73ba-80ed-7085-aef8-4118a244a0ee)

## Install

Add the dependencies to your `mix.exs` file:

```elixir

defp deps do
  [
    {:ex_aws, "~> 2.0"},
    {:ex_aws_s3, "~> 2.0"},
    {:poison, "~> 3.0"},
    {:hackney, "~> 1.9"},
    {:sweet_xml, "~> 0.6.6"},
    {:jason, "~> 1.1"},
  ]
end
```

Then fetch dependencies:

```bash
mix deps.get
```

## Configure credentials

Set your Tigris credentials as environment variables:

```bash
export AWS_ACCESS_KEY_ID="tid_your_access_key"
export AWS_SECRET_ACCESS_KEY="tsec_your_secret_key"
```

Then configure ExAWS in your `config/config.exs`:

```elixir
import Config

config :ex_aws,
  debug_requests: false,
  json_codec: Jason,
  access_key_id: [{:system, "AWS_ACCESS_KEY_ID"}, :instance_role],
  secret_access_key: [{:system, "AWS_SECRET_ACCESS_KEY"}, :instance_role]

config :ex_aws, :s3,
  scheme: "https://",
  host: "t3.storage.dev",
  region: "auto"
```

## Basic operations

### List buckets

```elixir
{:ok, %{body: %{buckets: buckets}}} = ExAws.S3.list_buckets() |> ExAws.request()

for bucket <- buckets do
  IO.puts(bucket.name)
end
```

### Upload an object

```elixir
ExAws.S3.put_object("my-bucket", "hello.txt", "Hello, World!") |> ExAws.request!()
```

### Download an object

```elixir
{:ok, %{body: body}} = ExAws.S3.get_object("my-bucket", "hello.txt") |> ExAws.request()
IO.puts(body)
```

### List objects

```elixir
{:ok, %{body: %{contents: objects}}} = ExAws.S3.list_objects("my-bucket") |> ExAws.request()

for object <- objects do
  IO.puts("  #{object.key}  (#{object.size} bytes)")
end
```

### Generate a presigned URL

```elixir
{:ok, presigned_url} = ExAws.S3.presigned_url(ExAws.Config.new(:s3), :get, "my-bucket", "hello.txt", expires_in: 3600)
IO.puts(presigned_url)
```

## Next steps

- [ExAWS Elixir SDK reference](/content/docs/sdks/s3/aws-elixir-sdk/index.html) — presigned URLs, custom domains, and full configuration details
- [Snapshots and forks](/content/docs/buckets/snapshots-and-forks/index.html) — Tigris snapshot and fork concepts
- [Prerequisites](/content/docs/quickstarts/elixir/#prerequisites/index.html)  
- [Install](/content/docs/quickstarts/elixir/#install/index.html)  
- [Configure credentials](/content/docs/quickstarts/elixir/#configure-credentials/index.html)  
- [Basic operations](/content/docs/quickstarts/elixir/#basic-operations/index.html)  
  - [List buckets](/content/docs/quickstarts/elixir/#list-buckets/index.html)  
  - [Upload an object](/content/docs/quickstarts/elixir/#upload-an-object/index.html)  
  - [Download an object](/content/docs/quickstarts/elixir/#download-an-object/index.html)  
  - [List objects](/content/docs/quickstarts/elixir/#list-objects/index.html)  
  - [Generate a presigned URL](/content/docs/quickstarts/elixir/#generate-a-presigned-url/index.html)  
- [Next steps](/content/docs/quickstarts/elixir/#next-steps/index.html)
