aws-samples / aws-tools-for-babylonjs-editor

AWS Tools for Babylon.JS Editor is a suite of tools meant to interact with Babylon.JS Editor by utilizing the capabilities of AWS products.
Apache License 2.0
32 stars 9 forks source link

Add plugin name and version number to user agent for Amplify plugin #16

Closed prestomation closed 2 years ago

prestomation commented 2 years ago

By default, the v3 SDK uses node libraries in electron/the editor, so we can't introspect the network traffic in the dev tools.

You can use something like the following to use the Fetch handler, so you can do so. I did this and noticed the useragent was set as expected (Although other parts of the plugin don't work this way, so we can't leave it like this)

this.client = new AmplifyClient({customUserAgent: AWSToolsForBabylonJS-${PLUGIN_VERSION}, requestHandler: new FetchHttpHandler()});

I've also pushed this to my fork to test the github action, which writes the current git commit to the constants file. This let's us track a specific version.

When we setup the release process, we should change this to the version number, but wanted to use the commit hash for now as the workflow is the same

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

prestomation commented 2 years ago

See the action run here: https://github.com/prestomation/aws-tools-for-babylonjs-editor/runs/6167453112