<StackProvider />

A React component that provides Stack context to its children.

For detailed usage instructions, please refer to the manual section of the setup guide.

Props

  • children: React.ReactNode - The child components to be wrapped by the StackProvider.
  • app: StackClientApp | StackServerApp - The Stack app instance to be used.
  • lang (optional): "en-US" | "de-DE" | "es-419" | "es-ES" | "fr-CA" | "fr-FR" | "it-IT" | "pt-BR" | "pt-PT" - The language to be used for translations.
  • translationOverrides (optional): Record<string, string> - A mapping of English translations to translated equivalents. These will take priority over the translations from the language specified in the lang property. Note that the keys are case-sensitive. You can find a full list of supported strings on GitHub.

Example

layout.tsx
1import { StackProvider } from '@stackframe/stack';
2import { stackServerApp } from '@/stack';
3
4function App() {
5 return (
6 <StackProvider
7 app={stackServerApp}
8 lang="de-DE"
9 translationOverrides={{
10 "Sign in": "Einloggen",
11 "Sign In": "Einloggen",
12 }}
13 >
14 {/* Your app content */}
15 </StackProvider>
16 );
17}