Why am I getting 'auth' undefined error when passing API data to MySQL?

This topic was automatically generated from Slack. You can find the original thread here.

I am getting auth undefined when trying to pass API data to MySQL

{ ‘$auth’: undefined }

Hi, could you share more details on your issue?

Yes - I am attempting a scheduled task that will poll Fitbit and get information such as my food logs. The response from the API has arrays which need to be processed. After scheduling the trigger, I have the code section, where I have selected my fitbit account and my MySQL account. Both are verified as correct in the connected accounts section.

When running this code:

import { axios } from "@pipedream/platform";
import mysql from 'mysql2/promise';

export default defineComponent({
  props: {
    fitbit: {
      type: "app",
      app: "fitbit",
    mysql: {
      type: "app",
      app: "mysql",
  async run({ steps, $ }) {
    // Fetch activities from Fitbit API
    const response = await axios($, {
      url: `https://api.fitbit.com/1/user/-/activities/list.json?afterDate=2024-01-10&sort=asc&limit=100&offset=0`,
      headers: {
        Authorization: `Bearer ${this.fitbit.$auth.oauth_access_token}`,

    const activities = response.activities;

       // Check if MySQL auth details are defined
    if (!this.mysql.$auth) {
//      throw new Error("MySQL authentication details are not defined. Please check your MySQL app configuration.");

I always get the error above because authentication details are not defined. However, they definitively are in the connected account.