Deploy to Production (5m)
Let's deploy your Next.js app with GT.
Overview
This is a short tutorial to help you deploy your Next.js app with GT.
We will do this in 2 steps:
Add your production API keys.
Add the translate command to your build script.
Prerequisites
Make sure that you have followed the Quick Start Guide to set up your Next.js app with GT.
Step 1: Add your production API keys 🔑
Add your production API key and Project ID to your production environment variables.
From your dashboard, go to API Keys in the sidebar. Click on Create API Key, and add them to your production envrionment.
Protect Your API Keys!
Production keys should only ever be used in production. Likewise, development keys should only ever be used in development. Never commit your API keys to a public repository!
Step 2: Add the translate command to your build script 🏗️
The next step is to add the translate command to your build script, and specify the locales that you would like to ship to production.
Here, we have added Portuguese and Spanish to our configuration.
That's it! You are now ready to deploy your Next.js with GT!
Next steps
- Follow this guide on How to Manage Locales.
- Learn how to Translate Strings.
- Learn about the
<T>
component.