
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
gatsby-mdx-tts
Advanced tools
🗣 Easy text-to-speech for your Gatsby site, powered by Amazon Polly.
npm install --save gatsby-mdx-tts
In order to use this plugin you need an AWS account. You can use the text-to-speech service for free for the first 12 months (up to a couple million words to be precise).
Attention: If you exceed the limits or use it after your initial free tier, using this plugin will generate costs in your AWS account!
As this is a plugin for gatsby-plugin-mdx it will only work if you have that plugin installed and configured properly as well.
To include the plugin just add it to your gatsby-plugin-mdx
configuration in the gatsbyRemarkPlugin
section. In case you have multiple gatsbyRemarkPlugins
configured is very important that you put the gatsby-mdx-tts
plugin to first position!
Also, you need to include a couple of mandatory configurations:
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-plugin-mdx`,
options: {
gatsbyRemarkPlugins: [
{
resolve: "gatsby-mdx-tts",
options: {
awsRegion: "us-east-1",
defaultVoiceId: "Justin",
},
},
],
},
},
],
The plugin requires your AWS credentials in order to generate the text-to-speech files.
There are two ways to configure your AWS credentials:
// In your gatsby-config.js
{
"resolve": "gatsby-mdx-tts",
"options": {
"awsCredentials": {
"accessKeyId": process.env.GATSBY_AWS_ACCESS_KEY_ID,
"secretAccessKey": process.env.GATSBY_AWS_SECRET_ACCESS_KEY,
},
},
},
Attention: If you choose to go with option 2 it is highliy recommended to work with environment variables (as seen in the example above)! Do not directly paste your AWS credentials into your gatsby-config.js
file and commit it to git as this would be a security issue!
Option | Required | Example |
---|---|---|
awsRegion | Yes | "us-east-1" |
defaultVoiceId | Yes | "Justin" |
awsCredentials | No | { "accessKeyId": process.env.GATSBY_AWS_ACCESS_KEY_ID, "secretAccessKey": process.env.GATSBY_AWS_SECRET_ACCESS_KEY } |
defaultSsmlTags | No | "<prosody rate='70%'>$SPEECH_OUTPUT_TEXT</prosody>" |
lexiconNames | No | ["LexA", "LexB"] |
defaultSsmlTags
:<speak>
tag is added automatically.$SPEECH_OUTPUT_TEXT
will be replaced with the speech output text.The MIT License
The gatsby-mdx-tts library is maintained and sponsored by the Swiss web and mobile app development company Florian Gyger Software.
FAQs
Adds speech output to your Gatsby site using Amazon Polly.
The npm package gatsby-mdx-tts receives a total of 1 weekly downloads. As such, gatsby-mdx-tts popularity was classified as not popular.
We found that gatsby-mdx-tts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.