Discussion posts and replies are publicly visible
Hey chanceb, if I'm not wrong, what you could do is to add the script to your index.html entry file for your custom component. Once deployed to Appian, the Appian.Component object will be available in the global scope and you would be able to access it anywhere within your React application.
You could do it that way, but if that was the case you would not be developing on a webpack dev server / or min the code with a production build. The build would happen before the component is deployed to Appian, so the build would fail.
Actually that's been the way we've been deploying our custom component to our Appian environment.What we are doing currently is to put the script within the index entry file so that it would get loaded successfully when deployed to Appian. This is after we have ran the webpack build and it returns us our index_bundle.js file.When we run it on webpack dev server however, the loading of this script will fail, however we have another module which handles a backend call to our local server to call third-party APIs.
So we're building an extra module which would be needed when we do development and testing on our local environment, as opposed to when you have the Appian.Component when the custom component has been deployed to your Appian environment.
© 2024 Appian. All rights reserved.