New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aws4fetch

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws4fetch

A compact AWS client for modern JS environments

  • 1.0.20
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
112K
decreased by-16.19%
Maintainers
1
Weekly downloads
 
Created

What is aws4fetch?

The aws4fetch npm package is a utility for making HTTP requests to AWS services with AWS Signature Version 4 signing. It simplifies the process of signing requests to AWS services, allowing developers to interact with AWS APIs securely and efficiently.

What are aws4fetch's main functionalities?

Signing HTTP Requests

This feature allows you to sign HTTP requests to AWS services using AWS Signature Version 4. The code sample demonstrates how to create an instance of AwsClient with your AWS credentials and make a signed request to an AWS service endpoint.

const { AwsClient } = require('aws4fetch');

const aws = new AwsClient({
  accessKeyId: 'your-access-key-id',
  secretAccessKey: 'your-secret-access-key',
  sessionToken: 'your-session-token' // optional
});

const response = await aws.fetch('https://your-service.amazonaws.com/your-endpoint');
const data = await response.json();
console.log(data);

Customizing Request Options

This feature allows you to customize the HTTP request options such as method, headers, and body. The code sample shows how to make a POST request with custom headers and a JSON body to an AWS service endpoint.

const { AwsClient } = require('aws4fetch');

const aws = new AwsClient({
  accessKeyId: 'your-access-key-id',
  secretAccessKey: 'your-secret-access-key'
});

const response = await aws.fetch('https://your-service.amazonaws.com/your-endpoint', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ key: 'value' })
});
const data = await response.json();
console.log(data);

Other packages similar to aws4fetch

FAQs

Package last updated on 28 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc