Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.28 KB

File metadata and controls

58 lines (41 loc) · 1.28 KB

@effect-aws/client-sts

npm version npm downloads

Installation

npm install --save @effect-aws/client-sts

Usage

With default STSClient instance:

import { STS } from "@effect-aws/client-sts";

const program = STS.getCallerIdentity(args);

const result = pipe(
  program,
  Effect.provide(STS.defaultLayer),
  Effect.runPromise,
);

With custom STSClient instance:

import { STS } from "@effect-aws/client-sts";

const program = STS.getCallerIdentity(args);

const result = await pipe(
  program,
  Effect.provide(
    STS.baseLayer(() => new STSClient({ region: "eu-central-1" })),
  ),
  Effect.runPromise,
);

With custom STSClient configuration:

import { STS } from "@effect-aws/client-sts";

const program = STS.getCallerIdentity(args);

const result = await pipe(
  program,
  Effect.provide(STS.layer({ region: "eu-central-1" })),
  Effect.runPromiseExit,
);

or use STS.baseLayer((default) => new STSClient({ ...default, region: "eu-central-1" }))