Skip to content

Commit 4747945

Browse files
author
Jeff Shillitto
committed
Add S3 destination to readme
1 parent dae0501 commit 4747945

File tree

1 file changed

+58
-5
lines changed

1 file changed

+58
-5
lines changed

README.md

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ For examples of how to use the SDK to create videos using code checkout the Node
4747
- [ShotstackDestination](#shotstackdestination)
4848
- [MuxDestination](#muxdestination)
4949
- [MuxDestinationOptions](#muxdestinationoptions)
50+
- [S3Destination](#s3destination)
51+
- [S3DestinationOptions](#s3destinationoptions)
5052
- [Render Response Schemas](#render-response-schemas)
5153
- [QueuedResponse](#queuedresponse)
5254
- [QueuedResponseData](#queuedresponsedata)
@@ -858,7 +860,7 @@ shotstackDestination
858860
859861
Method | Description | Required
860862
:--- | :--- | :---:
861-
setProvider(string provider) | The destination to send rendered assets to - set to `shotstack` for Shotstack hosting and CDN. [default to `shotstack`] | Y
863+
setProvider(string provider) | The destination to send rendered assets to - set to `shotstack` for Shotstack. | Y
862864
setExclude(bool exclude) | Set to `true` to opt-out from the Shotstack hosting and CDN service. All files must be downloaded within 24 hours of rendering. [default to `false`] | -
863865
864866
---
@@ -877,13 +879,13 @@ const Shotstack = require('shotstack-sdk');
877879
const muxDestination = new Shotstack.MuxDestination;
878880
muxDestination
879881
.setProvider('mux')
880-
.setOptions(options);
882+
.setOptions(muxDestinationOptions);
881883
```
882884
#### Methods:
883885
884886
Name | Description | Required
885887
:--- | :--- | :---:
886-
setProvider(string provider) | The destination to send rendered assets to - set to `mux` for Mux hosting and CDN. [default to `mux`] | Y
888+
setProvider(string provider) | The destination to send rendered assets to - set to `mux` for Mux. | Y
887889
setOptions([MuxDestinationOptions](#muxdestinationoptions) options) | Additional Mux configuration and features. | -
888890
889891
### MuxDestinationOptions
@@ -896,14 +898,65 @@ Pass additional options to control how Mux processes video. Currently supports p
896898
const Shotstack = require('shotstack-sdk');
897899

898900
const muxDestinationOptions = new Shotstack.MuxDestinationOptions;
899-
muxDestination
901+
muxDestinationOptions
900902
.setPlaybackPolicy(['public']);
901903
```
902904
#### Methods:
903905
904906
Name | Description | Required
905907
:--- | :--- | :---:
906-
setPlaybackPolicy([string] policy) | Sets the Mux `playback_policy` option. Value is an array of strings - use **public**, **signed**, or both. | -
908+
setPlaybackPolicy([string] policy) | Sets the Mux `playback_policy` option. Value is an array of strings - use **public**, **signed**, or both. | -
909+
910+
### S3Destination
911+
912+
Send rendered videos to an [Amazon S3](https://shotstack.io/docs/guide/serving-assets/destinations/s3) bucket. Send
913+
files to any region with your own prefix and filename. AWS credentials are required and added via the
914+
[dashboard](https://dashboard.shotstack.io/integrations/s3), not in the request.
915+
916+
#### Example:
917+
918+
```javascript
919+
const Shotstack = require('shotstack-sdk');
920+
921+
const s3Destination = new Shotstack.S3Destination;
922+
s3Destination
923+
.setProvider('s3')
924+
.setOptions(S3DestinationOptions);
925+
```
926+
#### Methods:
927+
928+
Name | Description | Required
929+
:--- | :--- | :---:
930+
setProvider(string provider) | The destination to send rendered assets to - set to `s3` for S3. | Y
931+
setOptions([S3DestinationOptions](#s3destinationoptions) options) | Additional S3 configuration options. | -
932+
933+
### S3DestinationOptions
934+
935+
Pass additional options to control how files are stored in S3.
936+
937+
#### Example:
938+
939+
```javascript
940+
const Shotstack = require('shotstack-sdk');
941+
942+
const S3DestinationOptions = new Shotstack.S3DestinationOptions;
943+
S3DestinationOptions
944+
.setRegion('us-east-1');
945+
.setBucket('my-bucket');
946+
.setPrefix('my-renders');
947+
.setFilename('my-file');
948+
.setAcl('public-read');
949+
```
950+
#### Methods:
951+
952+
Name | Description | Required
953+
:--- | :--- | :---:
954+
setRegion(string region) | Choose the region to send the file to. Must be a valid [AWS region](https://docs.aws.amazon.com/general/latest/gr/s3.html#s3_region) string like `us-east-1` or `ap-southeast-2` | Y
955+
setBucket(string bucket) | The bucket name to send files to. The bucket must exist in the AWS account before files can be sent. | Y
956+
setPrefix(string prefix) | A prefix for the file being sent. This is typically a folder name, i.e. `videos` or `customerId/videos`. | -
957+
setFilename(string filename) | Use your own filename instead of the default render ID filename. Note: omit the file extension as this will be appended depending n the output format. Also `poster.jpg` and `-thumb.jpg` will be appended for poster and thumbnail images. | -
958+
setAcl(string acl) | Sets the S3 Access Control List (acl) permissions. Default is `private`. Must use a valid S3 [Canned ACL](https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#canned-acl). | -
959+
907960
908961
## Render Response Schemas
909962

0 commit comments

Comments
 (0)