Next.js / Setup
Step 13 of 23
Connect your Altified project
Add the project ID and server secret from the dashboard, then confirm the generated Next.js wiring.
Open the Altified project dashboard and go to SDK setup. Copy the project UUID and create a secret key. A secret may only be shown once, so store it in your server environment immediately.
.env.local
ALTIFIED_SECRET_KEY=altified_...
ALTIFIED_PROJECT_ID=your-project-uuid
ALTIFIED_DEFAULT_LOCALE=en- ALTIFIED_SECRET_KEY contains the server secret.
- ALTIFIED_PROJECT_ID contains the project UUID.
- ALTIFIED_DEFAULT_LOCALE matches the project source language code.
- The generated lib/altified file imports server-only.
- The root Next config is wrapped with withAltified.
If the initializer could not modify a custom Next config, wrap its existing exported configuration manually:
next.config.mjs
import { withAltified } from "@altified/next/config";
export default withAltified({});Restart the development server after changing environment variables or the Next config. Visit a page once; the first translation request updates the project's SDK connection status.
Keep secrets server-side
Never use a
NEXT_PUBLIC_ prefix for the secret and never import lib/altified into a Client Component. The project ID is safe for the public language switcher; the secret is not.