Jump to content

How to run ftrack-javascript-api-example-react


ledidukh

Recommended Posts

Hi,

Thanks for showing interest in the widget examples.

To run the example you linked to in development mode, install the dependencies (`npm install`), and then start the development server using the following command and opening a web browser on port 8001.

npm start

To build a a production version, you can run `npm build`.

The example contains a very minimal webpack configuration, which can be extended.  The example can probably be rewritten using create-react-app to avoid having to deal with build configuration etc.. Interesting parts of the example are:

  • Setting up the Javascript API using injected credentials in index.js
  • Fetching and displaying notes in the Notes component.

Regards,
Lucas

Link to comment
Share on other sites

Hi,

That is correct, if you are cloud-hosted or run the server over HTTPS/SSL, the dashboard widget must also be served over SSL due to the browsers security restrictions. For development, you could run a SSL proxy in front of the development server.

To host the built widget, you can google for "static website hosting" for alternatives. It should be possible to host it on AWS S3, Google's storage service, github, etc.. I believe you can use e.g. dropbox for static website hosting as well.

Regards,
Lucas

Link to comment
Share on other sites

  • 1 year later...

I've tried running npm install on this react example. I get an error with the reference to the ftrack-web-widget.git. Is there a way to get this working, or can we get an updated widget example with updated references? snippet of npm logs below:

1658 error Error while executing:
1658 error /usr/bin/git ls-remote -h -t ssh://git@bitbucket.org/ftrack/ftrack-web-widget.git
1658 error
1658 error git@bitbucket.org: Permission denied (publickey).
1658 error fatal: Could not read from remote repository.
1658 error
1658 error Please make sure you have the correct access rights
1658 error and the repository exists.
1658 error
1658 error exited with error code: 128
1659 verbose exit [ 1, true ]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...