Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @aws-sdk/polly-request-presigner

@aws-sdk/polly-request-presigner

NPM version NPM downloads

This package provides a presigner based on signature V4 that will attempt to generate signed url for polly audio.

Get Presigned URL with Client and Command

Example Usage:

import { Polly, PollyClient } from "@aws-sdk/client-polly";

import { getSynthesizeSpeechUrl } from "@aws-sdk/polly-request-presigner";

const synthesizeSpeechParams = {
  Text: "Hello world, the polly presigner is really cool!",
  OutputFormat: "mp3",
  VoiceId: "Kimberly",
};

// Synthesize with full polly.
(async () => {
  let url = await getSynthesizeSpeechUrl({
    client: new Polly({ region: "us-east-1" }),
    params: synthesizeSpeechParams,
  });
  console.log(url);
})();

// Synthesize with polly client.
(async () => {
  let url = await getSynthesizeSpeechUrl({
    client: new PollyClient({ region: "us-east-1" }),
    params: synthesizeSpeechParams,
  });
  console.log(url);
})();

Index

References

PresignedPollyInput

Re-exports PresignedPollyInput

PresignedPollyOptions

Re-exports PresignedPollyOptions

getSynthesizeSpeechUrl

Re-exports getSynthesizeSpeechUrl

Variables

Const ALGORITHM_IDENTIFIER

ALGORITHM_IDENTIFIER: "AWS4-HMAC-SHA256" = "AWS4-HMAC-SHA256"

Const ALGORITHM_QUERY_PARAM

ALGORITHM_QUERY_PARAM: "X-Amz-Algorithm" = "X-Amz-Algorithm"

Const AMZ_DATE_QUERY_PARAM

AMZ_DATE_QUERY_PARAM: "X-Amz-Date" = "X-Amz-Date"

Const CREDENTIAL_QUERY_PARAM

CREDENTIAL_QUERY_PARAM: "X-Amz-Credential" = "X-Amz-Credential"

Const EXPIRES_QUERY_PARAM

EXPIRES_QUERY_PARAM: "X-Amz-Expires" = "X-Amz-Expires"

Const HOST_HEADER

HOST_HEADER: "host" = "host"

Const SIGNED_HEADERS_QUERY_PARAM

SIGNED_HEADERS_QUERY_PARAM: "X-Amz-SignedHeaders" = "X-Amz-SignedHeaders"

Functions

Const getSignedUrl

  • getSignedUrl(client: PollyClient, command: SynthesizeSpeechCommand, options?: any): Promise<string>

Const getSynthesizeSpeechUrl