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

@aws-sdk/client-pinpoint

Package Overview
Dependencies
Maintainers
5
Versions
417
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-sdk/client-pinpoint

AWS SDK for JavaScript Pinpoint Client for Node.js, Browser and React Native

  • 3.669.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
253K
decreased by-3.86%
Maintainers
5
Weekly downloads
 
Created

What is @aws-sdk/client-pinpoint?

@aws-sdk/client-pinpoint is an AWS SDK for JavaScript package that allows developers to interact with the Amazon Pinpoint service. Amazon Pinpoint is a flexible and scalable outbound and inbound marketing communications service. It enables you to engage with your customers by sending them targeted messages through multiple channels, such as email, SMS, push notifications, and voice messages.

What are @aws-sdk/client-pinpoint's main functionalities?

Send Email

This feature allows you to send an email using Amazon Pinpoint. The code sample demonstrates how to configure and send an email message to a recipient.

const { PinpointClient, SendMessagesCommand } = require('@aws-sdk/client-pinpoint');

const client = new PinpointClient({ region: 'us-west-2' });

const params = {
  ApplicationId: 'your-application-id',
  MessageRequest: {
    Addresses: {
      'recipient@example.com': {
        ChannelType: 'EMAIL'
      }
    },
    MessageConfiguration: {
      EmailMessage: {
        SimpleEmail: {
          Subject: { Data: 'Test Email' },
          HtmlPart: { Data: '<h1>Hello</h1><p>This is a test email.</p>' },
          TextPart: { Data: 'Hello, This is a test email.' }
        }
      }
    }
  }
};

const run = async () => {
  try {
    const data = await client.send(new SendMessagesCommand(params));
    console.log('Success', data);
  } catch (err) {
    console.error('Error', err);
  }
};

run();

Send SMS

This feature allows you to send an SMS message using Amazon Pinpoint. The code sample demonstrates how to configure and send an SMS message to a recipient.

const { PinpointClient, SendMessagesCommand } = require('@aws-sdk/client-pinpoint');

const client = new PinpointClient({ region: 'us-west-2' });

const params = {
  ApplicationId: 'your-application-id',
  MessageRequest: {
    Addresses: {
      '+1234567890': {
        ChannelType: 'SMS'
      }
    },
    MessageConfiguration: {
      SMSMessage: {
        Body: 'This is a test SMS message.',
        MessageType: 'TRANSACTIONAL'
      }
    }
  }
};

const run = async () => {
  try {
    const data = await client.send(new SendMessagesCommand(params));
    console.log('Success', data);
  } catch (err) {
    console.error('Error', err);
  }
};

run();

Create Segment

This feature allows you to create a segment in Amazon Pinpoint. The code sample demonstrates how to define and create a segment based on specific criteria.

const { PinpointClient, CreateSegmentCommand } = require('@aws-sdk/client-pinpoint');

const client = new PinpointClient({ region: 'us-west-2' });

const params = {
  ApplicationId: 'your-application-id',
  WriteSegmentRequest: {
    Name: 'TestSegment',
    Dimensions: {
      Demographic: {
        Channel: {
          Values: ['EMAIL'],
          DimensionType: 'INCLUSIVE'
        }
      }
    }
  }
};

const run = async () => {
  try {
    const data = await client.send(new CreateSegmentCommand(params));
    console.log('Success', data);
  } catch (err) {
    console.error('Error', err);
  }
};

run();

Other packages similar to @aws-sdk/client-pinpoint

FAQs

Package last updated on 10 Oct 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