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

@lkaric/twilio-nestjs

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lkaric/twilio-nestjs

Twilio module wrapper for NestJS framework

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Feature

Nestjs module wrapper for twilio client.

Installation

Yarn

yarn add @lkaric/twilio-nestjs

NPM

npm install @lkaric/twilio-nestjs --save

Getting Started

An example instantiatiation of twilio client in for example app.module.ts

import { Module } from '@nestjs/common';
import { TwilioModule } from '@lkaric/twilio-nestjs';

@Module({
  imports: [
    TwilioModule.register({
      accountSid: '<TWILIO_SID>',
      authToken: '<TWILIO_AUTH_TOKEN>',
    }),
  ],
})
export class AppModule {}

Example usage.

import { Injectable } from '@nestjs/common';
import { TwilioService } from '@lkaric/twilio-nestjs';

@Injectable()
export class SendMeSms {
  constructor(private readonly twilioService: TwilioService) {}

  async sendSms() {
    try {
      const message = await this.twilioService.client.messages.create({
        body: '<MESSAGE_BODY>',
        from: '<TWILIO_PHONE_NUMBER>',
        to: '<TARGET_PHONE_NUMBER>',
      });
      return message;
    } catch (error) {
      return error;
    }
  }
}

For full Client API see the official Twilio SDK reference here;


Keywords

FAQs

Package last updated on 22 Feb 2020

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