Skip to content

Commit fb11f2d

Browse files
auto-gold-bits uses authproxy to make requests now
1 parent a819725 commit fb11f2d

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

apps/auto-gold-bits/index.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import { FetchHttpClient, PlatformConfigProvider } from "@effect/platform";
2-
import { NodeContext, NodeRuntime } from "@effect/platform-node";
1+
import { FetchHttpClient } from "@effect/platform";
2+
import { NodeRuntime } from "@effect/platform-node";
33
import { NimblebitAuth, NimblebitConfig } from "@tinyburg/nimblebit-sdk";
44
import { Bitizens, SyncItemType, TinyTower } from "@tinyburg/tinytower-sdk";
5-
import { Array, Effect, Layer, Schema, type Types } from "effect";
6-
7-
const Live = Layer.merge(FetchHttpClient.layer, NimblebitAuth.layerNodeDirectConfig())
8-
.pipe(Layer.provide(PlatformConfigProvider.layerDotEnvAdd(".env")))
9-
.pipe(Layer.provide(NodeContext.layer));
5+
import { Array, Config, Effect, Layer, Schema, type Types } from "effect";
6+
7+
const Live = Layer.merge(
8+
FetchHttpClient.layer,
9+
NimblebitAuth.layerNodeTinyburgAuthProxyConfig({
10+
authKey: Config.redacted("AUTH_KEY"),
11+
})
12+
);
1013

1114
const program = Effect.gen(function* () {
1215
const authenticatedPlayer = yield* NimblebitConfig.AuthenticatedPlayerConfig;

apps/auto-gold-bits/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{ "path": "../../packages/nimblebit-sdk/tsconfig.src.json" },
55
{ "path": "../../packages/tinytower-sdk/tsconfig.src.json" }
66
],
7+
"include": ["index.ts"],
78
"compilerOptions": {
89
"noEmit": true,
910
"declaration": false,

0 commit comments

Comments
 (0)