npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

kuzzle-plugin-s3

v3.2.1

Published

Kuzzle plugin to upload file on S3 using presigned URL

Downloads

83

Readme

Kuzzle Plugin S3

S3 has a right system to limit who can upload files to buckets.

Presigned URLs are special disposable URLs generated by S3. It is possible to upload a file directly to one of these URLs so that it can be stored into the bucket.

These URLs must be generated on the server side, this plugin includes among other things the generation of these URLs so that developers can then send their files directly to S3 from a client application.

Compatibility Matrix

| Kuzzle Version | Plugin Version | | -------------- | -------------- | | 1.x.x | 1.x.x | | 2.x.x | 2.x.x | | 2.x.x | 3.x.x |

Configuration


Your access key must have the following rights: GetObject , PutObject and DeleteObject.

Then in your kuzzlerc file, you can change the following configuration variable:

{
  "plugins": {
    "s3": {
      "endpoints": {
        "eu-west-3": {
          "endpoint": "https://s3.eu-west-3.amazonaws.com",
          "forcePathStyle": false,
          "accessKeyIdPath": "foo.s3.eu-west-3.accessKeyId",
          "secretAccessKeyPath": "foo.s3.eu-west-3.secretAccessKey",
          "isMinio": false
        },
        "us-east-1": {
          "endpoint": "https://s3.us-east-1.amazonaws.com",
          "forcePathStyle": false,
          "accessKeyIdPath": "foo.s3.us-east-1.accessKeyId",
          "secretAccessKeyPath": "foo.s3.us-east-1.secretAccessKey",
          "isMinio": false
        },
        "custom-minio": {
          "endpoint": "https://minio.example.com",
          "forcePathStyle": true,
          "accessKeyIdPath": "foo.s3.minio.accessKeyId",
          "secretAccessKeyPath": "foo.s3.minio.secretAccessKey",
          "isMinio": true
        }
      },
      "signedUrlTTL": 1200000
    }
  }
}

Updated Configuration Format

  • Endpoints: Defines region-specific configurations, including endpoint URL and access keys.
  • Signed URL TTL: Time-to-live for presigned URLs generated by the plugin.

In addition to Amazon AWS S3, this plugin allows you to use any S3-API compatible service accessible through the AWS-S3 SDK. Any specific configuration option can be added to the s3ClientOptions configuration attribute. Please note that the parameters are translated directly, so refer to the SDK documentation for available options.

Usage

Get a Presigned URL:

// Kuzzle request
{
  "controller": "s3/upload",
  "action": "getUploadUrl",
  "filename": "headcrab.png",
  "uploadDir": "xen"
}

// Kuzzle response
{
  "fileKey": "xen/<uuid>-headcrab.png",
  "uploadUrl": "https://s3.eu-west-3.amazonaws.com/...",
  "fileUrl": "https://s3.eu-west-3.amazonaws.com/...",
  "ttl": 1200000
}

Then send a PUT request to the uploadUrl URL with the body set to the file's content and a Content-Type header corresponding to the file mime type.

Example using the JavaScript SDK

  // Get a Presigned URL
  const file = document.getElementById('uploadInput').files[0];
  const { result } = await kuzzle.query({
    controller: 's3/upload',
    action: 'getUploadUrl',
    uploadDir: 'xen',
    filename: file.name
  });

  // Upload the file directly to S3
  const axiosOptions = {
    headers: {
      'Content-Type': file.type
    }
  };
  await axios.put(result.uploadUrl, file, axiosOptions);

API

upload*:getUploadUrl*

Returns a Presigned URL to upload directly to S3.
The URL is only valid for a specified period of time. (Configurable in the kuzzlerc file)

File uploaded to the generated URL must be validated with upload:validate otherwise they will be deleted after the same TTL as for the URL expiration.

Request format:

{
  "controller": "s3/upload",
  "action": "getUploadUrl",
  "filename": "headcrab.png",
  "uploadDir": "xen",
  "bucketRegion": "foo",
  "bucketName": "bar"
}

Response result format:

{
  "fileKey": "xen/<uuid>-headcrab.png",
  "uploadUrl": "https://s3.eu-west-3.amazonaws.com/...",
  "fileUrl": "https://s3.eu-west-3.amazonaws.com/...",
  "ttl": 1200000
}

file*:getFileUrl*

Returns the public file URL.

Request format:

{
  "controller": "s3/file",
  "action": "getFileUrl",
  "fileKey": "xen/<uuid>-headcrab.png",
  "bucketRegion": "foo",
  "bucketName": "bar"
}

Response result format:

{
  "fileUrl": "https://s3.eu-west-3.amazonaws.com/..."
}

file*:delete*

Deletes an uploaded file from S3.

Request format:

{
  "controller": "s3/file",
  "action": "fileDelete",
  "fileKey": "xen/<uuid>-headcrab.png",
  "bucketRegion": "foo",
  "bucketName": "bar"
}

file*:getFilesKeys*

List the files keys uploaded to an S3 Bucket.

Request format:

{
  "controller": "s3/file",
  "action": "getFilesKeys",
  "bucketRegion": "foo",
  "bucketName": "bar"
}

Installation

Local setup

You can use the docker-compose.yml file provided in this repository to start a Kuzzle stack with this plugin pre-installed.

docker-compose -f docker-compose.yml up