Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nestjs-async-schema-registry

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-async-schema-registry

Nest.js module for Confluent Schema Registry

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
0
Weekly downloads
 
Created
Source
NestJS Confluent Schema Registry

NestJS module for Confluent Schema Registry


Tiny NestJS module to use with Confluent Schema Registry

1. Install

npm install @goopen/nestjs-schema-registry @kafkajs/confluent-schema-registry

2. Register the Confluent schema module in your app

@Module({
  imports: [
    SchemaRegistryModule.register({
      isGlobal: true,
      host: SCHEMA_REGISTRY_URL,
      auth: {
        username: SCHEMA_REGISTRY_USERNAME,
        password: SCHEMA_REGISTRY_PASSWORD,
      },
    }),
  ],
})
export class KafkaModule {}

Or if you wish to inject the ConfigModule to pull the configuration from environment variables

@Module({
  imports: [
    ConfigModule.forRoot(),
    SchemaRegistryModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: (configService: ConfigService) => ({
        host: configService.get<string>('SCHEMA_REGISTRY_URL'),
        auth: {
          username: configService.get<string>('SCHEMA_REGISTRY_USERNAME'),
          password: configService.get<string>('SCHEMA_REGISTRY_PASSWORD'),
        },
      }),
    }),
  ]
})
export class KafkaModule {}

3. You're then able to use the injector to use the schema registry

@Injectable()
export class KafkaService{
  constructor(
    @InjectSchemaRegistry() private readonly schemaRegistry: SchemaRegistry,
  ) {}
}

FAQs

Package last updated on 08 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc