Getting Started

Getting Started#

Nestjs-pusher only requires you to boostrap the module with Pusher.js configurations and also some custom metadata. This top level configurations will help in metadata scanning and also will help our middlewares.

This library requires the minimum of knowledge regarding Nestjs dependency injection and module resolution

Example#

import { Module } from '@nestjs/common';
import { PusherModule } from 'nestjs-pusher';
//You can check all the options in Pusher.Options interface
const yourPusherOptions = {
key: 'YOUR_KEY',
appId: 'ID',
secret: 'YOUR_SECRET',
}
const chunkingOptions = {
limit: 4000, //4mb
enabled: true
}
@Module({
imports: [PusherModule.forRoot(yourPusherOptions, chunkingOptions, isGlobal)],
})
export class AppModule {}

Hint: Nestjs-pusher is agnostic to which http adapter you are using, you can use Fastify but for the sake of this example we are using an official example replication.