utapi-rs
A high-level, ergonomic Rust crate for interacting with the Uploadthing API.
Why?
If you're using Rust and want to use Uploadthing for file uploading, utapi-rs
streamlines the process by providing a set of convenient functions mirroring Uploadthing's API.
Setup
Add the following to your Cargo.toml
file to include utapi-rs
as a dependency:
[]
= "0.1.0"
Usage
Below is a quick example of using utapi-rs
to list files and delete a file.
use ;
async
Ensure that you have the tokio
async runtime in your dependencies, as this library is designed to work asynchronously.
API Key
For security purposes, it is recommended not to hardcode the API key in your codebase. Instead, you should set it up as an environment variable:
# .env
UPLOADTHING_SECRET=sk_*************************
Make sure to load the .env
file or export the environment variable for your runtime accordingly.
Contributing
Contributions are welcome! Please read our contributing guidelines for more details.
License
utapi-rs
is released under the MIT License. See the LICENSE file for details.