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

@remnawave/xtls-sdk-nestjs

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remnawave/xtls-sdk-nestjs

![GitHub top language](https://img.shields.io/github/languages/top/remnawave/xtls-sdk-nestjs) ![GitHub Repo stars](https://img.shields.io/github/stars/remnawave/xtls-sdk-nestjs)

  • 0.0.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

NestJS XTLS SDK Module

GitHub top language GitHub Repo stars

npm version GitHub Tag

Build Status Downloads License NPM Last Update

Known Vulnerabilities Coverage Status

A NestJS module wrapper for the XTLS SDK, providing seamless integration of XTLS functionality into your NestJS applications.

Installation

npm install @remnawave/xtls-sdk-nestjs

Features

  • 🚀 Easy integration with NestJS applications
  • ⚡ Supports both synchronous and asynchronous configuration
  • 🔄 Automatic cleanup on application shutdown
  • 🌐 Global module availability
  • 🎯 Custom decorator for easy injection

Quick Start

Synchronous Configuration

import { XtlsSdkNestjsModule } from '@remnawave/xtls-sdk-nestjs';

@Module({
  imports: [
    XtlsSdkNestjsModule.forRoot({
      ip: 'your-ip-address',
      port: 'your-port',
    }),
  ],
})
export class AppModule {}

Asynchronous Configuration

import { XtlsSdkNestjsModule } from '@remnawave/xtls-sdk-nestjs';

@Module({
  imports: [
    XtlsSdkNestjsModule.forRootAsync({
      imports: [ConfigModule],
      useFactory: async (configService: ConfigService) => ({
        ip: configService.get('XTLS_IP'),
        port: configService.get('XTLS_PORT'),
      }),
      inject: [ConfigService],
    }),
  ],
})
export class AppModule {}

Usage in Services

Use the @InjectXtls() decorator to inject the XTLS SDK instance into your services:

import { Injectable } from '@nestjs/common';
import { InjectXtls } from '@remnawave/xtls-sdk-nestjs';
import { XtlsApi } from '@remnawave/xtls-sdk';

@Injectable()
export class YourService {
  constructor(@InjectXtls() private readonly xtlsApi: XtlsApi) {}

  async yourMethod() {
    // Use xtlsApi here
  }
}

Configuration Options

OptionTypeDescription
ipstringThe IP address for the XTLS connection
portstringThe port number for the XTLS connection

API Reference

XtlsSdkNestjsModule

  • forRoot(options: XtlsModuleOptions): Static method for synchronous module configuration
  • forRootAsync(options: AsyncModuleOptions): Static method for asynchronous module configuration

Decorators

  • @InjectXtls(): Decorator for injecting the XTLS SDK instance

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Support

For support, please open an issue in the GitHub repository.

Keywords

FAQs

Package last updated on 15 Nov 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