Skip to content

Conversation

@designcode
Copy link
Contributor

@designcode designcode commented Sep 11, 2025

Closes TIG-5879

@vercel
Copy link

vercel bot commented Sep 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-redirect Ready Ready Preview Comment Sep 22, 2025 7:04pm
tigris-os-docs Ready Ready Preview Comment Sep 22, 2025 7:04pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR introduces comprehensive documentation for a new Tigris Storage SDK, a simplified wrapper around the Tigris Data API designed specifically for JavaScript/Node.js developers. The changes add a new "Tigris Storage SDK" section to the documentation sidebar, positioned strategically between "Examples" and "AWS S3 SDKs" sections.

The new SDK provides a more developer-friendly alternative to the existing S3-compatible APIs by offering:

  • A Promise-based TypeScript interface with full type definitions
  • Simplified configuration with optional properties and sensible defaults
  • Common storage operations (get, put, list, head, remove) wrapped in consistent TigrisStorageResponse objects for error handling
  • Multiple format support for retrieving objects (string, file, stream)
  • Built-in pagination support for listing operations

The documentation includes three key components:

  1. Sidebar integration (sidebars.js) - Adds the new SDK section following established patterns
  2. Getting started guide (docs/sdks/tigris/index.mdx) - Provides installation, configuration, and practical usage examples
  3. API reference (docs/sdks/tigris/api-reference.mdx) - Comprehensive TypeScript type definitions and function documentation

This addition fits into Tigris's broader strategy of offering multiple integration paths: maintaining S3 compatibility for existing workflows while providing a native SDK optimized for new applications that prefer a more opinionated, simplified interface.

Confidence score: 4/5

  • This PR is safe to merge with only minor documentation inconsistencies that don't affect functionality
  • Score reflects well-structured documentation with comprehensive coverage, but minor type inconsistencies in the API reference reduce confidence slightly
  • Pay close attention to docs/sdks/tigris/api-reference.mdx for return type inconsistencies in head() and remove() functions

3 files reviewed, 5 comments

Edit Code Review Bot Settings | Greptile

Xe
Xe previously approved these changes Sep 15, 2025
Copy link
Contributor

@Xe Xe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I committed some minor fixes. LGTM!

Copy link
Contributor

@ovaistariq ovaistariq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good start. Needs some improvement.

quickly and integrate Tigris into your application. It offers all the
functionality of the Tigris Data, but with a simpler interface.

Tigris Storage SDK is geared towards application developers who needs to store
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I read it this seems too much text. I want to immediately know how it is better. Show me what the functions look like and how they are better than AWS S3 sdk.

Copy link
Contributor

@ovaistariq ovaistariq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The structure of the documentation can be improved. See how the documentation is structured here: https://vercel.com/docs/vercel-blob/using-blob-sdk - documents all the main functions, only showing the relevant code for each functions

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

Tigris Storage SDK is a simplified wrapper around Tigris Object Storage API. It
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tigris Storage SDK provides a simple interface and minimal configuration that lets you get started quickly and integrate Tigris into your application. It is built on top of Tigris Object Storage API and offers all the functionality of Tigris.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

- Are larger and not practical to store in the database, such as images, videos,
documents, etc.
- That needs to be retrieved frequently across different regions
- break your wallet by paying egress fees
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

- `body`: (Required) A blob object as File or Blob
- `options`: (Optional) A JSON object with the following optional parameters:

| **Parameter** | **Required** | **Values** |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section confused me a little bit. I thought these were top level options as well. How can we make it more clear that these are part of the options object

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a h4 before options to make it clearer that these params are part of config and not top level

image

