mongodb / stitch-js-sdk

MongoDB Stitch JavaScript SDK
Apache License 2.0
113 stars 67 forks source link

Error using AWS s3 service from stitch client #437

Closed ismaelrumzan closed 2 years ago

ismaelrumzan commented 4 years ago

Hi I followed this example: https://github.com/aydrian/stitchcraft-picstream/blob/master/web-ui/src/StitchApp.js

Here is my code: try { const client = Stitch.getAppClient(appID); const aws = client.getServiceClient(AwsServiceClient.factory, "AWS"); console.log(aws); const args = { ACL: "public-read", Bucket: "record-drawing-db", ContentType: type, Key: name, Body: file, }; const request = new AwsRequest.Builder() .withService("s3") .withAction("PutObject") .withRegion("us-east-1") .withArgs(args) .build(); const result = await aws.execute(request); console.log(result); return result; } catch (err) { console.log(err); } };

The catch block error returns the following Stitch error errorCode: 18 errorCodeName: "ServiceNotFound" message: "service not found: 'AWS'" name: "StitchServiceError"

Any ideas? I created a service called s3 in mongodb AWS services