10.6.129 • Published 10 months ago

@patrtorg/enim-magni-hic v10.6.129

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

GitHub branch checks state codecov Known Vulnerabilities

🌐 Next.js Runtime Environment Configuration

Effortlessly populate your environment at runtime, not just at build time, with @patrtorg/enim-magni-hic.

🌟 Highlights:

  • Isomorphic Design: Works seamlessly on both server and browser, and even in middleware.
  • Next.js 13 & 14 Ready: Fully compatible with the latest Next.js features.
  • .env Friendly: Use .env files during development, just like standard Next.js.

šŸ¤” Why @patrtorg/enim-magni-hic?

In the modern software development landscape, the "Build once, deploy many" philosophy is key. This principle, essential for easy deployment and testability, is a cornerstone of continuous delivery and is embraced by the twelve-factor methodology. However, front-end development, particularly with Next.js, often lacks support for this - requiring separate builds for different environments. @patrtorg/enim-magni-hic is our solution to bridge this gap in Next.js.

šŸ“¦ Introducing @patrtorg/enim-magni-hic

@patrtorg/enim-magni-hic dynamically injects environment variables into your Next.js application at runtime. This approach adheres to the "build once, deploy many" principle, allowing the same build to be used across various environments without rebuilds.

šŸ¤ Compatibility Notes

šŸ”– Version Guide

  • 1.x: Next.js 12/13 Page Router
  • 2.x: Next.js 13 App Router
  • 3.x: Next.js 14 with advanced caching

šŸš€ Getting Started

In your app/layout.tsx, add:

// app/layout.tsx
import { PublicEnvScript } from '@patrtorg/enim-magni-hic';

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <head>
        <PublicEnvScript />
      </head>
      <body>
        {children}
      </body>
    </html>
  );
}

The PublicEnvScript component automatically exposes all environment variables prefixed with NEXT_PUBLIC_ to the browser. For custom variable exposure, refer to EXPOSING_CUSTOM_ENV.md.

šŸ§‘ā€šŸ’» Usage

Access your environment variables easily:

// app/client-page.tsx
'use client';
import { env } from '@patrtorg/enim-magni-hic';

export default function SomePage() {
  const NEXT_PUBLIC_FOO = env('NEXT_PUBLIC_FOO');
  return <main>NEXT_PUBLIC_FOO: {NEXT_PUBLIC_FOO}</main>;
}

šŸ›  Utilities

Need to expose non-prefixed environment variables to the browser? Check out MAKING_ENV_PUBLIC.md.

šŸ‘· Maintenance

@patrtorg/enim-magni-hic is proudly maintained by Expatfile.tax, the leading US expat tax e-filing software.

šŸ“š Acknowledgments

Kudos to the react-env project for the inspiration, and a shoutout to @andonirdgz for the innovative context provider idea!


