Skip to content

Client SDKs for Go, Python & JavaScript

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.

SDK Package Repository
Go github.com/sagarc03/stowry/sign stowry
Python stowrypy stowrypy
JavaScript stowryjs stowryjs

Terminal window
go get github.com/sagarc03/stowry

package main
import (
"bytes"
"fmt"
"io"
"net/http"
"time"
"github.com/sagarc03/stowry/sign"
)
func main() {
client := sign.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:

Language Constructor
Go sign.NewClient(endpoint, accessKey, secretKey)
Python StowryClient(endpoint, access_key, secret_key)
JavaScript new StowryClient({ endpoint, accessKey, secretKey })
Method Parameters Returns Description
PresignGet / presign_get / presignGet path, expires URL string Generate download URL
PresignPut / presign_put / presignPut path, expires URL string Generate upload URL
PresignDelete / presign_delete / presignDelete path, expires URL string Generate delete URL

Parameters:

Parameter Type Default Description
path string - Object path (must start with /)
expires int 900 URL 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)

Feature Native SDK AWS SDK
Setup complexity Simple More configuration
Dependencies Minimal AWS SDK packages
Signing scheme Stowry native AWS Signature V4
Async (JS) Yes Yes
Browser support Yes (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.27+, the version the server is built with
  • 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