Skip to content

Missing function for validating Alpaca API Connection #271

@iocron

Description

@iocron

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

Currently there is no way to check if the provided credentials/configuration/connection is correct to connect to the alpaca api. It would be nice to have a function/implementation to return the http status code and/or similar.

Describe the solution you'd like.

Maybe something similar to:

const alpaca = new Alpaca({
  keyId: process.env.ALPACA_API_KEY,
  secretKey: process.env.ALPACA_API_SECRET,
})

if(alpaca.validateConnection()){
  console.log("alpaca connection is valid.")
} else {
  throw new Error("alpaca connection is invalid.")
}

// Or: 
if(alpaca.apiHttpStatusCode === '401'){

}

Describe an alternate solution.

No response

Anything else? (Additional Context)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions