<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

PropTypeDefaultDescription
children
React.ReactNodeThe child components to be wrapped by the StackProvider.
app
StackClientApp | StackServerAppThe Stack app instance to be used.
langoptional
"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.
translationOverridesoptional
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
import { StackProvider } from '@stackframe/stack';
import { stackServerApp } from '@/stack';

function App() {
  return (
    <StackProvider
      app={stackServerApp}
      lang="de-DE"
      translationOverrides={{
        "Sign in": "Einloggen",
        "Sign In": "Einloggen",
      }}
    >
      {/* Your app content */}
    </StackProvider>
  );
}

Table of Contents

Navigate this page

On this page

Stack Auth AI

Documentation assistant

Experimental: AI responses may not always be accurate—please verify important details.

For the most accurate information, please join our Discord or email us.

How can I help?

Ask me about Stack Auth while you browse the docs.