Appearance
Companion Module
The Companion Module is a part of the NestKit package and serves as a custom lightweight implementation of Uppy Companion. It assists the Uppy frontend with handling Google Storage resumable uploads.
Overview
The Companion Module facilitates communication between the frontend and Google Storage by providing the necessary parameters for file uploads. It works alongside the ImageUploader component from the HopeUiKit, which utilizes an Uppy instance for uploading files to Google Storage.
Key Components
Companion Controller
The Companion Controller provides the companion/gcp/params
REST endpoint, which allows the GcsUppyPlugin to fetch the required parameters for uploading files to a Google Storage bucket.
How to install the CompanionModule in your application
To install the CompanionModule
in your application, you'll need to follow these steps:
Install the required dependencies for
CompanionModule
:Import the
CompanionModule
from the@deeepvision/nest-kit
package.tsimport { CompanionModule } from '@deeepvision/nest-kit/dist/modules/companion';
Next, add the
CompanionModule
to the imports array within the@Module
decorator of yourAppModule
. This will make the functionality of theCompanionModule
available throughout your application.ts@Module({ imports: [ CompanionModule, // ... other modules ], // ... other configurations }) export class AppModule {}
How to use Companion
Once you have set up the Companion Module in your NestJS application, you need to configure Uppy on the frontend and use the ImageUploader
component. To do this, follow the steps provided in the HopeUiKit documentation.