env.examplefile and save it as
.envfile. This file contains your private keys, which will be used on the server-side. For a minimal setup, you need to put the following required variables i.e.
secretfor your applications in .env file. We created this file during the setup.
metaFieldsfield while initializing the ImageKit Uppy plugin. Ideally, you should only allow the supported upload request parameters to avoid any surprises as we have done in this sample application.
IMAGEKIT_PUBLIC_KEY, that is already set in HTML by the server.
companionUrlis set to the root of the server running in this application. If you plan to run Companion on a different backend or as a standalone application, please follow the Uppy documentation.
idwhich is how Uppy identifies plugins uniquely.
authenticationEndpointis standard across all ImageKit's client-side SDKs. It is used to get the security tokens required to authenticate the upload request originating from the browser. In this application, we have implemented this endpoint at the path
/auth. And we are using ImageKit.io node JS SDK to generate the signature. You can use any other ImageKit's server-side SDK to implement this authentication endpoint.
metaFieldsis an array of meta properties you want to be sent to every upload request. By default, this plugin will send all properties in the
npm build, Parcel creates bundle.js and bundle.css files in the dist folder.
npm buildas part of the minimal setup.
getAuthenticationParametersfunction available Node.js SDK returns the required JSON.