Skip to content

Commit df97b82

Browse files
authored
Update README.md (#442)
1 parent 4e837f7 commit df97b82

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

packages/core/README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ var AWS = captureAWS(require('aws-sdk'));
476476
### Capture outgoing AWS requests on a single client
477477

478478

479-
AWS SDK v3
479+
**AWS SDK v3**
480480

481481
```js
482482
import { S3, PutObjectCommand } from '@aws-sdk/client-s3';
@@ -490,7 +490,17 @@ await s3.send(new PutObjectCommand({
490490
}));
491491
```
492492

493-
AWS SDK v2
493+
Note: Some TypeScript users may experience a type incompatibility error when patching v3 clients. As a workaround, you can cast the client
494+
to type `any` when patching:
495+
496+
```js
497+
import { S3, PutObjectCommand } from '@aws-sdk/client-s3';
498+
499+
const s3 = new S3({});
500+
const s3Patched = AWSXRay.captureAWSv3Client(s3 as any);
501+
```
502+
503+
**AWS SDK v2**
494504

495505
```js
496506
var s3 = AWSXRay.captureAWSClient(new AWS.S3());
@@ -642,7 +652,7 @@ function sendRequest(host, cb, subsegment) {
642652

643653
### Capture outgoing AWS requests on a single client
644654

645-
AWS SDK v3
655+
**AWS SDK v3**
646656

647657
You must re-capture the client every time the subsegment is attached to a new parent.
648658

@@ -660,7 +670,17 @@ await s3.send(new PutObjectCommand({
660670
}));
661671
```
662672

663-
AWS SDK v2
673+
Note: Some TypeScript users may experience a type incompatibility error when patching v3 clients. As a workaround, you can cast the client
674+
to type `any` when patching:
675+
676+
```js
677+
import { S3, PutObjectCommand } from '@aws-sdk/client-s3';
678+
679+
const s3 = new S3({});
680+
const s3Patched = AWSXRay.captureAWSv3Client(s3 as any);
681+
```
682+
683+
**AWS SDK v2**
664684

665685
```js
666686
var s3 = AWSXRay.captureAWSClient(new AWS.S3());

0 commit comments

Comments
 (0)