safepackage.jsonObject.keysTypedArraycommand-linelazylintwidthECMAScript 2023byteless compilerworkflowqueuerecursiveutilityArrayRegExp#flagssyntaxdescriptorrangeerrorES5debuggenericsawaitvalidationtouchflatMapwatchbluebirdvalidatewritablesuperagentespreeaccessibilityremoveArrayBuffer#sliceencryptionyupfseventsgraphqldataviewcircularefficientgetterlinewrapflagsmkdirgetestsreducertypescriptObservabletoobjectfind-upmapreducepropcloudsearchopenbrowserslistCSSStyleDeclarationwatchinges8iterationwhichECMAScript 2021comparefile systemwalkingfunctionalindicatorendpointmodulesmodulehardlinkssorteast-asian-widthIteratorassignESmomentES7callboundmake diraccessorfoldercharacterprettyes-abstractdataStyleSheetpushauthclass-validatorrfc4122colourrmoffsetasciipnpm9react-testing-libraryprotobuftoolkitlook-upStreamsredirectprivateECMAScript 2020elasticachehookformcryptohashvaluebounds3namesBigUint64Arraymetadatarm -rfArray.prototype.includestrimStartfast-copyHyBislotjsxperformantcoerciblees-shimsobjkoreanawsrmdirutil$.extendinputbuffersflatrapidES2016fetchvaluesECMAScript 2016jsonpathreduxtimefast-deep-copypackage managerlibphonenumberiecode pointsvalidmatchAllpropertytddlengthnumbertypedarrayES6es6rdstc39logtypedarraysmapregulartakecloneiamhasschemexhrnpmcallsearchsidevpckarmatypesafequerystringprogressmixinsdataViewwatchFileloadingbeanstalktypanionquotestdlibArray.prototype.flattenruntimeio-tsimmerpersistentArray.prototype.containsregular expressionsextensionparenterrorclassnameses2018updropUint8Arraytaskwhatwgpruneomitargscomputed-typesincludesroutinghttpajaxwebhas-ownReflect.getPrototypeOffromastless mixinsECMAScript 7Object.entriesenumerableparsestylingrgbjoiES2015tapethrottlecopymakelistenerspolyfillphonegroupByelmpostcss-plugindirjscollectionutilitiestraversetypedWeakMapfastcopygetintrinsicfindLastIndexlaststreamssettingsmergecallbindrequirewalkoptionArray.prototype.findLastIndexURLSearchParamsoptimizerURLString.prototype.trimunicodelesscssexecnegativereal-timedescriptionjsonescapechaiSymbol.toStringTagcjkstabledynamodbdependenciespostcssmovecloudfrontpasswordtoSortedcreateqscss lesselbstatearraybufferprefixtostringtagrouteserializationdescriptorsisObject.is[[Prototype]]minimalfixed-widthweakmapnegative zeroprivate datafunctionsinferenceconnectlinkansiECMAScript 2018throatforEachstyled-componentsmonorepowgetreact-hookswatcherautoscalingconfigcallbackregexpexpressionECMAScript 5iteratedeleteasyncdom-testing-librarywarningfastclonestatelessweaksetRFC-6455ObjectArrayBufferwordbreakdayjsmobilejwtes5syntaxerrorines2017ECMAScript 6fastifytypesstyleJSONsetflagReactiveExtensionspathelectronhasOwnassertionjsdiffcall-bindarraysinternal slottrimLefthttpsslicecloudformationpromiseformES3mrucompile lesshigher-orderRegExp.prototype.flagsfluxlockfilel10nstylesgroupassertkeyidSymbolroute53deepcloneratelimitflattenMicrosoftapiprototypelook@@toStringTagauthenticationmochashamECMAScript 2019livei18nwordwrapmiddlewarejavascriptbufferjapaneseenderless csstoolsdebuggerloggersns
@patrtorg/numquam-doloribus-sit@patrtorg/doloribus-aperiam@patrtorg/dolorum-blanditiis@patrtorg/dolorum-quisquam-molestias@patrtorg/eaque-tempore-temporibus@patrtorg/ducimus-hic@patrtorg/eaque-dolorem-iusto@patrtorg/enim-culpa@patrtorg/enim-quas@patrtorg/est-corrupti@patrtorg/est-corrupti-deleniti@patrtorg/error-expedita-rerum@patrtorg/esse-ut@patrtorg/esse-occaecati-quos@patrtorg/ex-iure@patrtorg/expedita-deleniti-ratione@patrtorg/expedita-eaque-at@patrtorg/fugiat-beatae-quas@patrtorg/fugiat-perspiciatis@patrtorg/fugit-cumque@patrtorg/illo-saepe@patrtorg/hic-facere-ratione@patrtorg/itaque-beatae@patrtorg/iste-sunt@patrtorg/iure-at@patrtorg/labore-nemo-impedit@patrtorg/magnam-aut-adipisci@patrtorg/molestiae-nulla-architecto@patrtorg/modi-aut-dolorem@patrtorg/modi-officia-iusto@patrtorg/nihil-at@patrtorg/nihil-vero-ipsa@patrtorg/pariatur-sapiente@patrtorg/quia-laborum-porro@patrtorg/qui-dolore@patrtorg/quidem-dolore@patrtorg/qui-omnis-voluptates@patrtorg/similique-nam@patrtorg/sed-laudantium-nemo@patrtorg/sapiente-sed-eius@patrtorg/sapiente-eos-magnam@patrtorg/sed-veritatis-placeat@patrtorg/soluta-quo@patrtorg/nisi-perferendis@patrtorg/perspiciatis-possimus@patrtorg/quo-cupiditate-sit@patrtorg/saepe-tenetur-iusto@patrtorg/repellendus-ex@patrtorg/repudiandae-dolore@patrtorg/repellat-quam@patrtorg/tempora-quas@patrtorg/tempore-cumque@patrtorg/vero-quibusdam-ipsa@patrtorg/maiores-adipisci-maxime@patrtorg/nostrum-beatae-a@patrtorg/nobis-assumenda-optio@patrtorg/nobis-nobis@patrtorg/quas-sed-id@patrtorg/reiciendis-doloribus-officia@patrtorg/soluta-numquam@patrtorg/soluta-et@patrtorg/neque-consectetur@patrtorg/neque-voluptatem@patrtorg/odit-facere@patrtorg/officiis-qui@patrtorg/odio-ratione@patrtorg/officiis-dolorum@patrtorg/quos-hic@patrtorg/similique-vero-sapiente@patrtorg/sit-ipsam-dolore@patrtorg/suscipit-sit-culpa@patrtorg/tempora-impedit-dolore@patrtorg/porro-voluptates@patrtorg/quod-asperiores@patrtorg/tenetur-aut@patrtorg/tempore-labore-mollitia@patrtorg/totam-accusamus@patrtorg/veritatis-vel-amet@patrtorg/veritatis-ad-voluptates@patrtorg/occaecati-reiciendis-reiciendis@patrtorg/pariatur-repellendus-aspernatur@patrtorg/quo-in@patrtorg/sunt-distinctio-illo@patrtorg/sunt-asperiores@patrtorg/ullam-eum@patrtorg/ullam-doloremque@patrtorg/unde-cupiditate@patrtorg/animi-laboriosam-adipisci@patrtorg/aperiam-quaerat@patrtorg/aspernatur-assumenda@patrtorg/aspernatur-dolorum-ducimus@patrtorg/architecto-laudantium@patrtorg/aspernatur-repellendus-assumenda@patrtorg/assumenda-officia@patrtorg/assumenda-qui@patrtorg/assumenda-ipsam@patrtorg/aspernatur-laborum@patrtorg/at-sunt-itaque@patrtorg/commodi-illo@patrtorg/beatae-quas
10.6.127

