Node.js OB2 variable inclusion

im trying to insert 3 variables ive parsed into a js script within OB2 ive used the identifier <variable and <input.variable> so far with no luck unfortunately. everything else is functional

You cannot pass a variable with a period in it to a script, you have to first reassign the value of that variable to a new variable and pass that one.

So for example use a constant string block to put the value of input.USERNAME into username and pass that one to the script.

still getting the same error “unexpected identifier”

sample

// BLOCK: xamzs
data.ExecutingBlock("xamzs");
string xamzs = ConstantString(data, "input.xamz");

using <xamzs> within script

included ’ ’ because i couldnt see the variable on my screen

You can wrap code in backticks ` to avoid the auto HTML sanitizer from cleaning the code.

The problem is that you are using <xamzs> within the script while you should be just using xamzs without the angle brackets. In the “input variables” field of the block also put xamzs without angle brackets.

Remember to use <this> syntax only when the background of the input box is dark green, otherwise you should not be using it!

hmmm im still getting th same error, heres a sample of the code that is saved in my scripts folder if you dont mind taking a look

module.exports = async (accesskeys,secrets,xamzs) => {
BLOCK:Script
INTERPRETER:NodeJS
INPUT accesskeys,secrets,xamzs
BEGIN SCRIPT
import { sha256Hex } from "./deps.ts";
import { toAmz, toDateStamp } from "./src/date.ts";
export { toAmz, toDateStamp };
import { getSignatureKey, signAwsV4 } from "./src/signing.ts";

/**
 * Generic AWS Signer interface
 */
export interface Signer {
  sign: (service: string, request: Request) => Promise<Request>;
}

/**
 * The AWS credentials to use for signing.
 */
export interface Credentials {
  awsAccessKeyId: accesskeys;
  awsSecretKey: secrets;
  sessionToken?: xamzs;
}

also i know there are signature plugins and such on the site, none include session tokens so i have to outsource to github lol

I don’t think that’s how it works, but I’m not skilled enough with nodejs to help you, sorry.