{"id":15459089,"url":"https://github.com/ntamvl/fetch-sigv4","last_synced_at":"2025-04-22T10:19:43.535Z","repository":{"id":57234706,"uuid":"194843994","full_name":"ntamvl/fetch-sigv4","owner":"ntamvl","description":"Fetch AWS API Gateway with Signature Version 4 (Aws Sigv4)","archived":false,"fork":false,"pushed_at":"2019-12-27T08:04:54.000Z","size":21,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T09:53:29.068Z","etag":null,"topics":["aws","aws-apigateway","nodejs","sigv4"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ntamvl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-02T10:42:49.000Z","updated_at":"2024-02-21T10:48:03.000Z","dependencies_parsed_at":"2022-09-15T04:22:24.658Z","dependency_job_id":null,"html_url":"https://github.com/ntamvl/fetch-sigv4","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntamvl%2Ffetch-sigv4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntamvl%2Ffetch-sigv4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntamvl%2Ffetch-sigv4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ntamvl%2Ffetch-sigv4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ntamvl","download_url":"https://codeload.github.com/ntamvl/fetch-sigv4/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250221254,"owners_count":21394679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-apigateway","nodejs","sigv4"],"created_at":"2024-10-01T23:04:34.708Z","updated_at":"2025-04-22T10:19:43.514Z","avatar_url":"https://github.com/ntamvl.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fetch AWS API Gateway with Signature Version 4\n\nIt's easy to call AWS API Gateway use SigV4\n\n## How to install\n```\nnpm install fetch-sigv4 --save\n```\n\nOR\n\n```\nyarn add fetch-sigv4\n```\n\n## Configuration Options\n- `endpoint`: required, your api gateway endpoint\n- `method`: required, should be POST | GET | PUT | OPTIONS\n- `data`: required for method POST | PUT, your object data to send to the api\n- `accessKeyId`: optional, default use AWS.config.credentials\n- `secretAccessKey`: optional, default use AWS.config.credentials\n- `sessionToken`: optional, default use AWS.config.credentials\n\nConfiguration object:\n```\nvar config = {\n  endpoint: \"required --\u003e your api gateway endpoint\",\n  method: \"POST | GET | PUT | OPTIONS\",\n  data: [your object data to send to the api],\n  accessKeyId: \"[your aws accessKeyId, default use AWS.config.credentials]\",\n  secretAccessKey: \"[your aws secretAccessKey, default use AWS.config.credentials]\",\n  sessionToken: \"[your aws sessionToken, default use AWS.config.credentials]\"\n}\n```\n\n## Example:\n```javascript\nvar fetchApiSigv4 = require(\"fetch-sigv4\")\n\nvar config = {\n    endpoint: \"https://[your-api-id].execute-api.[region].amazonaws.com/[stage]/v1/authors\",\n    method: \"POST\",\n    data: {\n        name: \"Tam Nguyen\",\n        country: \"Viet Nam\"\n    }\n}\n\n// var config = {\n//     endpoint: \"https://[your-api-id].execute-api.[region].amazonaws.com/[stage]/v1/authors\",\n//     method: \"GET\",\n//     headers: { \"X-Request-ID\": \"1234\" },\n//     secretAccessKey: \"your secret access key\",\n//     accessKeyId: \"your access key id\"\n// }\n\nconst runDemo = async () =\u003e {\n    try {\n        console.log(\"Starting to run demo...\");\n        const response = await fetchApiSigv4(config);\n        console.log(\"response data: \", response.data);\n    } catch (error) {\n        console.log(\"error: \", error);\n    }\n}\n\nrunDemo();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntamvl%2Ffetch-sigv4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fntamvl%2Ffetch-sigv4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fntamvl%2Ffetch-sigv4/lists"}