Skip to content

Commit 19dba6e

Browse files
committed
pull env
1 parent e9c92b3 commit 19dba6e

File tree

6 files changed

+55
-21
lines changed

6 files changed

+55
-21
lines changed

examples/nextjs/next.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {}
2+
const nextConfig = {
3+
env: {
4+
PUBLIC_ALCHEMY_KEY: process.env.PUBLIC_ALCHEMY_KEY,
5+
PUBLIC_WALLET_PRIVATE_KEY: process.env.PUBLIC_WALLET_PRIVATE_KEY,
6+
},
7+
}
38

49
module.exports = nextConfig

examples/nextjs/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6+
"prepare": "node pull-env.mjs",
67
"dev": "next dev",
78
"build": "next build",
89
"start": "next start",
@@ -12,7 +13,8 @@
1213
"@tanstack/react-query": "^5.0.0",
1314
"next": "13.5.5",
1415
"react": "^18",
15-
"react-dom": "^18"
16+
"react-dom": "^18",
17+
"undici": "^5.26.3"
1618
},
1719
"devDependencies": {
1820
"@types/node": "^20",

examples/nextjs/pull-env.mjs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { promises } from 'fs'
2+
import { fetch } from 'undici'
3+
4+
await fetch('https://vault.dotenv.org/pull.txt', {
5+
method: 'POST',
6+
body: 'DOTENV_VAULT=vlt_4011aac495b93f704eea755ec8deba6c5eac6f1a6af55ba645a32b3015dce13c&DOTENV_ME=it_a106570406176c5a9233bd477704bd3c863b660e00cbd4f179023a11714cec70',
7+
headers: {
8+
'content-type': 'application/x-www-form-urlencoded',
9+
},
10+
})
11+
.then((response) => response.text())
12+
.then((env) => promises.writeFile('.env', env))

examples/nextjs/src/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use client'
2+
13
export default function Home() {
24
return (
35
<main className="flex min-h-screen flex-col items-center justify-between p-24">

packages/sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@graphql-inspector/cli": "^4.0.2",
4040
"@graphql-inspector/config": "^4.0.1",
4141
"@parcel/watcher": "^2.3.0",
42-
"@soundxyz/codegen-fragments": "^2.0.0",
42+
"@soundxyz/codegen-fragments": "^2.0.1",
4343
"@types/node": "20.8.6",
4444
"bob-ts": "^4.1.1",
4545
"esbuild": "^0.19.4",

pnpm-lock.yaml

Lines changed: 31 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)