0

I need to configure the RN SDK for AWS timestream but I keep getting an error:

Cant find variable Credential.

import { TimestreamQueryClient, CreateDatabaseCommand } from "@aws-sdk/client-timestream-query";

const client = new TimestreamQueryClient({
   region: "eu-west-1",
   credentials: new Credential('XXXXXXXXXXXX', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'), // fails here
   apiVersion: 'latest'
});

What am I doing wrong here?!

I was not able to find any documentation regarding the SDK configuration in RN.

smac2020
  • 9,637
  • 4
  • 24
  • 38
showtime
  • 1
  • 1
  • 17
  • 48

1 Answers1

1

I see that you are using the AWS SDK for JavaScript v3. To successfully use this API, you need to setup you DEV environment - including your creds. All these details are discussed in the AWS JavaScript V3 DEV Guide. I recommend that you read topics in this guide - which includes setting up your creds.

Setting up the SDK for JavaScript

As you want to work in React - this topic is very important for you to read - it has all the required instructions:

Getting started in React Native

This Guide is also referenced from the doc you pointed me too:

enter image description here

smac2020
  • 9,637
  • 4
  • 24
  • 38
  • How do you actually add a unique auto increment ID. Sorry this is a different question but maybe you can give a quick answer – showtime Apr 29 '22 at 13:18
  • 1
    Have you seen examples here for this service -- https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.create-scheduledquery.html – smac2020 Apr 29 '22 at 13:51
  • thanks but thats not what I am doing, here is the link to my question: https://stackoverflow.com/questions/72058435/how-to-add-unique-id-when-inserting-data-in-aws-timestream . I would highly appreciate your help! – showtime Apr 29 '22 at 14:23