Visualforce
If you are using ts-force
in an application running in VisualForce, obtaining an access token is simple:
<apex:page showHeader="true" sidebar="false" standardStylesheets="false" docType="html-5.0">
<script type="text/javascript">
//rest details
const __ACCESSTOKEN__ = '{!JSENCODE($Api.Session_ID})';
const __RESTHOST__ = '{!JSENCODE(URLFOR("/", null)})';
</script>
<div id="root"></div>
</apex:page>
In order to make certain API request, you may need to add a CORS Allowlist
entry for the VisualForce domain.
Last updated
Was this helpful?