Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dynamodb-helper

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dynamodb-helper

A helper component to interface with dynamodb using the AWS SDK, directly from React

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11
Maintainers
1
Weekly downloads
 
Created
Source

react-dynamodb-helper

A helper component to interface with dynamodb using the AWS SDK, directly from React

NPM JavaScript Style Guide

Install

npm install --save react-dynamodb-helper

Dependencies

npm install --save aws-sdk

Note

AWS key pair needs to have DynamoDb privileges

Usage


import React, { useEffect } from 'react'

import * as DynamoDB from 'react-dynamodb-helper';

const App = () => {

    useEffect(() => {

        async function getData() {
            var params = {
            TableName: "Account_Credentials",
            Key : { 
                "email" : 'hru****@***ies.com',
            }
            };

            // aws_secret and aws_access_key need to have
            // dynamodb access
            
            let result = await DynamoDB.getData("aws_region", "aws_secret", "aws_access_key", params)

        }
        getData();

    }, [])


    useEffect(() => {

        async function updateData() {
            var params = {
                TableName: "Account_Credentials",
                Key : { 
                    "email" : 'hru****@***ies.com',
                },
                UpdateExpression: "set #otp = :otpVal",
                ExpressionAttributeNames: {
                    "#otp": "otp",
                },
                ExpressionAttributeValues: {
                    ":otpVal": "1212"
                }
            };

            // aws_secret and aws_access_key need to have
            // dynamodb access
            
            let result = await DynamoDB.updateData("aws_region", "aws_secret", "aws_access_key", params)

        }
        getData();

    }, [])

  return <div>Hello DynamoDB Helper</div>
}

export default App

License

MIT © superflows-dev

Keywords

FAQs

Package last updated on 14 Jul 2022

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