GCP Function to securely proxy API calls to Alpaca Broker API, including Plaid and Stytch.
The repo is intended to simplify development of mobile / web apps on top Alpaca.
All calls abbreviated by /alpaca
will be forwarded to Alpaca, using the predefined Alpaca.Markets Broker API base URL.
All calls abbreviated by /plaid
will be forwarded to Plaid.
All calls abbreviated by /stytch
will be forwarded to Stych.
The proxy function can log requests & responses (based on the DEBUG
environment variable)
The function uses security best practices to ensure compliance and security of Alpaca credentials.
The project is deployed using GCP Cloud Build. The deployment will create a proxy
end-point. It is suggested to set up a deployment trigger in CloudBuild.
Add two secrets to GCP Secrets Manager:
- alpaca_api_key
- alpaca_api_secret
Obtained after registering to Alpaca Broker API
- plaid_client_id
- plaid_secret
Obtained after registering to Plaid
- stytch_projet_id
- stytch_secret
Obtained after registering to Stytch
Once deployed, the GCP Function service account needs to be added to the Secrets with role Secret Accessor
- PROJECT_ID: GCP project-id hosting GCP Function and secret
- ALPACA_BASE_URL: Alpaca base URL defaults to sandbox
- PLAID_BASE_URL: Plaid base URL default to sandbox
- STYTCH_BASE_URL: Stytch base URL default to test
- DEBUG: "True"/"False" (default "True") log both request and response