Closed bimix closed 2 years ago
Hey @bimix thanks for opening this issue, can you please share complete reproducible code? For above piece of code I can run it just fine using my own credentials.
new Credentials
how do you import 'Credentials' ?
Hi @bimix!
You can setup the client the following way:
const client = new TimestreamQueryClient({
region: "us-east-1",
accessKeyId: "XXXXXXXXXXXX",
secretAccessKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
apiVersion: 'latest'
});
To answer your second question about how to import Credentials please see the following:
First of all you need to make sure you have a credentials set up for your AWS account to interact with the SDK.
If you do not, please visit this link
Otherwise, here are all the ways you can setup credentials.
A good way to do that is to let the CLI import the credentials automatically from your ~/.aws/credentials
file.
You can learn how to do that here
That way you can omit the accessKeyId
and secretAccessKey
parameters, and the CLI will take care of authentication.
Another way you can "import" your AWS credentials, is by using a .env file to inject environment variables instead of hard coding the credentials. You can look at the react-native-env package to do that. You should not hard code your credentials into your file, let alone push them to your remote git repo!
Let me know if this answers your questions or if you need anything else. Cheers
This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.
Describe the bug
I am using the Timestream SDK for React-Native but I am facing an issue when configuring the client.
Your environment
React Native
SDK version number
"@aws-sdk/client-timestream-query": "^3.79.0",
Is the issue in the browser/Node.js/ReactNative?
ReactNative
Details of the browser/Node.js/ReactNative version
"react-native": "0.68.0"
Steps to reproduce
Install SDK in a bare RN project, and have the configuration code set as I do above. Run RN app.
Observed behavior
Expected behavior
No error.