We use a product that provides us an endpoint for javascript resources and an API endpoint. This URL is then provided to teams internally to interface with the API.
We run into issues where the service could change the endpoint during site switches or environment refreshes, resulting in us needing to coordinate
with other internal teams to give them the updated endpoint, and then they have to update their product which is not ideal.
Current State:
<script type='text/javascript' src='https://c.la2-c1cs-ia7.salesforceliveagent.com/content/g/js/58.0/deployment.js'></script>
<script type='text/javascript' src='https://c.la2-c1cs-ia7.salesforceliveagent.com/content/g/js/58.0/prechat.js'></script>
<script type='text/javascript'>liveagent.init('https://d.la2-c1cs-ia7.salesforceliveagent.com/chat', 'deploymentId123', 'orgId123');</script>
I would like to provide these internal teams with a static endpoint they don't need to change and allow us to control the destination it points to in order to eliminate
them from needing to make changes.
I was thinking that if we had a static endpoint, we could give the internal team and point them to the known destination.
http://static-asset-endpoint.com/prod
-> https://c.la2-c1cs-ia7.salesforceliveagent.com
http://static-api-endpoint.com/prod
-> https://d.la2-c1cs-ia7.salesforceliveagent.com
Possible Future State:
<script type='text/javascript' src='http://static-asset-endpoint.com/prod/content/g/js/58.0/deployment.js'></script>
<script type='text/javascript' src='http://static-asset-endpoint.com/prod/content/g/js/58.0/prechat.js'></script>
<script type='text/javascript'>liveagent.init('http://static-api-endpoint.com/prod/chat', 'deploymentId123', 'orgId123');</script>
When a change is needed, our team can update the endpoint those static URLs resolve to.
Questions:
- How should something like this be done?
- Would this be considered a proxy, or can it be done solely with DNS records?
- Would there be limitations with this due to CORS, etc.? They are public resources, not behind any authentication.