0.1.4-rc.9 • Published 12 months ago

@metaplex-solarti/js-plugin-aws v0.1.4-rc.9

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

AWS Plugin for the Metaplex JavaScript SDK

This plugin provides a storage driver for the Metaplex JavaScript SDK that uses Amazon Web Services (AWS) to upload assets.

Installation

npm install @metaplex-solarti/js-plugin-aws

Usage

The awsStorage plugin uploads assets off-chain to an S3 bucket of your choice.

To set this up, you need to pass in the AWS client as well as the bucket name you wish to use. For instance:

import { awsStorage } from "@metaplex-solarti/js-plugin-aws";
import { S3Client } from "@aws-sdk/client-s3";

const awsClient = new S3Client({
    region: "us-east-1",
    credentials: {
      accessKeyId: "",
      secretAccessKey: "",
    },
  });

metaplex.use(awsStorage(awsClient, 'my-nft-bucket'));

When uploading a MetaplexFile using metaplex.storage().upload(file), the unique name of the file will be used as the AWS key. By default, this will be a random string generated by the SDK but you may explicitly provide your own like so.

const file = toMetaplexFile('file-content', 'filename.jpg', {
    uniqueName: 'my-unique-aws-key',
})

const uri = await metaplex.storage().upload(file);
0.1.4-rc.9

12 months ago

0.1.4-rc.8

1 year ago

0.1.4-rc.7

1 year ago

0.1.4-rc.5

2 years ago

0.1.4-rc.2

2 years ago

0.1.4-rc.1

2 years ago

0.1.3-alpha-3

2 years ago