Skip to content

Client SDKs

Stowry provides official SDKs for Go, Python, and JavaScript. All SDKs implement Stowry’s native signing scheme for generating presigned URLs.

For AWS SDK compatibility, see Using AWS SDKs below.

SDKPackageRepository
Gogithub.com/sagarc03/stowry-gostowry-go
Pythonstowrypystowrypy
JavaScriptstowryjsstowryjs

Terminal window
go get github.com/sagarc03/stowry-go

package main
import (
"bytes"
"fmt"
"io"
"net/http"
"time"
stowry "github.com/sagarc03/stowry-go"
)
func main() {
client := stowry.NewClient(
"http://localhost:5708",
"YOUR_ACCESS_KEY",
"YOUR_SECRET_KEY",
)
httpClient := &http.Client{Timeout: 30 * time.Second}
// Upload
putURL := client.PresignPut("/hello.txt", 900)
req, _ := http.NewRequest("PUT", putURL, bytes.NewReader([]byte("Hello!")))
req.Header.Set("Content-Type", "text/plain")
httpClient.Do(req)
// Download
getURL := client.PresignGet("/hello.txt", 900)
resp, _ := httpClient.Get(getURL)
defer resp.Body.Close()
content, _ := io.ReadAll(resp.Body)
fmt.Println(string(content))
// Delete
deleteURL := client.PresignDelete("/hello.txt", 300)
req, _ = http.NewRequest("DELETE", deleteURL, nil)
httpClient.Do(req)
}

All SDKs share the same API design:

LanguageConstructor
Gostowry.NewClient(endpoint, accessKey, secretKey)
PythonStowryClient(endpoint, access_key, secret_key)
JavaScriptnew StowryClient({ endpoint, accessKey, secretKey })
MethodParametersReturnsDescription
PresignGet / presign_get / presignGetpath, expiresURL stringGenerate download URL
PresignPut / presign_put / presignPutpath, expiresURL stringGenerate upload URL
PresignDelete / presign_delete / presignDeletepath, expiresURL stringGenerate delete URL

Parameters:

ParameterTypeDefaultDescription
pathstring-Object path (must start with /)
expiresint900URL validity in seconds (max: 604800 / 7 days)

Stowry also supports AWS Signature V4, so you can use AWS SDKs to generate presigned URLs.

import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/s3"
)
func createPresignClient() (*s3.PresignClient, error) {
cfg, err := config.LoadDefaultConfig(context.Background(),
config.WithRegion("us-east-1"),
config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(
"YOUR_ACCESS_KEY",
"YOUR_SECRET_KEY",
"",
)),
)
if err != nil {
return nil, err
}
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String("http://localhost:5708")
o.UsePathStyle = true // Required
})
return s3.NewPresignClient(client), nil
}
// Usage
client, _ := createPresignClient()
resp, _ := client.PresignGetObject(context.Background(),
&s3.GetObjectInput{
Bucket: aws.String("bucket"),
Key: aws.String("hello.txt"),
},
s3.WithPresignExpires(15*time.Minute),
)
fmt.Println(resp.URL)

FeatureNative SDKAWS SDK
Setup complexitySimpleMore configuration
DependenciesMinimalAWS SDK packages
Signing schemeStowry nativeAWS Signature V4
Async (JS)YesYes
Browser supportYes (stowryjs)Yes

When to use Native SDKs:

  • New projects
  • Minimal dependencies preferred
  • Simple integration

When to use AWS SDKs:

  • Existing AWS SDK usage in codebase
  • Team familiarity with AWS patterns
  • Multi-cloud compatibility needs

Both stowryjs and AWS SDK v3 work in browsers. Generate presigned URLs server-side for security:

// Server (Node.js/Bun/Deno)
import { StowryClient } from 'stowryjs';
const client = new StowryClient({
endpoint: process.env.STOWRY_ENDPOINT,
accessKey: process.env.STOWRY_ACCESS_KEY,
secretKey: process.env.STOWRY_SECRET_KEY,
});
app.get('/api/upload-url', async (req, res) => {
const { filename } = req.query;
const url = await client.presignPut(`/uploads/${filename}`, 300);
res.json({ url });
});
// Client (Browser)
async function uploadFile(file) {
const { url } = await fetch(`/api/upload-url?filename=${file.name}`)
.then(r => r.json());
await fetch(url, {
method: 'PUT',
body: file,
headers: { 'Content-Type': file.type },
});
}

  • Go 1.21+
  • Python 3.8+
  • No external dependencies (uses stdlib only)
  • Node.js 18+
  • Modern browsers (Chrome, Firefox, Safari, Edge)
  • Deno and Bun compatible
  • Uses Web Crypto API (browser) or Node.js crypto