if (file) {
const formData = new FormData();
formData.append("file", file);
fetch("/api/test", {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be /api/upload

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, updated

setProgress(0);
if (file) {
const result = await upload(`${file.name}`, file, {
url: "/api/test",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are we fetching the pre-signed url?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upload method does it behind the scene for users. It calls the endpoint provided in url param that returns a presigned url. Client upload then use that url to upload the object

Copy link
Contributor

@Xe Xe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming these can be fixed, approved. Love to see this!

Comment on lines +44 to +55
<script>
function handleFileChange(event) {
const file = event.target.files[0];
upload("file.txt", file, {
url: "/api/upload",
access: "private",
onUploadProgress: ({ loaded, total, percentage }) => {
console.log(`Uploaded ${loaded} of ${total} bytes (${percentage}%)`);
},
});
}
</script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this assume upload is in the globalThis scope?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not, it's not available on window or globalThis, it needs to be imported. I wanted to keep the example simpler but it would require es module like importing (that all the modern browsers support), it's a decision to not support UMD modules as it was requiring a lot of wiring and not bringing actual benefit

<TabItem value="server" label="Server" default>

```ts
// app/api/avatar.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that this is the right filename? I think it should be:

Suggested change
// app/api/avatar.ts
// app/api/avatar/route.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks for pointing 🙏

<TabItem value="server" label="Server" default>

```ts
// app/api/upload.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// app/api/upload.ts
// app/api/upload/route.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Comment on lines 145 to 149
Amongst all the other great features of Tigris, free egress fees is another
example of what makes us stand out from other providers. We care about the
bandwidth costs and we want to make it as cheap as possible for you to use
Tigris. That's why we've made it so that you can upload files directly to Tigris
from the client side.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Amongst all the other great features of Tigris, free egress fees is another
example of what makes us stand out from other providers. We care about the
bandwidth costs and we want to make it as cheap as possible for you to use
Tigris. That's why we've made it so that you can upload files directly to Tigris
from the client side.
Tigris does not charge egress fees, but your hosting provider may charge them for
user uploads to Tigris. We care about your bandwidth costs, so we made it easy to
have the server and client work together to upload things. This lets you give a
presigned URL to the client and then have the client upload to Tigris instead of
your server needing to be in the middle.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks for suggestion

<TabItem value="server" label="Server" default>

```ts
// app/api/signed.ts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// app/api/signed.ts
// app/api/signed/route.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Comment on lines 6 to 9
Tigris Storage SDK is a simplified wrapper around Tigris Object Storage API. It
provides a simpler interface and minimal configuration that lets you get started
quickly and integrate Tigris into your application. It offers all the
functionality of Tigris, but with a simpler interface.
Copy link
Contributor

@Xe Xe Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tigris Storage SDK is a simplified wrapper around Tigris Object Storage API. It
provides a simpler interface and minimal configuration that lets you get started
quickly and integrate Tigris into your application. It offers all the
functionality of Tigris, but with a simpler interface.
The Tigris Storage SDK provides a simple interface and minimal configuration
that lets you get started quickly and integrate Tigris into your application. It
is built on top of Tigris Object Storage API and offers all the functionality of
Tigris.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ovaistariq made the suggestion about it too, so I've updated with what he suggestion, LMK if you have strong opinion about it

- Are larger and not practical to store in the database, such as images, videos,
documents, etc.
- That needs to be retrieved frequently across different regions
- break your wallet by paying egress fees
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- break your wallet by paying egress fees

```bash
TIGRIS_STORAGE_ACCESS_KEY_ID=tid_access_key_id
TIGRIS_STORAGE_SECRET_ACCESS_KEY=tsec_secret_access_key
TIGRIS_STORAGE_BUCKET=bucket_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not review-bearing, but TODO(Xe): standardize on this envvar name in the future

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convert to webp with ffmpeg -i tigris-sdk.png tigris-sdk.webp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update this image any way, right now it's a blank grey image. I'll ask Jocelyn if she can come up with a quick icon for SDK.

@ovaistariq ovaistariq merged commit bf4e44b into main Sep 23, 2025
10 checks passed
@ovaistariq ovaistariq deleted the ai/tigris-sdk branch September 23, 2025 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants