A single app always runs in multiple environments, including at least on your development machine and in production on Heroku. An open-source app might be deployed to hundreds of different environments.Although these environments might all run the same code, they usually have environment-specific configurations. For example, an app’s staging and production environments might use different Amazon S3 buckets, meaning they also need different credentials for those buckets.An app’s environment-specific configuration should be stored in environment variables (not in the app’s source code). This lets you modify each environment’s configuration in isolation, and prevents secure credentials from being stored in version control.On a traditional host or when working locally, you often set environment variables in your .bashrc file. On Heroku, you use config vars.
Config var keys should use only alphanumeric characters and the underscore character (_) to ensure that they are accessible from all programming languages. Config var keys should not include the hyphen character.
Config var data (the combination of all keys and values) cannot exceed 32kb for each app.
Config var keys should not begin with a double underscore (__).
A config var’s key should not begin with HEROKU_ unless it is set by the Heroku platform itself.
If you provision an add-on for your app, it usually adds one or more config vars to the app. The values of these config vars might be updated by the add-on provider at any time.
{"docsConfig":{"$schema":"https://mintlify.com/docs.json","theme":"mint","name":"envsecrets","colors":{"primary":"#148BF2","light":"#148BF2","dark":"#0D001D"},"favicon":"./static/favicon.svg","logo":null,"background":{"decoration":null,"color":{"light":null,"dark":"#090014"}},"navbar":{"links":[{"label":"Support","href":"mailto:[email protected]"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.envsecrets.com"}},"footer":{"socials":{"discord":"https://discord.gg/4YaTFZ2xBA","github":"https://github.com/envsecrets/envsecrets","twitter":"https://twitter.com/envsecrets","linkedin":"https://www.linkedin.com/company/envsecrets"}},"navigation":{"global":{"anchors":[{"anchor":"Documentation","href":"https://docs.envsecrets.com","icon":"book-open-cover"},{"anchor":"Repository","href":"https://github.com/envsecrets/envsecrets","icon":"github"},{"anchor":"Community","href":"https://discord.gg/4YaTFZ2xBA","icon":"discord"},{"anchor":"Issues \u0026 Discussions","href":"https://github.com/orgs/envsecrets/discussions","icon":"code-pull-request"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"envsecrets-91","hasAudioNarration":false,"actualSubdomain":"envsecrets-91","customDomains":["docs.envsecrets.com"],"gitSource":{"type":"github","owner":"envsecrets","repo":"mintlify","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"edits":true,"issues":true},"entitlements":{},"buildId":"6ae91d41c02c8f1beff4b2b6:success","clientVersion":"0.0.4111","searchFilterCounts":[{"language":"default","tag":"Documentation","count":32},{"language":"default","tag":"Command Line","count":12},{"language":"default","tag":"Commands","count":11},{"language":"default","tag":"Integrations","count":11},{"language":"default","tag":"Get Started","count":5},{"language":"default","tag":"Security","count":4},{"language":"default","tag":"Concepts","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"integrations/heroku","slug":"/integrations/heroku","pageMetadata":{"title":"Heroku","description":"How to continuously sync your secrets with your Heroku application.","href":"/integrations/heroku"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How to continuously sync your secrets with your Heroku application.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Tip}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`brief-about-heroku’s-config-variables`,children:`Brief about Heroku’s Config Variables`}),`\n`,_jsx(_components.p,{children:`A single app always runs in multiple environments, including at least on your development machine and in production on Heroku. An open-source app might be deployed to hundreds of different environments.`}),`\n`,_jsx(_components.p,{children:`Although these environments might all run the same code, they usually have environment-specific configurations. For example, an app’s staging and production environments might use different Amazon S3 buckets, meaning they also need different credentials for those buckets.`}),`\n`,_jsx(_components.p,{children:`An app’s environment-specific configuration should be stored in environment variables (not in the app’s source code). This lets you modify each environment’s configuration in isolation, and prevents secure credentials from being stored in version control.`}),`\n`,_jsx(_components.p,{children:`On a traditional host or when working locally, you often set environment variables in your .bashrc file. On Heroku, you use config vars.`}),`\n`,_jsx(Heading,{level:`2`,id:`setup`,children:`Setup`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[`Go to `,_jsx(_components.a,{href:`https://app.envsecrets.com/integrations/catalog`,children:`integrations catalog`}),` in your envsecrets dashboard and choose “Heroku.”`]}),`\n`,_jsx(_components.li,{children:`Complete the Oauth procedure that begins and grant access to all of your Heroku application to which you wish to sync your secrets.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`activation`,children:`Activation`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Go to the `,_jsx(_components.a,{href:`https://app.envsecrets.com/integrations`,children:`integrations`}),` dashboard in your envsecrets organisation and under “Heroku” choose “Sync New Environment With Your Heroku Account.”`]}),`\n`,_jsx(_components.li,{children:`In the page that opens, select your envsecrets project, environment and your Heroku application where you wish to push/sync your secrets.`}),`\n`,_jsx(_components.li,{children:`Complete and save the form.`}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`usage`,children:`Usage`}),`\n`,_jsx(Heading,{level:`3`,id:`platform`,children:`Platform`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Navigate to the environment for which you activated the integration.`}),`\n`,_jsx(_components.li,{children:`Click on the “Sync” button.`}),`\n`,_jsx(_components.li,{children:`Choose the Heroku application to which you want to sync your secrets.`}),`\n`,_jsx(_components.li,{children:`Approve the sync.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`cli`,children:`CLI`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Use the command: `,_jsx(_components.code,{children:`envs sync --env [name-of-your-remote-environment]`})]}),`\n`,_jsx(_components.li,{children:`Choose the Heroku integration.`}),`\n`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Once your secrets are synced, it is recommended you go to your Heroku application and validate the new values.`})}),`\n`,_jsx(Heading,{level:`2`,id:`policies-about-heroku’s-config-variables`,children:`Policies about Heroku’s Config Variables`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Config var keys should use only alphanumeric characters and the underscore character (_) to ensure that they are accessible from all programming languages. Config var keys should not include the hyphen character.`}),`\n`,_jsx(_components.li,{children:`Config var data (the combination of all keys and values) cannot exceed 32kb for each app.`}),`\n`,_jsx(_components.li,{children:`Config var keys should not begin with a double underscore (__).`}),`\n`,_jsx(_components.li,{children:`A config var’s key should not begin with HEROKU_ unless it is set by the Heroku platform itself.`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`add-ons-and-config-vars`,children:`Add-ons and config vars`}),`\n`,_jsx(_components.p,{children:`If you provision an add-on for your app, it usually adds one or more config vars to the app. The values of these config vars might be updated by the add-on provider at any time.`})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Heroku","description":"How to continuously sync your secrets with your Heroku application.","href":"/integrations/heroku"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Brief about Heroku’s Config Variables","slug":"brief-about-heroku’s-config-variables","depth":2,"children":[]},{"title":"Setup","slug":"setup","depth":2,"children":[]},{"title":"Activation","slug":"activation","depth":2,"children":[]},{"title":"Usage","slug":"usage","depth":2,"children":[{"title":"Platform","slug":"platform","depth":3,"children":[]},{"title":"CLI","slug":"cli","depth":3,"children":[]}]},{"title":"Policies about Heroku’s Config Variables","slug":"policies-about-heroku’s-config-variables","depth":2,"children":[{"title":"Add-ons and config vars","slug":"add-ons-and-config-vars","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"envsecrets-91","siteName":"envsecrets","title":"Heroku - envsecrets","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-01-06T23:46:31.890Z","originalFileLocation":"integrations/heroku.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How to continuously sync your secrets with your Heroku application.\">\u003cmeta data-mint-head name=\"application-name\" content=\"envsecrets\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Heroku - envsecrets\">\u003cmeta data-mint-head property=\"og:description\" content=\"How to continuously sync your secrets with your Heroku application.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"envsecrets\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.envsecrets.com/integrations/heroku\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://envsecrets-91.mintlify.site/_mintlify/api/og/v2?division=Integrations\u0026amp;title=Heroku\u0026amp;description=How+to+continuously+sync+your+secrets+with+your+Heroku+application.\u0026amp;theme=2091a5c8b773abf2ba5aacd3\u0026amp;signature=acb7cb31108168bc0b85df503504d0016a44c7bee016f44eaea45edf7fe0ccfe\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Heroku - envsecrets\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How to continuously sync your secrets with your Heroku application.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://envsecrets-91.mintlify.site/_mintlify/api/og/v2?division=Integrations\u0026amp;title=Heroku\u0026amp;description=How+to+continuously+sync+your+secrets+with+your+Heroku+application.\u0026amp;theme=2091a5c8b773abf2ba5aacd3\u0026amp;signature=acb7cb31108168bc0b85df503504d0016a44c7bee016f44eaea45edf7fe0ccfe\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/envsecrets-91/KS4-eAoKdHnatNXe/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"envsecrets\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#148BF2\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.envsecrets.com/integrations/heroku\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/integrations/heroku.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.envsecrets.com/#organization\",\"name\":\"envsecrets\",\"url\":\"https://docs.envsecrets.com\"},{\"@type\":\"WebSite\",\"@id\":\"https://docs.envsecrets.com#website\",\"name\":\"envsecrets\",\"url\":\"https://docs.envsecrets.com\",\"publisher\":{\"@id\":\"https://docs.envsecrets.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.envsecrets.com/integrations/heroku#webpage\",\"url\":\"https://docs.envsecrets.com/integrations/heroku\",\"name\":\"Heroku\",\"description\":\"How to continuously sync your secrets with your Heroku application.\",\"dateModified\":\"2026-01-06T23:46:31.890Z\",\"isPartOf\":{\"@id\":\"https://docs.envsecrets.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.envsecrets.com/integrations/heroku#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.envsecrets.com/integrations/heroku#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Integrations\",\"item\":\"https://docs.envsecrets.com/integrations/github\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Heroku\",\"item\":\"https://docs.envsecrets.com/integrations/heroku\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.envsecrets.com/integrations/heroku#article\",\"headline\":\"Heroku\",\"name\":\"Heroku\",\"description\":\"How to continuously sync your secrets with your Heroku application.\",\"url\":\"https://docs.envsecrets.com/integrations/heroku\",\"mainEntityOfPage\":{\"@id\":\"https://docs.envsecrets.com/integrations/heroku#webpage\"},\"dateModified\":\"2026-01-06T23:46:31.890Z\",\"publisher\":{\"@id\":\"https://docs.envsecrets.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.envsecrets.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"envsecrets\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"envsecrets\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/integrations/heroku.md","siteName":"envsecrets","nav":{"global":{"anchors":[{"anchor":"Documentation","href":"https://docs.envsecrets.com","icon":"book-open-cover"},{"anchor":"Repository","href":"https://github.com/envsecrets/envsecrets","icon":"github"},{"anchor":"Community","href":"https://discord.gg/4YaTFZ2xBA","icon":"discord"},{"anchor":"Issues \u0026 Discussions","href":"https://github.com/orgs/envsecrets/discussions","icon":"code-pull-request"}]},"anchors":[{"anchor":"Documentation","icon":"book-open","groups":[{"group":"Get Started","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"},{"group":"Concepts","pages":[{"title":"Secrets \u0026 Versions","href":"/concepts/secret"},{"title":"Orgnisational Heirarchy","href":"/concepts/heirarchy"},{"title":"Environment Tokens","href":"/concepts/token"}]}]},{"group":"Security","pages":[{"title":"Data Model","href":"/security/model"},{"title":"Promises","href":"/security/promises"},{"title":"Multi-Factor Authentication","href":"/security/mfa"},{"title":"Authorization","href":"/security/access_control"}]},{"group":"Command Line","pages":[{"title":"Installation","href":"/cli/install"},{"group":"Commands","pages":[{"title":"Login","href":"/cli/commands/envs_login"},{"title":"Logout","href":"/cli/commands/envs_logout"},{"title":"Init","href":"/cli/commands/envs_init"},{"title":"Get","href":"/cli/commands/envs_get"},{"title":"Set","href":"/cli/commands/envs_set"},{"title":"List","href":"/cli/commands/envs_list"},{"title":"Delete","href":"/cli/commands/envs_delete"},{"title":"Export","href":"/cli/commands/envs_export"},{"title":"Run","href":"/cli/commands/envs_run"},{"title":"Sync","href":"/cli/commands/envs_sync"},{"title":"Completion","href":"/cli/commands/envs_completion"}]}]},{"group":"Integrations","pages":[{"title":"Github Actions","href":"/integrations/github"},{"title":"Gitlab","href":"/integrations/gitlab"},{"title":"AWS Secrets Manager","href":"/integrations/asm"},{"title":"GCP Secrets Manager","href":"/integrations/gsm"},{"title":"Supabase","href":"/integrations/supabase"},{"title":"Circle CI","href":"/integrations/circleci"},{"title":"Railway","href":"/integrations/railway"},{"title":"Hasura Cloud","description":"How to continuously sync your secrets with Hasura.","href":"/integrations/hasura"},{"title":"Heroku","href":"/integrations/heroku"},{"title":"Nhost","description":"How to continuously sync your secrets with Nhost.","href":"/integrations/nhost"},{"title":"Vercel","href":"/integrations/vercel"}]}]}]},"basePath":"","title":"Heroku - envsecrets","buildId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","deploymentId":"dpl_DqYu5MPb49gWBBbUGgpHQUmCHY3P","dynamics":[],"chunks":[]}