10 months ago

10.6.129

10 months ago

10.6.128

10 months ago

5.1.81

12 months ago

5.1.80

12 months ago

7.2.89

11 months ago

4.1.33

1 year ago

7.2.88

11 months ago

4.1.38

1 year ago

7.3.100

11 months ago

4.1.39

1 year ago

4.1.34

1 year ago

4.1.35

1 year ago

4.1.36

1 year ago

5.1.82

12 months ago

4.1.37

1 year ago

9.4.112

10 months ago

7.2.93

11 months ago

7.2.92

11 months ago

7.2.95

11 months ago

7.2.94

11 months ago

7.2.91

11 months ago

9.4.113

10 months ago

7.2.90

11 months ago

7.2.96

11 months ago

5.1.79

12 months ago

5.1.78

12 months ago

5.1.77

12 months ago

5.1.76

12 months ago

5.1.75

12 months ago

3.1.33

1 year ago

3.1.30

1 year ago

3.1.32

1 year ago

2.1.18

1 year ago

3.1.31

1 year ago

2.1.19

1 year ago

4.1.52

1 year ago

2.1.27

1 year ago

4.1.53

1 year ago

4.1.54

1 year ago

2.1.25

1 year ago

4.1.55

1 year ago

2.1.26

1 year ago

2.1.23

1 year ago

2.1.24

1 year ago

4.1.50

1 year ago

2.1.21

1 year ago

4.1.51

1 year ago

2.1.22

1 year ago

2.1.20

1 year ago

4.1.56

1 year ago

1.1.16

1 year ago

4.1.57

1 year ago

1.1.15

1 year ago

4.1.58

1 year ago

4.1.59

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

7.3.103

11 months ago

7.3.104

11 months ago

7.3.101

11 months ago

7.3.102

11 months ago

10.5.118

10 months ago

4.1.41

1 year ago

4.1.42

1 year ago

4.1.43

1 year ago

4.1.44

1 year ago

10.5.117

10 months ago

4.1.40

1 year ago

4.1.49

1 year ago

4.1.45

1 year ago

4.1.46

1 year ago

4.1.47

1 year ago

4.1.48

1 year ago

10.4.114

10 months ago

10.4.113

10 months ago

10.4.116

10 months ago

10.4.115

10 months ago

10.4.117

10 months ago

7.3.96

11 months ago

4.1.74

12 months ago

4.1.75

12 months ago

7.3.98

11 months ago

4.1.70

12 months ago

7.3.97

11 months ago

4.1.71

12 months ago

4.1.72

12 months ago

7.3.99

11 months ago

4.1.73

12 months ago

8.3.112

10 months ago

8.3.111

11 months ago

8.3.110

11 months ago

3.1.27

1 year ago

3.1.29

1 year ago

3.1.28

1 year ago

4.1.63

1 year ago

4.1.64

1 year ago

4.1.65

1 year ago

4.1.66

1 year ago

6.1.82

12 months ago

4.1.60

1 year ago

8.3.109

11 months ago

4.1.61

1 year ago

8.3.108

11 months ago

4.1.62

1 year ago

8.3.107

11 months ago

8.3.106

11 months ago

8.3.105

11 months ago

9.3.112

10 months ago

8.3.104

11 months ago

4.1.67

1 year ago

4.1.68

12 months ago

4.1.69

12 months ago

10.6.125

10 months ago

10.6.124

10 months ago

10.6.126

10 months ago

10.6.121

10 months ago

10.6.120

10 months ago

10.6.123

10 months ago

10.6.122

10 months ago

6.2.86

11 months ago

6.2.87

11 months ago

6.2.84

12 months ago

6.2.85

11 months ago

6.2.88

11 months ago

6.2.82

12 months ago

6.2.83

12 months ago

10.6.118

10 months ago

10.6.119

10 months ago

1.1.14

1 year ago

1.0.11

1 year ago

1.0.13

1 year ago

1.1.13

1 year ago

1.0.12

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago