react-dynamodb-helper
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "react-dynamodb-helper", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A helper component to interface with dynamodb using the AWS SDK, directly from React", | ||
@@ -5,0 +5,0 @@ "author": "superflows-dev", |
@@ -16,3 +16,36 @@ # react-dynamodb-helper | ||
```jsx | ||
import React, { useEffect } from 'react' | ||
import * as DynamoDB from 'react-dynamodb-helper'; | ||
const App = () => { | ||
const apiCall = async () => { | ||
var params = { | ||
TableName: "Account_Credentials", | ||
Key : { | ||
"email" : 'hrushi@megotechnologies.com', | ||
} | ||
}; | ||
let result = await DynamoDB.getData("ap-XXXX-1", "aws_secret", "aws_access_key", params) | ||
} | ||
useEffect(() => { | ||
async function fetchData() { | ||
await apiCall(); | ||
} | ||
fetchData(); | ||
}, []) | ||
return <div>Hello DynamoDB Helper</div> | ||
} | ||
export default App | ||
``` | ||
@@ -19,0 +52,0 @@ |
86039
55