import Riza from '@riza-io/api';

const client = new Riza({
  apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const response = await client.command.execFunc({
    code: 'def execute(input): return { "name": input["name"], "executed": True }',
    language: 'python',
    input: { name: 'John' },
  });

  console.log(response.execution);
}

main();
{
  "output": {
    "name": "John",
    "executed": true
  },
  "output_status": "valid",
  "execution": {
    "exit_code": 0,
    "stdout": "",
    "stderr": "",
    "duration": 7
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

200
application/json
OK

The response is of type object.