Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing function for validating Alpaca API Connection #271

Open
1 task done
iocron opened this issue Oct 19, 2024 · 0 comments
Open
1 task done

Missing function for validating Alpaca API Connection #271

iocron opened this issue Oct 19, 2024 · 0 comments

Comments

@iocron
Copy link

iocron commented Oct 19, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant