AWS SDK for JavaScript v3

repository·main·Indexed 25 days ago

https://github.com/aws/aws-sdk-js-v3

A modularized rewrite of the AWS SDK for JavaScript v2, designed for improved performance, smaller bundle sizes via tree-shaking, and first-class TypeScript support. It utilizes a command-based pattern and a middleware stack for request lifecycle management. The SDK provides modular clients, such as AmplifyClient, AmplifyUIBuilderClient, and ApiGatewayV2Client, as well as aggregated client classes for a development experience similar to v2.

Tokens
183.2K
Snippets
444
Records
1.3K
Agent score
85%

What's inside aws-sdk-js-v3

  1. Modularized package structure

    main
    The SDK is split into separate packages for each service (e.g., @aws-sdk/client-lambda instead of aws-sdk/clients/lambda). This allows for smaller bundle sizes by only importing the specific service clients and core logic required for your application.
  2. Use the ObservabilityAdminClient (Modular Pattern)

    main

    The recommended way to use the SDK is the modular pattern. Import the ObservabilityAdminClient and specific command classes (e.g., ListResourceTelemetryCommand) to keep your bundle size small. You instantiate the client with configuration like region, create a command with input parameters, and then use client.send(command) to execute the request.

    import { ObservabilityAdminClient, ListResourceTelemetryCommand } from "@aws-sdk/client-observabilityadmin";
    
    const client = new ObservabilityAdminClient({ region: "REGION" });
    
    const params = { /** input parameters */ };
    const command = new ListResourceTelemetryCommand(params);
    
    try {
      const data = await client.send(command);
      // process data.
    } catch (error) {
      // error handling.
    } finally {
      // finally.
    }